@tscircuit/props 0.0.467 → 0.0.468
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 +2416 -21
- package/dist/index.js +874 -856
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +5 -0
- package/lib/common/pcbSx.ts +30 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -39,7 +39,7 @@ var distance = baseDistance;
|
|
|
39
39
|
var pcbCoordinate = calcString.or(baseDistance);
|
|
40
40
|
|
|
41
41
|
// lib/common/layout.ts
|
|
42
|
-
import { z as
|
|
42
|
+
import { z as z15 } from "zod";
|
|
43
43
|
|
|
44
44
|
// lib/common/cadModel.ts
|
|
45
45
|
import { z as z6 } from "zod";
|
|
@@ -270,21 +270,35 @@ var pcbStyle = z11.object({
|
|
|
270
270
|
});
|
|
271
271
|
expectTypesMatch(true);
|
|
272
272
|
|
|
273
|
+
// lib/common/pcbSx.ts
|
|
274
|
+
import { length as length2 } from "circuit-json";
|
|
275
|
+
import { z as z12 } from "zod";
|
|
276
|
+
var pcbSxValue = z12.object({
|
|
277
|
+
fontSize: length2.optional(),
|
|
278
|
+
pcbX: pcbCoordinate.optional(),
|
|
279
|
+
pcbY: pcbCoordinate.optional()
|
|
280
|
+
});
|
|
281
|
+
var pcbSx = z12.record(
|
|
282
|
+
z12.string(),
|
|
283
|
+
pcbSxValue
|
|
284
|
+
);
|
|
285
|
+
expectTypesMatch(true);
|
|
286
|
+
|
|
273
287
|
// lib/common/schStyle.ts
|
|
274
288
|
import { distance as distance7 } from "circuit-json";
|
|
275
|
-
import { z as
|
|
276
|
-
var schStyle =
|
|
277
|
-
defaultPassiveSize:
|
|
278
|
-
defaultCapacitorOrientation:
|
|
289
|
+
import { z as z13 } from "zod";
|
|
290
|
+
var schStyle = z13.object({
|
|
291
|
+
defaultPassiveSize: z13.union([z13.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
292
|
+
defaultCapacitorOrientation: z13.enum(["vertical", "none"]).optional()
|
|
279
293
|
});
|
|
280
294
|
expectTypesMatch(true);
|
|
281
295
|
|
|
282
296
|
// lib/common/symbolProp.ts
|
|
283
|
-
import { z as
|
|
284
|
-
var symbolProp =
|
|
297
|
+
import { z as z14 } from "zod";
|
|
298
|
+
var symbolProp = z14.custom((v) => true);
|
|
285
299
|
|
|
286
300
|
// lib/common/layout.ts
|
|
287
|
-
var pcbLayoutProps =
|
|
301
|
+
var pcbLayoutProps = z15.object({
|
|
288
302
|
pcbX: pcbCoordinate.optional(),
|
|
289
303
|
pcbY: pcbCoordinate.optional(),
|
|
290
304
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -294,8 +308,8 @@ var pcbLayoutProps = z14.object({
|
|
|
294
308
|
pcbOffsetX: distance8.optional(),
|
|
295
309
|
pcbOffsetY: distance8.optional(),
|
|
296
310
|
pcbRotation: rotation2.optional(),
|
|
297
|
-
pcbPositionAnchor:
|
|
298
|
-
pcbPositionMode:
|
|
311
|
+
pcbPositionAnchor: z15.string().optional(),
|
|
312
|
+
pcbPositionMode: z15.enum([
|
|
299
313
|
"relative_to_group_anchor",
|
|
300
314
|
"auto",
|
|
301
315
|
"relative_to_board_anchor",
|
|
@@ -309,11 +323,12 @@ var pcbLayoutProps = z14.object({
|
|
|
309
323
|
pcbMarginX: distance8.optional(),
|
|
310
324
|
pcbMarginY: distance8.optional(),
|
|
311
325
|
pcbStyle: pcbStyle.optional(),
|
|
312
|
-
|
|
313
|
-
|
|
326
|
+
pcbSx: pcbSx.optional(),
|
|
327
|
+
pcbRelative: z15.boolean().optional(),
|
|
328
|
+
relative: z15.boolean().optional()
|
|
314
329
|
});
|
|
315
330
|
expectTypesMatch(true);
|
|
316
|
-
var commonLayoutProps =
|
|
331
|
+
var commonLayoutProps = z15.object({
|
|
317
332
|
pcbX: pcbCoordinate.optional(),
|
|
318
333
|
pcbY: pcbCoordinate.optional(),
|
|
319
334
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -323,8 +338,8 @@ var commonLayoutProps = z14.object({
|
|
|
323
338
|
pcbOffsetX: distance8.optional(),
|
|
324
339
|
pcbOffsetY: distance8.optional(),
|
|
325
340
|
pcbRotation: rotation2.optional(),
|
|
326
|
-
pcbPositionAnchor:
|
|
327
|
-
pcbPositionMode:
|
|
341
|
+
pcbPositionAnchor: z15.string().optional(),
|
|
342
|
+
pcbPositionMode: z15.enum([
|
|
328
343
|
"relative_to_group_anchor",
|
|
329
344
|
"auto",
|
|
330
345
|
"relative_to_board_anchor",
|
|
@@ -337,6 +352,7 @@ var commonLayoutProps = z14.object({
|
|
|
337
352
|
pcbMarginX: distance8.optional(),
|
|
338
353
|
pcbMarginY: distance8.optional(),
|
|
339
354
|
pcbStyle: pcbStyle.optional(),
|
|
355
|
+
pcbSx: pcbSx.optional(),
|
|
340
356
|
schMarginTop: distance8.optional(),
|
|
341
357
|
schMarginRight: distance8.optional(),
|
|
342
358
|
schMarginBottom: distance8.optional(),
|
|
@@ -350,48 +366,48 @@ var commonLayoutProps = z14.object({
|
|
|
350
366
|
footprint: footprintProp.optional(),
|
|
351
367
|
symbol: symbolProp.optional(),
|
|
352
368
|
schStyle: schStyle.optional(),
|
|
353
|
-
relative:
|
|
354
|
-
schRelative:
|
|
355
|
-
pcbRelative:
|
|
369
|
+
relative: z15.boolean().optional(),
|
|
370
|
+
schRelative: z15.boolean().optional(),
|
|
371
|
+
pcbRelative: z15.boolean().optional()
|
|
356
372
|
});
|
|
357
373
|
expectTypesMatch(true);
|
|
358
|
-
var supplierProps =
|
|
359
|
-
supplierPartNumbers:
|
|
374
|
+
var supplierProps = z15.object({
|
|
375
|
+
supplierPartNumbers: z15.record(supplier_name, z15.array(z15.string())).optional()
|
|
360
376
|
});
|
|
361
377
|
expectTypesMatch(true);
|
|
362
|
-
var pinAttributeMap =
|
|
363
|
-
providesPower:
|
|
364
|
-
requiresPower:
|
|
365
|
-
providesGround:
|
|
366
|
-
requiresGround:
|
|
367
|
-
providesVoltage:
|
|
368
|
-
requiresVoltage:
|
|
369
|
-
doNotConnect:
|
|
370
|
-
includeInBoardPinout:
|
|
371
|
-
highlightColor:
|
|
372
|
-
mustBeConnected:
|
|
378
|
+
var pinAttributeMap = z15.object({
|
|
379
|
+
providesPower: z15.boolean().optional(),
|
|
380
|
+
requiresPower: z15.boolean().optional(),
|
|
381
|
+
providesGround: z15.boolean().optional(),
|
|
382
|
+
requiresGround: z15.boolean().optional(),
|
|
383
|
+
providesVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
384
|
+
requiresVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
385
|
+
doNotConnect: z15.boolean().optional(),
|
|
386
|
+
includeInBoardPinout: z15.boolean().optional(),
|
|
387
|
+
highlightColor: z15.string().optional(),
|
|
388
|
+
mustBeConnected: z15.boolean().optional()
|
|
373
389
|
});
|
|
374
390
|
expectTypesMatch(true);
|
|
375
391
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
376
|
-
key:
|
|
377
|
-
name:
|
|
378
|
-
displayName:
|
|
392
|
+
key: z15.any().optional(),
|
|
393
|
+
name: z15.string(),
|
|
394
|
+
displayName: z15.string().optional(),
|
|
379
395
|
datasheetUrl: url.optional(),
|
|
380
396
|
cadModel: cadModelProp.optional(),
|
|
381
397
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
382
398
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
383
|
-
children:
|
|
384
|
-
symbolName:
|
|
385
|
-
doNotPlace:
|
|
386
|
-
obstructsWithinBounds:
|
|
399
|
+
children: z15.any().optional(),
|
|
400
|
+
symbolName: z15.string().optional(),
|
|
401
|
+
doNotPlace: z15.boolean().optional(),
|
|
402
|
+
obstructsWithinBounds: z15.boolean().optional().describe(
|
|
387
403
|
"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"
|
|
388
404
|
),
|
|
389
|
-
showAsTranslucentModel:
|
|
405
|
+
showAsTranslucentModel: z15.boolean().optional().describe(
|
|
390
406
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
391
407
|
),
|
|
392
|
-
pinAttributes:
|
|
393
|
-
mfn:
|
|
394
|
-
manufacturerPartNumber:
|
|
408
|
+
pinAttributes: z15.record(z15.string(), pinAttributeMap).optional(),
|
|
409
|
+
mfn: z15.string().describe("Manufacturer Part Number").optional(),
|
|
410
|
+
manufacturerPartNumber: z15.string().optional()
|
|
395
411
|
});
|
|
396
412
|
expectTypesMatch(true);
|
|
397
413
|
var componentProps = commonComponentProps;
|
|
@@ -406,7 +422,7 @@ var lrPolarPins = [
|
|
|
406
422
|
"cathode",
|
|
407
423
|
"neg"
|
|
408
424
|
];
|
|
409
|
-
var distanceOrMultiplier = distance8.or(
|
|
425
|
+
var distanceOrMultiplier = distance8.or(z15.enum(["2x", "3x", "4x"]));
|
|
410
426
|
|
|
411
427
|
// lib/generated/footprinter-autocomplete.ts
|
|
412
428
|
var footprinterStringExamples = [
|
|
@@ -435,8 +451,8 @@ var footprinterStringExamples = [
|
|
|
435
451
|
];
|
|
436
452
|
|
|
437
453
|
// lib/common/schematicOrientation.ts
|
|
438
|
-
import { z as
|
|
439
|
-
var schematicOrientation =
|
|
454
|
+
import { z as z16 } from "zod";
|
|
455
|
+
var schematicOrientation = z16.enum([
|
|
440
456
|
"vertical",
|
|
441
457
|
"horizontal",
|
|
442
458
|
"pos_top",
|
|
@@ -455,32 +471,32 @@ expectTypesMatch(
|
|
|
455
471
|
);
|
|
456
472
|
|
|
457
473
|
// lib/common/schematicPinDefinitions.ts
|
|
458
|
-
import { z as
|
|
459
|
-
var explicitPinSideDefinition =
|
|
460
|
-
pins:
|
|
461
|
-
direction:
|
|
462
|
-
|
|
463
|
-
|
|
464
|
-
|
|
465
|
-
|
|
474
|
+
import { z as z17 } from "zod";
|
|
475
|
+
var explicitPinSideDefinition = z17.object({
|
|
476
|
+
pins: z17.array(z17.union([z17.number(), z17.string()])),
|
|
477
|
+
direction: z17.union([
|
|
478
|
+
z17.literal("top-to-bottom"),
|
|
479
|
+
z17.literal("left-to-right"),
|
|
480
|
+
z17.literal("bottom-to-top"),
|
|
481
|
+
z17.literal("right-to-left")
|
|
466
482
|
])
|
|
467
483
|
});
|
|
468
|
-
var pinSideDefinitionInput =
|
|
469
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
484
|
+
var pinSideDefinitionInput = z17.array(z17.union([z17.number(), z17.string()]));
|
|
485
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z17.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
470
486
|
(value) => Array.isArray(value) ? {
|
|
471
487
|
pins: value,
|
|
472
488
|
direction: direction2
|
|
473
489
|
} : value
|
|
474
490
|
);
|
|
475
|
-
var schematicPortArrangement =
|
|
476
|
-
leftSize:
|
|
477
|
-
topSize:
|
|
478
|
-
rightSize:
|
|
479
|
-
bottomSize:
|
|
480
|
-
leftPinCount:
|
|
481
|
-
rightPinCount:
|
|
482
|
-
topPinCount:
|
|
483
|
-
bottomPinCount:
|
|
491
|
+
var schematicPortArrangement = z17.object({
|
|
492
|
+
leftSize: z17.number().optional().describe("@deprecated, use leftPinCount"),
|
|
493
|
+
topSize: z17.number().optional().describe("@deprecated, use topPinCount"),
|
|
494
|
+
rightSize: z17.number().optional().describe("@deprecated, use rightPinCount"),
|
|
495
|
+
bottomSize: z17.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
496
|
+
leftPinCount: z17.number().optional(),
|
|
497
|
+
rightPinCount: z17.number().optional(),
|
|
498
|
+
topPinCount: z17.number().optional(),
|
|
499
|
+
bottomPinCount: z17.number().optional(),
|
|
484
500
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
485
501
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
486
502
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -491,9 +507,9 @@ expectTypesMatch(true);
|
|
|
491
507
|
|
|
492
508
|
// lib/common/schematicPinStyle.ts
|
|
493
509
|
import { distance as distance9 } from "circuit-json";
|
|
494
|
-
import { z as
|
|
495
|
-
var schematicPinStyle =
|
|
496
|
-
|
|
510
|
+
import { z as z18 } from "zod";
|
|
511
|
+
var schematicPinStyle = z18.record(
|
|
512
|
+
z18.object({
|
|
497
513
|
marginLeft: distance9.optional(),
|
|
498
514
|
marginRight: distance9.optional(),
|
|
499
515
|
marginTop: distance9.optional(),
|
|
@@ -507,17 +523,17 @@ var schematicPinStyle = z17.record(
|
|
|
507
523
|
expectTypesMatch(true);
|
|
508
524
|
|
|
509
525
|
// lib/common/schematicPinLabel.ts
|
|
510
|
-
import { z as
|
|
511
|
-
var schematicPinLabel =
|
|
526
|
+
import { z as z19 } from "zod";
|
|
527
|
+
var schematicPinLabel = z19.string().regex(/^[A-Za-z0-9_]+$/);
|
|
512
528
|
|
|
513
529
|
// lib/common/schematicSize.ts
|
|
514
530
|
import { distance as distance10 } from "circuit-json";
|
|
515
|
-
import { z as
|
|
516
|
-
var schematicSymbolSize = distance10.or(
|
|
531
|
+
import { z as z20 } from "zod";
|
|
532
|
+
var schematicSymbolSize = distance10.or(z20.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
517
533
|
|
|
518
534
|
// lib/common/kicadPinMetadata.ts
|
|
519
|
-
import { z as
|
|
520
|
-
var kicadPinElectricalType =
|
|
535
|
+
import { z as z21 } from "zod";
|
|
536
|
+
var kicadPinElectricalType = z21.enum([
|
|
521
537
|
"input",
|
|
522
538
|
"output",
|
|
523
539
|
"bidirectional",
|
|
@@ -531,7 +547,7 @@ var kicadPinElectricalType = z20.enum([
|
|
|
531
547
|
"open_emitter",
|
|
532
548
|
"no_connect"
|
|
533
549
|
]);
|
|
534
|
-
var kicadPinGraphicStyle =
|
|
550
|
+
var kicadPinGraphicStyle = z21.enum([
|
|
535
551
|
"line",
|
|
536
552
|
"inverted",
|
|
537
553
|
"clock",
|
|
@@ -542,7 +558,7 @@ var kicadPinGraphicStyle = z20.enum([
|
|
|
542
558
|
"falling_edge_clock",
|
|
543
559
|
"nonlogic"
|
|
544
560
|
]);
|
|
545
|
-
var kicadPinMetadata =
|
|
561
|
+
var kicadPinMetadata = z21.object({
|
|
546
562
|
electricalType: kicadPinElectricalType.optional(),
|
|
547
563
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
548
564
|
pinLength: distance.optional(),
|
|
@@ -552,8 +568,8 @@ var kicadPinMetadata = z20.object({
|
|
|
552
568
|
expectTypesMatch(true);
|
|
553
569
|
|
|
554
570
|
// lib/common/ninePointAnchor.ts
|
|
555
|
-
import { z as
|
|
556
|
-
var ninePointAnchor =
|
|
571
|
+
import { z as z22 } from "zod";
|
|
572
|
+
var ninePointAnchor = z22.enum([
|
|
557
573
|
"top_left",
|
|
558
574
|
"top_center",
|
|
559
575
|
"top_right",
|
|
@@ -566,44 +582,44 @@ var ninePointAnchor = z21.enum([
|
|
|
566
582
|
]);
|
|
567
583
|
|
|
568
584
|
// lib/components/board.ts
|
|
569
|
-
import { z as
|
|
585
|
+
import { z as z36 } from "zod";
|
|
570
586
|
|
|
571
587
|
// lib/components/group.ts
|
|
572
|
-
import { length as
|
|
573
|
-
import { z as
|
|
588
|
+
import { length as length3, distance as distance11 } from "circuit-json";
|
|
589
|
+
import { z as z35 } from "zod";
|
|
574
590
|
|
|
575
591
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
576
|
-
import { z as
|
|
577
|
-
var base_manual_edit_event =
|
|
578
|
-
edit_event_id:
|
|
579
|
-
in_progress:
|
|
580
|
-
created_at:
|
|
592
|
+
import { z as z23 } from "zod";
|
|
593
|
+
var base_manual_edit_event = z23.object({
|
|
594
|
+
edit_event_id: z23.string(),
|
|
595
|
+
in_progress: z23.boolean().optional(),
|
|
596
|
+
created_at: z23.number()
|
|
581
597
|
});
|
|
582
598
|
expectTypesMatch(
|
|
583
599
|
true
|
|
584
600
|
);
|
|
585
601
|
|
|
586
602
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
587
|
-
import { z as
|
|
603
|
+
import { z as z24 } from "zod";
|
|
588
604
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
589
|
-
pcb_edit_event_type:
|
|
590
|
-
edit_event_type:
|
|
591
|
-
pcb_component_id:
|
|
592
|
-
original_center:
|
|
593
|
-
new_center:
|
|
605
|
+
pcb_edit_event_type: z24.literal("edit_component_location").describe("deprecated"),
|
|
606
|
+
edit_event_type: z24.literal("edit_pcb_component_location"),
|
|
607
|
+
pcb_component_id: z24.string(),
|
|
608
|
+
original_center: z24.object({ x: z24.number(), y: z24.number() }),
|
|
609
|
+
new_center: z24.object({ x: z24.number(), y: z24.number() })
|
|
594
610
|
});
|
|
595
611
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
596
612
|
expectTypesMatch(true);
|
|
597
613
|
|
|
598
614
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
599
|
-
import { z as
|
|
615
|
+
import { z as z25 } from "zod";
|
|
600
616
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
601
|
-
pcb_edit_event_type:
|
|
602
|
-
edit_event_type:
|
|
603
|
-
pcb_port_id:
|
|
604
|
-
pcb_trace_hint_id:
|
|
605
|
-
route:
|
|
606
|
-
|
|
617
|
+
pcb_edit_event_type: z25.literal("edit_trace_hint").describe("deprecated"),
|
|
618
|
+
edit_event_type: z25.literal("edit_pcb_trace_hint").optional(),
|
|
619
|
+
pcb_port_id: z25.string(),
|
|
620
|
+
pcb_trace_hint_id: z25.string().optional(),
|
|
621
|
+
route: z25.array(
|
|
622
|
+
z25.object({ x: z25.number(), y: z25.number(), via: z25.boolean().optional() })
|
|
607
623
|
)
|
|
608
624
|
});
|
|
609
625
|
expectTypesMatch(
|
|
@@ -611,38 +627,38 @@ expectTypesMatch(
|
|
|
611
627
|
);
|
|
612
628
|
|
|
613
629
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
614
|
-
import { z as
|
|
630
|
+
import { z as z26 } from "zod";
|
|
615
631
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
616
|
-
edit_event_type:
|
|
617
|
-
schematic_component_id:
|
|
618
|
-
original_center:
|
|
619
|
-
new_center:
|
|
632
|
+
edit_event_type: z26.literal("edit_schematic_component_location"),
|
|
633
|
+
schematic_component_id: z26.string(),
|
|
634
|
+
original_center: z26.object({ x: z26.number(), y: z26.number() }),
|
|
635
|
+
new_center: z26.object({ x: z26.number(), y: z26.number() })
|
|
620
636
|
});
|
|
621
637
|
expectTypesMatch(true);
|
|
622
638
|
|
|
623
639
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
624
|
-
import { z as
|
|
640
|
+
import { z as z27 } from "zod";
|
|
625
641
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
626
|
-
edit_event_type:
|
|
627
|
-
pcb_group_id:
|
|
628
|
-
original_center:
|
|
629
|
-
new_center:
|
|
642
|
+
edit_event_type: z27.literal("edit_pcb_group_location"),
|
|
643
|
+
pcb_group_id: z27.string(),
|
|
644
|
+
original_center: z27.object({ x: z27.number(), y: z27.number() }),
|
|
645
|
+
new_center: z27.object({ x: z27.number(), y: z27.number() })
|
|
630
646
|
});
|
|
631
647
|
expectTypesMatch(true);
|
|
632
648
|
|
|
633
649
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
634
|
-
import { z as
|
|
650
|
+
import { z as z28 } from "zod";
|
|
635
651
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
636
|
-
edit_event_type:
|
|
637
|
-
schematic_group_id:
|
|
638
|
-
original_center:
|
|
639
|
-
new_center:
|
|
652
|
+
edit_event_type: z28.literal("edit_schematic_group_location"),
|
|
653
|
+
schematic_group_id: z28.string(),
|
|
654
|
+
original_center: z28.object({ x: z28.number(), y: z28.number() }),
|
|
655
|
+
new_center: z28.object({ x: z28.number(), y: z28.number() })
|
|
640
656
|
});
|
|
641
657
|
expectTypesMatch(true);
|
|
642
658
|
|
|
643
659
|
// lib/manual-edits/manual_edit_event.ts
|
|
644
|
-
import { z as
|
|
645
|
-
var manual_edit_event =
|
|
660
|
+
import { z as z29 } from "zod";
|
|
661
|
+
var manual_edit_event = z29.union([
|
|
646
662
|
edit_pcb_component_location_event,
|
|
647
663
|
edit_trace_hint_event,
|
|
648
664
|
edit_schematic_component_location_event
|
|
@@ -650,33 +666,33 @@ var manual_edit_event = z28.union([
|
|
|
650
666
|
expectTypesMatch(true);
|
|
651
667
|
|
|
652
668
|
// lib/manual-edits/manual_edits_file.ts
|
|
653
|
-
import { z as
|
|
669
|
+
import { z as z33 } from "zod";
|
|
654
670
|
|
|
655
671
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
656
|
-
import { z as
|
|
672
|
+
import { z as z30 } from "zod";
|
|
657
673
|
import { point as point2 } from "circuit-json";
|
|
658
|
-
var manual_pcb_placement =
|
|
659
|
-
selector:
|
|
660
|
-
relative_to:
|
|
674
|
+
var manual_pcb_placement = z30.object({
|
|
675
|
+
selector: z30.string(),
|
|
676
|
+
relative_to: z30.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
661
677
|
center: point2
|
|
662
678
|
});
|
|
663
679
|
expectTypesMatch(true);
|
|
664
680
|
|
|
665
681
|
// lib/manual-edits/manual_trace_hint.ts
|
|
666
|
-
import { z as
|
|
682
|
+
import { z as z31 } from "zod";
|
|
667
683
|
import { route_hint_point } from "circuit-json";
|
|
668
|
-
var manual_trace_hint =
|
|
669
|
-
pcb_port_selector:
|
|
670
|
-
offsets:
|
|
684
|
+
var manual_trace_hint = z31.object({
|
|
685
|
+
pcb_port_selector: z31.string(),
|
|
686
|
+
offsets: z31.array(route_hint_point)
|
|
671
687
|
});
|
|
672
688
|
expectTypesMatch(true);
|
|
673
689
|
|
|
674
690
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
675
|
-
import { z as
|
|
691
|
+
import { z as z32 } from "zod";
|
|
676
692
|
import { point as point4 } from "circuit-json";
|
|
677
|
-
var manual_schematic_placement =
|
|
678
|
-
selector:
|
|
679
|
-
relative_to:
|
|
693
|
+
var manual_schematic_placement = z32.object({
|
|
694
|
+
selector: z32.string(),
|
|
695
|
+
relative_to: z32.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
680
696
|
center: point4
|
|
681
697
|
});
|
|
682
698
|
expectTypesMatch(
|
|
@@ -684,37 +700,37 @@ expectTypesMatch(
|
|
|
684
700
|
);
|
|
685
701
|
|
|
686
702
|
// lib/manual-edits/manual_edits_file.ts
|
|
687
|
-
var manual_edits_file =
|
|
688
|
-
pcb_placements:
|
|
689
|
-
manual_trace_hints:
|
|
690
|
-
schematic_placements:
|
|
703
|
+
var manual_edits_file = z33.object({
|
|
704
|
+
pcb_placements: z33.array(manual_pcb_placement).optional(),
|
|
705
|
+
manual_trace_hints: z33.array(manual_trace_hint).optional(),
|
|
706
|
+
schematic_placements: z33.array(manual_schematic_placement).optional()
|
|
691
707
|
});
|
|
692
708
|
expectTypesMatch(true);
|
|
693
709
|
|
|
694
710
|
// lib/common/connectionsProp.ts
|
|
695
|
-
import { z as
|
|
696
|
-
var connectionTarget =
|
|
711
|
+
import { z as z34 } from "zod";
|
|
712
|
+
var connectionTarget = z34.string().or(z34.array(z34.string()).readonly()).or(z34.array(z34.string()));
|
|
697
713
|
var createConnectionsProp = (labels) => {
|
|
698
|
-
return
|
|
714
|
+
return z34.record(z34.enum(labels), connectionTarget);
|
|
699
715
|
};
|
|
700
716
|
|
|
701
717
|
// lib/components/group.ts
|
|
702
|
-
var layoutConfig =
|
|
703
|
-
layoutMode:
|
|
704
|
-
position:
|
|
705
|
-
grid:
|
|
706
|
-
gridCols:
|
|
707
|
-
gridRows:
|
|
708
|
-
gridTemplateRows:
|
|
709
|
-
gridTemplateColumns:
|
|
710
|
-
gridTemplate:
|
|
711
|
-
gridGap:
|
|
712
|
-
gridRowGap:
|
|
713
|
-
gridColumnGap:
|
|
714
|
-
flex:
|
|
715
|
-
flexDirection:
|
|
716
|
-
alignItems:
|
|
717
|
-
justifyContent:
|
|
718
|
+
var layoutConfig = z35.object({
|
|
719
|
+
layoutMode: z35.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
720
|
+
position: z35.enum(["absolute", "relative"]).optional(),
|
|
721
|
+
grid: z35.boolean().optional(),
|
|
722
|
+
gridCols: z35.number().or(z35.string()).optional(),
|
|
723
|
+
gridRows: z35.number().or(z35.string()).optional(),
|
|
724
|
+
gridTemplateRows: z35.string().optional(),
|
|
725
|
+
gridTemplateColumns: z35.string().optional(),
|
|
726
|
+
gridTemplate: z35.string().optional(),
|
|
727
|
+
gridGap: z35.number().or(z35.string()).optional(),
|
|
728
|
+
gridRowGap: z35.number().or(z35.string()).optional(),
|
|
729
|
+
gridColumnGap: z35.number().or(z35.string()).optional(),
|
|
730
|
+
flex: z35.boolean().or(z35.string()).optional(),
|
|
731
|
+
flexDirection: z35.enum(["row", "column"]).optional(),
|
|
732
|
+
alignItems: z35.enum(["start", "center", "end", "stretch"]).optional(),
|
|
733
|
+
justifyContent: z35.enum([
|
|
718
734
|
"start",
|
|
719
735
|
"center",
|
|
720
736
|
"end",
|
|
@@ -723,48 +739,48 @@ var layoutConfig = z34.object({
|
|
|
723
739
|
"space-around",
|
|
724
740
|
"space-evenly"
|
|
725
741
|
]).optional(),
|
|
726
|
-
flexRow:
|
|
727
|
-
flexColumn:
|
|
728
|
-
gap:
|
|
729
|
-
pack:
|
|
730
|
-
packOrderStrategy:
|
|
742
|
+
flexRow: z35.boolean().optional(),
|
|
743
|
+
flexColumn: z35.boolean().optional(),
|
|
744
|
+
gap: z35.number().or(z35.string()).optional(),
|
|
745
|
+
pack: z35.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
746
|
+
packOrderStrategy: z35.enum([
|
|
731
747
|
"largest_to_smallest",
|
|
732
748
|
"first_to_last",
|
|
733
749
|
"highest_to_lowest_pin_count"
|
|
734
750
|
]).optional(),
|
|
735
|
-
packPlacementStrategy:
|
|
736
|
-
padding:
|
|
737
|
-
paddingLeft:
|
|
738
|
-
paddingRight:
|
|
739
|
-
paddingTop:
|
|
740
|
-
paddingBottom:
|
|
741
|
-
paddingX:
|
|
742
|
-
paddingY:
|
|
743
|
-
width:
|
|
744
|
-
height:
|
|
745
|
-
matchAdapt:
|
|
746
|
-
matchAdaptTemplate:
|
|
747
|
-
});
|
|
748
|
-
expectTypesMatch(true);
|
|
749
|
-
var border =
|
|
750
|
-
strokeWidth:
|
|
751
|
-
dashed:
|
|
752
|
-
solid:
|
|
753
|
-
});
|
|
754
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
755
|
-
var autorouterConfig =
|
|
751
|
+
packPlacementStrategy: z35.enum(["shortest_connection_along_outline"]).optional(),
|
|
752
|
+
padding: length3.optional(),
|
|
753
|
+
paddingLeft: length3.optional(),
|
|
754
|
+
paddingRight: length3.optional(),
|
|
755
|
+
paddingTop: length3.optional(),
|
|
756
|
+
paddingBottom: length3.optional(),
|
|
757
|
+
paddingX: length3.optional(),
|
|
758
|
+
paddingY: length3.optional(),
|
|
759
|
+
width: length3.optional(),
|
|
760
|
+
height: length3.optional(),
|
|
761
|
+
matchAdapt: z35.boolean().optional(),
|
|
762
|
+
matchAdaptTemplate: z35.any().optional()
|
|
763
|
+
});
|
|
764
|
+
expectTypesMatch(true);
|
|
765
|
+
var border = z35.object({
|
|
766
|
+
strokeWidth: length3.optional(),
|
|
767
|
+
dashed: z35.boolean().optional(),
|
|
768
|
+
solid: z35.boolean().optional()
|
|
769
|
+
});
|
|
770
|
+
var pcbAnchorAlignmentAutocomplete = z35.custom((value) => typeof value === "string");
|
|
771
|
+
var autorouterConfig = z35.object({
|
|
756
772
|
serverUrl: url.optional(),
|
|
757
|
-
inputFormat:
|
|
758
|
-
serverMode:
|
|
759
|
-
serverCacheEnabled:
|
|
760
|
-
cache:
|
|
761
|
-
traceClearance:
|
|
762
|
-
availableJumperTypes:
|
|
763
|
-
groupMode:
|
|
764
|
-
algorithmFn:
|
|
773
|
+
inputFormat: z35.enum(["simplified", "circuit-json"]).optional(),
|
|
774
|
+
serverMode: z35.enum(["job", "solve-endpoint"]).optional(),
|
|
775
|
+
serverCacheEnabled: z35.boolean().optional(),
|
|
776
|
+
cache: z35.custom((v) => true).optional(),
|
|
777
|
+
traceClearance: length3.optional(),
|
|
778
|
+
availableJumperTypes: z35.array(z35.enum(["1206x4", "0603"])).optional(),
|
|
779
|
+
groupMode: z35.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
780
|
+
algorithmFn: z35.custom(
|
|
765
781
|
(v) => typeof v === "function" || v === void 0
|
|
766
782
|
).optional(),
|
|
767
|
-
preset:
|
|
783
|
+
preset: z35.enum([
|
|
768
784
|
"sequential_trace",
|
|
769
785
|
"subcircuit",
|
|
770
786
|
"auto",
|
|
@@ -779,58 +795,58 @@ var autorouterConfig = z34.object({
|
|
|
779
795
|
"auto-local",
|
|
780
796
|
"auto-cloud"
|
|
781
797
|
]).optional(),
|
|
782
|
-
local:
|
|
783
|
-
});
|
|
784
|
-
var autorouterPreset =
|
|
785
|
-
|
|
786
|
-
|
|
787
|
-
|
|
788
|
-
|
|
789
|
-
|
|
790
|
-
|
|
791
|
-
|
|
792
|
-
|
|
793
|
-
|
|
798
|
+
local: z35.boolean().optional()
|
|
799
|
+
});
|
|
800
|
+
var autorouterPreset = z35.union([
|
|
801
|
+
z35.literal("sequential_trace"),
|
|
802
|
+
z35.literal("subcircuit"),
|
|
803
|
+
z35.literal("auto"),
|
|
804
|
+
z35.literal("auto_local"),
|
|
805
|
+
z35.literal("auto_cloud"),
|
|
806
|
+
z35.literal("auto_jumper"),
|
|
807
|
+
z35.literal("tscircuit_beta"),
|
|
808
|
+
z35.literal("freerouting"),
|
|
809
|
+
z35.literal("laser_prefab"),
|
|
794
810
|
// Prefabricated PCB with laser copper ablation
|
|
795
|
-
|
|
796
|
-
|
|
797
|
-
|
|
798
|
-
|
|
811
|
+
z35.literal("auto-jumper"),
|
|
812
|
+
z35.literal("sequential-trace"),
|
|
813
|
+
z35.literal("auto-local"),
|
|
814
|
+
z35.literal("auto-cloud")
|
|
799
815
|
]);
|
|
800
|
-
var autorouterString =
|
|
801
|
-
var autorouterProp =
|
|
816
|
+
var autorouterString = z35.string();
|
|
817
|
+
var autorouterProp = z35.union([
|
|
802
818
|
autorouterConfig,
|
|
803
819
|
autorouterPreset,
|
|
804
820
|
autorouterString
|
|
805
821
|
]);
|
|
806
|
-
var autorouterEffortLevel =
|
|
822
|
+
var autorouterEffortLevel = z35.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
807
823
|
var baseGroupProps = commonLayoutProps.extend({
|
|
808
|
-
name:
|
|
809
|
-
children:
|
|
810
|
-
schTitle:
|
|
811
|
-
key:
|
|
812
|
-
showAsSchematicBox:
|
|
813
|
-
connections:
|
|
824
|
+
name: z35.string().optional(),
|
|
825
|
+
children: z35.any().optional(),
|
|
826
|
+
schTitle: z35.string().optional(),
|
|
827
|
+
key: z35.any().optional(),
|
|
828
|
+
showAsSchematicBox: z35.boolean().optional(),
|
|
829
|
+
connections: z35.record(z35.string(), connectionTarget.optional()).optional(),
|
|
814
830
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
815
|
-
schPinSpacing:
|
|
831
|
+
schPinSpacing: length3.optional(),
|
|
816
832
|
schPinStyle: schematicPinStyle.optional(),
|
|
817
833
|
...layoutConfig.shape,
|
|
818
834
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
819
835
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
820
|
-
pcbGrid:
|
|
821
|
-
pcbGridCols:
|
|
822
|
-
pcbGridRows:
|
|
823
|
-
pcbGridTemplateRows:
|
|
824
|
-
pcbGridTemplateColumns:
|
|
825
|
-
pcbGridTemplate:
|
|
826
|
-
pcbGridGap:
|
|
827
|
-
pcbGridRowGap:
|
|
828
|
-
pcbGridColumnGap:
|
|
829
|
-
pcbFlex:
|
|
830
|
-
pcbFlexGap:
|
|
831
|
-
pcbFlexDirection:
|
|
832
|
-
pcbAlignItems:
|
|
833
|
-
pcbJustifyContent:
|
|
836
|
+
pcbGrid: z35.boolean().optional(),
|
|
837
|
+
pcbGridCols: z35.number().or(z35.string()).optional(),
|
|
838
|
+
pcbGridRows: z35.number().or(z35.string()).optional(),
|
|
839
|
+
pcbGridTemplateRows: z35.string().optional(),
|
|
840
|
+
pcbGridTemplateColumns: z35.string().optional(),
|
|
841
|
+
pcbGridTemplate: z35.string().optional(),
|
|
842
|
+
pcbGridGap: z35.number().or(z35.string()).optional(),
|
|
843
|
+
pcbGridRowGap: z35.number().or(z35.string()).optional(),
|
|
844
|
+
pcbGridColumnGap: z35.number().or(z35.string()).optional(),
|
|
845
|
+
pcbFlex: z35.boolean().or(z35.string()).optional(),
|
|
846
|
+
pcbFlexGap: z35.number().or(z35.string()).optional(),
|
|
847
|
+
pcbFlexDirection: z35.enum(["row", "column"]).optional(),
|
|
848
|
+
pcbAlignItems: z35.enum(["start", "center", "end", "stretch"]).optional(),
|
|
849
|
+
pcbJustifyContent: z35.enum([
|
|
834
850
|
"start",
|
|
835
851
|
"center",
|
|
836
852
|
"end",
|
|
@@ -839,25 +855,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
839
855
|
"space-around",
|
|
840
856
|
"space-evenly"
|
|
841
857
|
]).optional(),
|
|
842
|
-
pcbFlexRow:
|
|
843
|
-
pcbFlexColumn:
|
|
844
|
-
pcbGap:
|
|
845
|
-
pcbPack:
|
|
846
|
-
pcbPackGap:
|
|
847
|
-
schGrid:
|
|
848
|
-
schGridCols:
|
|
849
|
-
schGridRows:
|
|
850
|
-
schGridTemplateRows:
|
|
851
|
-
schGridTemplateColumns:
|
|
852
|
-
schGridTemplate:
|
|
853
|
-
schGridGap:
|
|
854
|
-
schGridRowGap:
|
|
855
|
-
schGridColumnGap:
|
|
856
|
-
schFlex:
|
|
857
|
-
schFlexGap:
|
|
858
|
-
schFlexDirection:
|
|
859
|
-
schAlignItems:
|
|
860
|
-
schJustifyContent:
|
|
858
|
+
pcbFlexRow: z35.boolean().optional(),
|
|
859
|
+
pcbFlexColumn: z35.boolean().optional(),
|
|
860
|
+
pcbGap: z35.number().or(z35.string()).optional(),
|
|
861
|
+
pcbPack: z35.boolean().optional(),
|
|
862
|
+
pcbPackGap: z35.number().or(z35.string()).optional(),
|
|
863
|
+
schGrid: z35.boolean().optional(),
|
|
864
|
+
schGridCols: z35.number().or(z35.string()).optional(),
|
|
865
|
+
schGridRows: z35.number().or(z35.string()).optional(),
|
|
866
|
+
schGridTemplateRows: z35.string().optional(),
|
|
867
|
+
schGridTemplateColumns: z35.string().optional(),
|
|
868
|
+
schGridTemplate: z35.string().optional(),
|
|
869
|
+
schGridGap: z35.number().or(z35.string()).optional(),
|
|
870
|
+
schGridRowGap: z35.number().or(z35.string()).optional(),
|
|
871
|
+
schGridColumnGap: z35.number().or(z35.string()).optional(),
|
|
872
|
+
schFlex: z35.boolean().or(z35.string()).optional(),
|
|
873
|
+
schFlexGap: z35.number().or(z35.string()).optional(),
|
|
874
|
+
schFlexDirection: z35.enum(["row", "column"]).optional(),
|
|
875
|
+
schAlignItems: z35.enum(["start", "center", "end", "stretch"]).optional(),
|
|
876
|
+
schJustifyContent: z35.enum([
|
|
861
877
|
"start",
|
|
862
878
|
"center",
|
|
863
879
|
"end",
|
|
@@ -866,65 +882,65 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
866
882
|
"space-around",
|
|
867
883
|
"space-evenly"
|
|
868
884
|
]).optional(),
|
|
869
|
-
schFlexRow:
|
|
870
|
-
schFlexColumn:
|
|
871
|
-
schGap:
|
|
872
|
-
schPack:
|
|
873
|
-
schMatchAdapt:
|
|
874
|
-
pcbWidth:
|
|
875
|
-
pcbHeight:
|
|
876
|
-
minTraceWidth:
|
|
877
|
-
nominalTraceWidth:
|
|
878
|
-
schWidth:
|
|
879
|
-
schHeight:
|
|
885
|
+
schFlexRow: z35.boolean().optional(),
|
|
886
|
+
schFlexColumn: z35.boolean().optional(),
|
|
887
|
+
schGap: z35.number().or(z35.string()).optional(),
|
|
888
|
+
schPack: z35.boolean().optional(),
|
|
889
|
+
schMatchAdapt: z35.boolean().optional(),
|
|
890
|
+
pcbWidth: length3.optional(),
|
|
891
|
+
pcbHeight: length3.optional(),
|
|
892
|
+
minTraceWidth: length3.optional(),
|
|
893
|
+
nominalTraceWidth: length3.optional(),
|
|
894
|
+
schWidth: length3.optional(),
|
|
895
|
+
schHeight: length3.optional(),
|
|
880
896
|
pcbLayout: layoutConfig.optional(),
|
|
881
897
|
schLayout: layoutConfig.optional(),
|
|
882
898
|
cellBorder: border.nullable().optional(),
|
|
883
899
|
border: border.nullable().optional(),
|
|
884
|
-
schPadding:
|
|
885
|
-
schPaddingLeft:
|
|
886
|
-
schPaddingRight:
|
|
887
|
-
schPaddingTop:
|
|
888
|
-
schPaddingBottom:
|
|
889
|
-
pcbPadding:
|
|
890
|
-
pcbPaddingLeft:
|
|
891
|
-
pcbPaddingRight:
|
|
892
|
-
pcbPaddingTop:
|
|
893
|
-
pcbPaddingBottom:
|
|
900
|
+
schPadding: length3.optional(),
|
|
901
|
+
schPaddingLeft: length3.optional(),
|
|
902
|
+
schPaddingRight: length3.optional(),
|
|
903
|
+
schPaddingTop: length3.optional(),
|
|
904
|
+
schPaddingBottom: length3.optional(),
|
|
905
|
+
pcbPadding: length3.optional(),
|
|
906
|
+
pcbPaddingLeft: length3.optional(),
|
|
907
|
+
pcbPaddingRight: length3.optional(),
|
|
908
|
+
pcbPaddingTop: length3.optional(),
|
|
909
|
+
pcbPaddingBottom: length3.optional(),
|
|
894
910
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
895
911
|
});
|
|
896
|
-
var partsEngine =
|
|
912
|
+
var partsEngine = z35.custom((v) => "findPart" in v);
|
|
897
913
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
898
914
|
manualEdits: manual_edits_file.optional(),
|
|
899
|
-
schAutoLayoutEnabled:
|
|
900
|
-
schTraceAutoLabelEnabled:
|
|
915
|
+
schAutoLayoutEnabled: z35.boolean().optional(),
|
|
916
|
+
schTraceAutoLabelEnabled: z35.boolean().optional(),
|
|
901
917
|
schMaxTraceDistance: distance11.optional(),
|
|
902
|
-
routingDisabled:
|
|
903
|
-
bomDisabled:
|
|
904
|
-
defaultTraceWidth:
|
|
905
|
-
minTraceWidth:
|
|
906
|
-
nominalTraceWidth:
|
|
918
|
+
routingDisabled: z35.boolean().optional(),
|
|
919
|
+
bomDisabled: z35.boolean().optional(),
|
|
920
|
+
defaultTraceWidth: length3.optional(),
|
|
921
|
+
minTraceWidth: length3.optional(),
|
|
922
|
+
nominalTraceWidth: length3.optional(),
|
|
907
923
|
partsEngine: partsEngine.optional(),
|
|
908
|
-
_subcircuitCachingEnabled:
|
|
909
|
-
pcbRouteCache:
|
|
924
|
+
_subcircuitCachingEnabled: z35.boolean().optional(),
|
|
925
|
+
pcbRouteCache: z35.custom((v) => true).optional(),
|
|
910
926
|
autorouter: autorouterProp.optional(),
|
|
911
927
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
912
|
-
autorouterVersion:
|
|
913
|
-
square:
|
|
914
|
-
emptyArea:
|
|
915
|
-
filledArea:
|
|
928
|
+
autorouterVersion: z35.enum(["v1", "v2", "latest"]).optional(),
|
|
929
|
+
square: z35.boolean().optional(),
|
|
930
|
+
emptyArea: z35.string().optional(),
|
|
931
|
+
filledArea: z35.string().optional(),
|
|
916
932
|
width: distance11.optional(),
|
|
917
933
|
height: distance11.optional(),
|
|
918
|
-
outline:
|
|
934
|
+
outline: z35.array(point).optional(),
|
|
919
935
|
outlineOffsetX: distance11.optional(),
|
|
920
936
|
outlineOffsetY: distance11.optional(),
|
|
921
|
-
circuitJson:
|
|
937
|
+
circuitJson: z35.array(z35.any()).optional()
|
|
922
938
|
});
|
|
923
939
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
924
|
-
subcircuit:
|
|
940
|
+
subcircuit: z35.literal(true)
|
|
925
941
|
});
|
|
926
|
-
var groupProps =
|
|
927
|
-
baseGroupProps.extend({ subcircuit:
|
|
942
|
+
var groupProps = z35.discriminatedUnion("subcircuit", [
|
|
943
|
+
baseGroupProps.extend({ subcircuit: z35.literal(false).optional() }),
|
|
928
944
|
subcircuitGroupPropsWithBool
|
|
929
945
|
]);
|
|
930
946
|
expectTypesMatch(true);
|
|
@@ -933,35 +949,35 @@ expectTypesMatch(true);
|
|
|
933
949
|
expectTypesMatch(true);
|
|
934
950
|
|
|
935
951
|
// lib/components/board.ts
|
|
936
|
-
var boardColor =
|
|
952
|
+
var boardColor = z36.custom((value) => typeof value === "string");
|
|
937
953
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
938
|
-
material:
|
|
939
|
-
layers:
|
|
940
|
-
|
|
941
|
-
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
|
|
954
|
+
material: z36.enum(["fr4", "fr1"]).default("fr4"),
|
|
955
|
+
layers: z36.union([
|
|
956
|
+
z36.literal(1),
|
|
957
|
+
z36.literal(2),
|
|
958
|
+
z36.literal(4),
|
|
959
|
+
z36.literal(6),
|
|
960
|
+
z36.literal(8)
|
|
945
961
|
]).default(2),
|
|
946
962
|
borderRadius: distance.optional(),
|
|
947
963
|
thickness: distance.optional(),
|
|
948
964
|
boardAnchorPosition: point.optional(),
|
|
949
965
|
anchorAlignment: ninePointAnchor.optional(),
|
|
950
966
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
951
|
-
title:
|
|
967
|
+
title: z36.string().optional(),
|
|
952
968
|
solderMaskColor: boardColor.optional(),
|
|
953
969
|
topSolderMaskColor: boardColor.optional(),
|
|
954
970
|
bottomSolderMaskColor: boardColor.optional(),
|
|
955
971
|
silkscreenColor: boardColor.optional(),
|
|
956
972
|
topSilkscreenColor: boardColor.optional(),
|
|
957
973
|
bottomSilkscreenColor: boardColor.optional(),
|
|
958
|
-
doubleSidedAssembly:
|
|
959
|
-
schematicDisabled:
|
|
974
|
+
doubleSidedAssembly: z36.boolean().optional().default(false),
|
|
975
|
+
schematicDisabled: z36.boolean().optional()
|
|
960
976
|
});
|
|
961
977
|
expectTypesMatch(true);
|
|
962
978
|
|
|
963
979
|
// lib/components/panel.ts
|
|
964
|
-
import { z as
|
|
980
|
+
import { z as z37 } from "zod";
|
|
965
981
|
var panelProps = baseGroupProps.omit({
|
|
966
982
|
width: true,
|
|
967
983
|
height: true,
|
|
@@ -970,19 +986,19 @@ var panelProps = baseGroupProps.omit({
|
|
|
970
986
|
}).extend({
|
|
971
987
|
width: distance.optional(),
|
|
972
988
|
height: distance.optional(),
|
|
973
|
-
children:
|
|
989
|
+
children: z37.any().optional(),
|
|
974
990
|
anchorAlignment: ninePointAnchor.optional(),
|
|
975
|
-
noSolderMask:
|
|
976
|
-
panelizationMethod:
|
|
991
|
+
noSolderMask: z37.boolean().optional(),
|
|
992
|
+
panelizationMethod: z37.enum(["tab-routing", "none"]).optional(),
|
|
977
993
|
boardGap: distance.optional(),
|
|
978
|
-
layoutMode:
|
|
979
|
-
row:
|
|
980
|
-
col:
|
|
994
|
+
layoutMode: z37.enum(["grid", "pack", "none"]).optional(),
|
|
995
|
+
row: z37.number().optional(),
|
|
996
|
+
col: z37.number().optional(),
|
|
981
997
|
cellWidth: distance.optional(),
|
|
982
998
|
cellHeight: distance.optional(),
|
|
983
999
|
tabWidth: distance.optional(),
|
|
984
1000
|
tabLength: distance.optional(),
|
|
985
|
-
mouseBites:
|
|
1001
|
+
mouseBites: z37.boolean().optional(),
|
|
986
1002
|
edgePadding: distance.optional(),
|
|
987
1003
|
edgePaddingLeft: distance.optional(),
|
|
988
1004
|
edgePaddingRight: distance.optional(),
|
|
@@ -1010,33 +1026,33 @@ expectTypesMatch(true);
|
|
|
1010
1026
|
|
|
1011
1027
|
// lib/components/chip.ts
|
|
1012
1028
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
1013
|
-
import { z as
|
|
1014
|
-
var connectionTarget2 =
|
|
1015
|
-
var connectionsProp =
|
|
1016
|
-
var pinLabelsProp =
|
|
1029
|
+
import { z as z40 } from "zod";
|
|
1030
|
+
var connectionTarget2 = z40.string().or(z40.array(z40.string()).readonly()).or(z40.array(z40.string()));
|
|
1031
|
+
var connectionsProp = z40.custom().pipe(z40.record(z40.string(), connectionTarget2));
|
|
1032
|
+
var pinLabelsProp = z40.record(
|
|
1017
1033
|
schematicPinLabel,
|
|
1018
|
-
schematicPinLabel.or(
|
|
1034
|
+
schematicPinLabel.or(z40.array(schematicPinLabel).readonly()).or(z40.array(schematicPinLabel))
|
|
1019
1035
|
);
|
|
1020
1036
|
expectTypesMatch(true);
|
|
1021
|
-
var pinCompatibleVariant =
|
|
1022
|
-
manufacturerPartNumber:
|
|
1023
|
-
supplierPartNumber:
|
|
1037
|
+
var pinCompatibleVariant = z40.object({
|
|
1038
|
+
manufacturerPartNumber: z40.string().optional(),
|
|
1039
|
+
supplierPartNumber: z40.record(supplier_name2, z40.array(z40.string())).optional()
|
|
1024
1040
|
});
|
|
1025
1041
|
var chipProps = commonComponentProps.extend({
|
|
1026
|
-
manufacturerPartNumber:
|
|
1042
|
+
manufacturerPartNumber: z40.string().optional(),
|
|
1027
1043
|
pinLabels: pinLabelsProp.optional(),
|
|
1028
|
-
showPinAliases:
|
|
1029
|
-
pcbPinLabels:
|
|
1030
|
-
internallyConnectedPins:
|
|
1031
|
-
externallyConnectedPins:
|
|
1044
|
+
showPinAliases: z40.boolean().optional(),
|
|
1045
|
+
pcbPinLabels: z40.record(z40.string(), z40.string()).optional(),
|
|
1046
|
+
internallyConnectedPins: z40.array(z40.array(z40.union([z40.string(), z40.number()]))).optional(),
|
|
1047
|
+
externallyConnectedPins: z40.array(z40.array(z40.string())).optional(),
|
|
1032
1048
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
1033
1049
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1034
|
-
pinCompatibleVariants:
|
|
1050
|
+
pinCompatibleVariants: z40.array(pinCompatibleVariant).optional(),
|
|
1035
1051
|
schPinStyle: schematicPinStyle.optional(),
|
|
1036
1052
|
schPinSpacing: distance13.optional(),
|
|
1037
1053
|
schWidth: distance13.optional(),
|
|
1038
1054
|
schHeight: distance13.optional(),
|
|
1039
|
-
noSchematicRepresentation:
|
|
1055
|
+
noSchematicRepresentation: z40.boolean().optional(),
|
|
1040
1056
|
connections: connectionsProp.optional()
|
|
1041
1057
|
});
|
|
1042
1058
|
var bugProps = chipProps;
|
|
@@ -1048,108 +1064,108 @@ expectTypesMatch(true);
|
|
|
1048
1064
|
|
|
1049
1065
|
// lib/components/jumper.ts
|
|
1050
1066
|
import { distance as distance14 } from "circuit-json";
|
|
1051
|
-
import { z as
|
|
1067
|
+
import { z as z41 } from "zod";
|
|
1052
1068
|
var jumperProps = commonComponentProps.extend({
|
|
1053
|
-
manufacturerPartNumber:
|
|
1054
|
-
pinLabels:
|
|
1055
|
-
|
|
1056
|
-
schematicPinLabel.or(
|
|
1069
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1070
|
+
pinLabels: z41.record(
|
|
1071
|
+
z41.number().or(schematicPinLabel),
|
|
1072
|
+
schematicPinLabel.or(z41.array(schematicPinLabel))
|
|
1057
1073
|
).optional(),
|
|
1058
1074
|
schPinStyle: schematicPinStyle.optional(),
|
|
1059
1075
|
schPinSpacing: distance14.optional(),
|
|
1060
1076
|
schWidth: distance14.optional(),
|
|
1061
1077
|
schHeight: distance14.optional(),
|
|
1062
|
-
schDirection:
|
|
1078
|
+
schDirection: z41.enum(["left", "right"]).optional(),
|
|
1063
1079
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1064
1080
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1065
|
-
pcbPinLabels:
|
|
1066
|
-
pinCount:
|
|
1067
|
-
internallyConnectedPins:
|
|
1068
|
-
connections:
|
|
1081
|
+
pcbPinLabels: z41.record(z41.string(), z41.string()).optional(),
|
|
1082
|
+
pinCount: z41.union([z41.literal(2), z41.literal(3)]).optional(),
|
|
1083
|
+
internallyConnectedPins: z41.array(z41.array(z41.union([z41.string(), z41.number()]))).optional(),
|
|
1084
|
+
connections: z41.custom().pipe(z41.record(z41.string(), connectionTarget)).optional()
|
|
1069
1085
|
});
|
|
1070
1086
|
expectTypesMatch(true);
|
|
1071
1087
|
|
|
1072
1088
|
// lib/components/solderjumper.ts
|
|
1073
|
-
import { z as
|
|
1089
|
+
import { z as z42 } from "zod";
|
|
1074
1090
|
var solderjumperProps = jumperProps.extend({
|
|
1075
|
-
bridgedPins:
|
|
1076
|
-
bridged:
|
|
1091
|
+
bridgedPins: z42.array(z42.array(z42.string())).optional(),
|
|
1092
|
+
bridged: z42.boolean().optional()
|
|
1077
1093
|
});
|
|
1078
1094
|
expectTypesMatch(true);
|
|
1079
1095
|
|
|
1080
1096
|
// lib/components/connector.ts
|
|
1081
1097
|
import { distance as distance15 } from "circuit-json";
|
|
1082
|
-
import { z as
|
|
1098
|
+
import { z as z43 } from "zod";
|
|
1083
1099
|
var connectorProps = commonComponentProps.extend({
|
|
1084
|
-
manufacturerPartNumber:
|
|
1085
|
-
pinLabels:
|
|
1086
|
-
|
|
1087
|
-
schematicPinLabel.or(
|
|
1100
|
+
manufacturerPartNumber: z43.string().optional(),
|
|
1101
|
+
pinLabels: z43.record(
|
|
1102
|
+
z43.number().or(schematicPinLabel),
|
|
1103
|
+
schematicPinLabel.or(z43.array(schematicPinLabel))
|
|
1088
1104
|
).optional(),
|
|
1089
1105
|
schPinStyle: schematicPinStyle.optional(),
|
|
1090
1106
|
schPinSpacing: distance15.optional(),
|
|
1091
1107
|
schWidth: distance15.optional(),
|
|
1092
1108
|
schHeight: distance15.optional(),
|
|
1093
|
-
schDirection:
|
|
1109
|
+
schDirection: z43.enum(["left", "right"]).optional(),
|
|
1094
1110
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1095
|
-
internallyConnectedPins:
|
|
1096
|
-
standard:
|
|
1111
|
+
internallyConnectedPins: z43.array(z43.array(z43.union([z43.string(), z43.number()]))).optional(),
|
|
1112
|
+
standard: z43.enum(["usb_c", "m2"]).optional()
|
|
1097
1113
|
});
|
|
1098
1114
|
expectTypesMatch(true);
|
|
1099
1115
|
|
|
1100
1116
|
// lib/components/interconnect.ts
|
|
1101
|
-
import { z as
|
|
1117
|
+
import { z as z44 } from "zod";
|
|
1102
1118
|
var interconnectProps = commonComponentProps.extend({
|
|
1103
|
-
standard:
|
|
1104
|
-
pinLabels:
|
|
1105
|
-
|
|
1106
|
-
schematicPinLabel.or(
|
|
1119
|
+
standard: z44.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
1120
|
+
pinLabels: z44.record(
|
|
1121
|
+
z44.number().or(schematicPinLabel),
|
|
1122
|
+
schematicPinLabel.or(z44.array(schematicPinLabel))
|
|
1107
1123
|
).optional(),
|
|
1108
|
-
internallyConnectedPins:
|
|
1124
|
+
internallyConnectedPins: z44.array(z44.array(z44.union([z44.string(), z44.number()]))).optional()
|
|
1109
1125
|
});
|
|
1110
1126
|
expectTypesMatch(true);
|
|
1111
1127
|
|
|
1112
1128
|
// lib/components/fuse.ts
|
|
1113
|
-
import { z as
|
|
1129
|
+
import { z as z45 } from "zod";
|
|
1114
1130
|
var fusePinLabels = ["pin1", "pin2"];
|
|
1115
1131
|
var fuseProps = commonComponentProps.extend({
|
|
1116
|
-
currentRating:
|
|
1117
|
-
voltageRating:
|
|
1118
|
-
schShowRatings:
|
|
1132
|
+
currentRating: z45.union([z45.number(), z45.string()]),
|
|
1133
|
+
voltageRating: z45.union([z45.number(), z45.string()]).optional(),
|
|
1134
|
+
schShowRatings: z45.boolean().optional(),
|
|
1119
1135
|
schOrientation: schematicOrientation.optional(),
|
|
1120
|
-
connections:
|
|
1121
|
-
|
|
1122
|
-
|
|
1123
|
-
|
|
1124
|
-
|
|
1125
|
-
|
|
1136
|
+
connections: z45.record(
|
|
1137
|
+
z45.string(),
|
|
1138
|
+
z45.union([
|
|
1139
|
+
z45.string(),
|
|
1140
|
+
z45.array(z45.string()).readonly(),
|
|
1141
|
+
z45.array(z45.string())
|
|
1126
1142
|
])
|
|
1127
1143
|
).optional()
|
|
1128
1144
|
});
|
|
1129
1145
|
|
|
1130
1146
|
// lib/components/platedhole.ts
|
|
1131
1147
|
import { distance as distance16 } from "circuit-json";
|
|
1132
|
-
import { z as
|
|
1133
|
-
var distanceHiddenUndefined =
|
|
1148
|
+
import { z as z46 } from "zod";
|
|
1149
|
+
var distanceHiddenUndefined = z46.custom().transform((a) => {
|
|
1134
1150
|
if (a === void 0) return void 0;
|
|
1135
1151
|
return distance16.parse(a);
|
|
1136
1152
|
});
|
|
1137
|
-
var platedHoleProps =
|
|
1153
|
+
var platedHoleProps = z46.discriminatedUnion("shape", [
|
|
1138
1154
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1139
|
-
name:
|
|
1140
|
-
connectsTo:
|
|
1141
|
-
shape:
|
|
1155
|
+
name: z46.string().optional(),
|
|
1156
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1157
|
+
shape: z46.literal("circle"),
|
|
1142
1158
|
holeDiameter: distance16,
|
|
1143
1159
|
outerDiameter: distance16,
|
|
1144
1160
|
padDiameter: distance16.optional().describe("Diameter of the copper pad"),
|
|
1145
1161
|
portHints: portHints.optional(),
|
|
1146
1162
|
solderMaskMargin: distance16.optional(),
|
|
1147
|
-
coveredWithSolderMask:
|
|
1163
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1148
1164
|
}),
|
|
1149
1165
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1150
|
-
name:
|
|
1151
|
-
connectsTo:
|
|
1152
|
-
shape:
|
|
1166
|
+
name: z46.string().optional(),
|
|
1167
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1168
|
+
shape: z46.literal("oval"),
|
|
1153
1169
|
outerWidth: distance16,
|
|
1154
1170
|
outerHeight: distance16,
|
|
1155
1171
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1158,13 +1174,13 @@ var platedHoleProps = z45.discriminatedUnion("shape", [
|
|
|
1158
1174
|
innerHeight: distance16.optional().describe("DEPRECATED use holeHeight"),
|
|
1159
1175
|
portHints: portHints.optional(),
|
|
1160
1176
|
solderMaskMargin: distance16.optional(),
|
|
1161
|
-
coveredWithSolderMask:
|
|
1177
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1162
1178
|
}),
|
|
1163
1179
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1164
|
-
name:
|
|
1165
|
-
connectsTo:
|
|
1166
|
-
shape:
|
|
1167
|
-
rectPad:
|
|
1180
|
+
name: z46.string().optional(),
|
|
1181
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1182
|
+
shape: z46.literal("pill"),
|
|
1183
|
+
rectPad: z46.boolean().optional(),
|
|
1168
1184
|
outerWidth: distance16,
|
|
1169
1185
|
outerHeight: distance16,
|
|
1170
1186
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1175,30 +1191,30 @@ var platedHoleProps = z45.discriminatedUnion("shape", [
|
|
|
1175
1191
|
holeOffsetX: distance16.optional(),
|
|
1176
1192
|
holeOffsetY: distance16.optional(),
|
|
1177
1193
|
solderMaskMargin: distance16.optional(),
|
|
1178
|
-
coveredWithSolderMask:
|
|
1194
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1179
1195
|
}),
|
|
1180
1196
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1181
|
-
name:
|
|
1182
|
-
connectsTo:
|
|
1183
|
-
shape:
|
|
1197
|
+
name: z46.string().optional(),
|
|
1198
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1199
|
+
shape: z46.literal("circular_hole_with_rect_pad"),
|
|
1184
1200
|
holeDiameter: distance16,
|
|
1185
1201
|
rectPadWidth: distance16,
|
|
1186
1202
|
rectPadHeight: distance16,
|
|
1187
1203
|
rectBorderRadius: distance16.optional(),
|
|
1188
|
-
holeShape:
|
|
1189
|
-
padShape:
|
|
1204
|
+
holeShape: z46.literal("circle").optional(),
|
|
1205
|
+
padShape: z46.literal("rect").optional(),
|
|
1190
1206
|
portHints: portHints.optional(),
|
|
1191
1207
|
holeOffsetX: distance16.optional(),
|
|
1192
1208
|
holeOffsetY: distance16.optional(),
|
|
1193
1209
|
solderMaskMargin: distance16.optional(),
|
|
1194
|
-
coveredWithSolderMask:
|
|
1210
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1195
1211
|
}),
|
|
1196
1212
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1197
|
-
name:
|
|
1198
|
-
connectsTo:
|
|
1199
|
-
shape:
|
|
1200
|
-
holeShape:
|
|
1201
|
-
padShape:
|
|
1213
|
+
name: z46.string().optional(),
|
|
1214
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1215
|
+
shape: z46.literal("pill_hole_with_rect_pad"),
|
|
1216
|
+
holeShape: z46.literal("pill").optional(),
|
|
1217
|
+
padShape: z46.literal("rect").optional(),
|
|
1202
1218
|
holeWidth: distance16,
|
|
1203
1219
|
holeHeight: distance16,
|
|
1204
1220
|
rectPadWidth: distance16,
|
|
@@ -1207,22 +1223,22 @@ var platedHoleProps = z45.discriminatedUnion("shape", [
|
|
|
1207
1223
|
holeOffsetX: distance16.optional(),
|
|
1208
1224
|
holeOffsetY: distance16.optional(),
|
|
1209
1225
|
solderMaskMargin: distance16.optional(),
|
|
1210
|
-
coveredWithSolderMask:
|
|
1226
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1211
1227
|
}),
|
|
1212
1228
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1213
|
-
name:
|
|
1214
|
-
connectsTo:
|
|
1215
|
-
shape:
|
|
1216
|
-
holeShape:
|
|
1229
|
+
name: z46.string().optional(),
|
|
1230
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1231
|
+
shape: z46.literal("hole_with_polygon_pad"),
|
|
1232
|
+
holeShape: z46.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
1217
1233
|
holeDiameter: distance16.optional(),
|
|
1218
1234
|
holeWidth: distance16.optional(),
|
|
1219
1235
|
holeHeight: distance16.optional(),
|
|
1220
|
-
padOutline:
|
|
1236
|
+
padOutline: z46.array(point),
|
|
1221
1237
|
holeOffsetX: distance16,
|
|
1222
1238
|
holeOffsetY: distance16,
|
|
1223
1239
|
portHints: portHints.optional(),
|
|
1224
1240
|
solderMaskMargin: distance16.optional(),
|
|
1225
|
-
coveredWithSolderMask:
|
|
1241
|
+
coveredWithSolderMask: z46.boolean().optional()
|
|
1226
1242
|
})
|
|
1227
1243
|
]).refine((a) => {
|
|
1228
1244
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -1237,11 +1253,11 @@ expectTypesMatch(true);
|
|
|
1237
1253
|
|
|
1238
1254
|
// lib/components/resistor.ts
|
|
1239
1255
|
import { resistance } from "circuit-json";
|
|
1240
|
-
import { z as
|
|
1256
|
+
import { z as z47 } from "zod";
|
|
1241
1257
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1242
1258
|
var resistorProps = commonComponentProps.extend({
|
|
1243
1259
|
resistance,
|
|
1244
|
-
tolerance:
|
|
1260
|
+
tolerance: z47.union([z47.string(), z47.number()]).transform((val) => {
|
|
1245
1261
|
if (typeof val === "string") {
|
|
1246
1262
|
if (val.endsWith("%")) {
|
|
1247
1263
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1250,12 +1266,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
1250
1266
|
}
|
|
1251
1267
|
return val;
|
|
1252
1268
|
}).pipe(
|
|
1253
|
-
|
|
1269
|
+
z47.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
1254
1270
|
).optional(),
|
|
1255
|
-
pullupFor:
|
|
1256
|
-
pullupTo:
|
|
1257
|
-
pulldownFor:
|
|
1258
|
-
pulldownTo:
|
|
1271
|
+
pullupFor: z47.string().optional(),
|
|
1272
|
+
pullupTo: z47.string().optional(),
|
|
1273
|
+
pulldownFor: z47.string().optional(),
|
|
1274
|
+
pulldownTo: z47.string().optional(),
|
|
1259
1275
|
schOrientation: schematicOrientation.optional(),
|
|
1260
1276
|
schSize: schematicSymbolSize.optional(),
|
|
1261
1277
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -1265,23 +1281,23 @@ expectTypesMatch(true);
|
|
|
1265
1281
|
|
|
1266
1282
|
// lib/components/potentiometer.ts
|
|
1267
1283
|
import { resistance as resistance2 } from "circuit-json";
|
|
1268
|
-
import { z as
|
|
1284
|
+
import { z as z48 } from "zod";
|
|
1269
1285
|
var potentiometerProps = commonComponentProps.extend({
|
|
1270
1286
|
maxResistance: resistance2,
|
|
1271
|
-
pinVariant:
|
|
1287
|
+
pinVariant: z48.enum(["two_pin", "three_pin"]).optional()
|
|
1272
1288
|
});
|
|
1273
1289
|
expectTypesMatch(true);
|
|
1274
1290
|
|
|
1275
1291
|
// lib/components/crystal.ts
|
|
1276
1292
|
import { frequency, capacitance } from "circuit-json";
|
|
1277
|
-
import { z as
|
|
1293
|
+
import { z as z49 } from "zod";
|
|
1278
1294
|
var crystalPins = lrPins;
|
|
1279
1295
|
var crystalProps = commonComponentProps.extend({
|
|
1280
1296
|
frequency,
|
|
1281
1297
|
loadCapacitance: capacitance,
|
|
1282
|
-
manufacturerPartNumber:
|
|
1283
|
-
mpn:
|
|
1284
|
-
pinVariant:
|
|
1298
|
+
manufacturerPartNumber: z49.string().optional(),
|
|
1299
|
+
mpn: z49.string().optional(),
|
|
1300
|
+
pinVariant: z49.enum(["two_pin", "four_pin"]).optional(),
|
|
1285
1301
|
schOrientation: schematicOrientation.optional(),
|
|
1286
1302
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1287
1303
|
});
|
|
@@ -1289,34 +1305,34 @@ expectTypesMatch(true);
|
|
|
1289
1305
|
|
|
1290
1306
|
// lib/components/resonator.ts
|
|
1291
1307
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1292
|
-
import { z as
|
|
1308
|
+
import { z as z50 } from "zod";
|
|
1293
1309
|
var resonatorProps = commonComponentProps.extend({
|
|
1294
1310
|
frequency: frequency2,
|
|
1295
1311
|
loadCapacitance: capacitance2,
|
|
1296
|
-
pinVariant:
|
|
1312
|
+
pinVariant: z50.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1297
1313
|
});
|
|
1298
1314
|
expectTypesMatch(true);
|
|
1299
1315
|
|
|
1300
1316
|
// lib/components/stampboard.ts
|
|
1301
1317
|
import { distance as distance17 } from "circuit-json";
|
|
1302
|
-
import { z as
|
|
1318
|
+
import { z as z51 } from "zod";
|
|
1303
1319
|
var stampboardProps = boardProps.extend({
|
|
1304
|
-
leftPinCount:
|
|
1305
|
-
rightPinCount:
|
|
1306
|
-
topPinCount:
|
|
1307
|
-
bottomPinCount:
|
|
1308
|
-
leftPins:
|
|
1309
|
-
rightPins:
|
|
1310
|
-
topPins:
|
|
1311
|
-
bottomPins:
|
|
1320
|
+
leftPinCount: z51.number().optional(),
|
|
1321
|
+
rightPinCount: z51.number().optional(),
|
|
1322
|
+
topPinCount: z51.number().optional(),
|
|
1323
|
+
bottomPinCount: z51.number().optional(),
|
|
1324
|
+
leftPins: z51.array(z51.string()).optional(),
|
|
1325
|
+
rightPins: z51.array(z51.string()).optional(),
|
|
1326
|
+
topPins: z51.array(z51.string()).optional(),
|
|
1327
|
+
bottomPins: z51.array(z51.string()).optional(),
|
|
1312
1328
|
pinPitch: distance17.optional(),
|
|
1313
|
-
innerHoles:
|
|
1329
|
+
innerHoles: z51.boolean().optional()
|
|
1314
1330
|
});
|
|
1315
1331
|
expectTypesMatch(true);
|
|
1316
1332
|
|
|
1317
1333
|
// lib/components/capacitor.ts
|
|
1318
1334
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1319
|
-
import { z as
|
|
1335
|
+
import { z as z52 } from "zod";
|
|
1320
1336
|
var capacitorPinLabels = [
|
|
1321
1337
|
"pin1",
|
|
1322
1338
|
"pin2",
|
|
@@ -1328,13 +1344,13 @@ var capacitorPinLabels = [
|
|
|
1328
1344
|
var capacitorProps = commonComponentProps.extend({
|
|
1329
1345
|
capacitance: capacitance3,
|
|
1330
1346
|
maxVoltageRating: voltage.optional(),
|
|
1331
|
-
schShowRatings:
|
|
1332
|
-
polarized:
|
|
1333
|
-
decouplingFor:
|
|
1334
|
-
decouplingTo:
|
|
1335
|
-
bypassFor:
|
|
1336
|
-
bypassTo:
|
|
1337
|
-
maxDecouplingTraceLength:
|
|
1347
|
+
schShowRatings: z52.boolean().optional().default(false),
|
|
1348
|
+
polarized: z52.boolean().optional().default(false),
|
|
1349
|
+
decouplingFor: z52.string().optional(),
|
|
1350
|
+
decouplingTo: z52.string().optional(),
|
|
1351
|
+
bypassFor: z52.string().optional(),
|
|
1352
|
+
bypassTo: z52.string().optional(),
|
|
1353
|
+
maxDecouplingTraceLength: z52.number().optional(),
|
|
1338
1354
|
schOrientation: schematicOrientation.optional(),
|
|
1339
1355
|
schSize: schematicSymbolSize.optional(),
|
|
1340
1356
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -1343,13 +1359,13 @@ var capacitorPins = lrPolarPins;
|
|
|
1343
1359
|
expectTypesMatch(true);
|
|
1344
1360
|
|
|
1345
1361
|
// lib/components/net.ts
|
|
1346
|
-
import { z as
|
|
1347
|
-
var netProps =
|
|
1348
|
-
name:
|
|
1349
|
-
connectsTo:
|
|
1350
|
-
highlightColor:
|
|
1351
|
-
isPowerNet:
|
|
1352
|
-
isGroundNet:
|
|
1362
|
+
import { z as z53 } from "zod";
|
|
1363
|
+
var netProps = z53.object({
|
|
1364
|
+
name: z53.string(),
|
|
1365
|
+
connectsTo: z53.string().or(z53.array(z53.string())).optional(),
|
|
1366
|
+
highlightColor: z53.string().optional(),
|
|
1367
|
+
isPowerNet: z53.boolean().optional(),
|
|
1368
|
+
isGroundNet: z53.boolean().optional()
|
|
1353
1369
|
});
|
|
1354
1370
|
expectTypesMatch(true);
|
|
1355
1371
|
|
|
@@ -1362,55 +1378,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
1362
1378
|
expectTypesMatch(true);
|
|
1363
1379
|
|
|
1364
1380
|
// lib/components/constrainedlayout.ts
|
|
1365
|
-
import { z as
|
|
1366
|
-
var constrainedLayoutProps =
|
|
1367
|
-
name:
|
|
1368
|
-
pcbOnly:
|
|
1369
|
-
schOnly:
|
|
1381
|
+
import { z as z55 } from "zod";
|
|
1382
|
+
var constrainedLayoutProps = z55.object({
|
|
1383
|
+
name: z55.string().optional(),
|
|
1384
|
+
pcbOnly: z55.boolean().optional(),
|
|
1385
|
+
schOnly: z55.boolean().optional()
|
|
1370
1386
|
});
|
|
1371
1387
|
expectTypesMatch(true);
|
|
1372
1388
|
|
|
1373
1389
|
// lib/components/constraint.ts
|
|
1374
|
-
import { z as
|
|
1375
|
-
var pcbXDistConstraintProps =
|
|
1376
|
-
pcb:
|
|
1390
|
+
import { z as z56 } from "zod";
|
|
1391
|
+
var pcbXDistConstraintProps = z56.object({
|
|
1392
|
+
pcb: z56.literal(true).optional(),
|
|
1377
1393
|
xDist: distance,
|
|
1378
|
-
left:
|
|
1379
|
-
right:
|
|
1380
|
-
edgeToEdge:
|
|
1381
|
-
centerToCenter:
|
|
1394
|
+
left: z56.string(),
|
|
1395
|
+
right: z56.string(),
|
|
1396
|
+
edgeToEdge: z56.literal(true).optional(),
|
|
1397
|
+
centerToCenter: z56.literal(true).optional()
|
|
1382
1398
|
});
|
|
1383
1399
|
expectTypesMatch(
|
|
1384
1400
|
true
|
|
1385
1401
|
);
|
|
1386
|
-
var pcbYDistConstraintProps =
|
|
1387
|
-
pcb:
|
|
1402
|
+
var pcbYDistConstraintProps = z56.object({
|
|
1403
|
+
pcb: z56.literal(true).optional(),
|
|
1388
1404
|
yDist: distance,
|
|
1389
|
-
top:
|
|
1390
|
-
bottom:
|
|
1391
|
-
edgeToEdge:
|
|
1392
|
-
centerToCenter:
|
|
1405
|
+
top: z56.string(),
|
|
1406
|
+
bottom: z56.string(),
|
|
1407
|
+
edgeToEdge: z56.literal(true).optional(),
|
|
1408
|
+
centerToCenter: z56.literal(true).optional()
|
|
1393
1409
|
});
|
|
1394
1410
|
expectTypesMatch(
|
|
1395
1411
|
true
|
|
1396
1412
|
);
|
|
1397
|
-
var pcbSameYConstraintProps =
|
|
1398
|
-
pcb:
|
|
1399
|
-
sameY:
|
|
1400
|
-
for:
|
|
1413
|
+
var pcbSameYConstraintProps = z56.object({
|
|
1414
|
+
pcb: z56.literal(true).optional(),
|
|
1415
|
+
sameY: z56.literal(true).optional(),
|
|
1416
|
+
for: z56.array(z56.string())
|
|
1401
1417
|
});
|
|
1402
1418
|
expectTypesMatch(
|
|
1403
1419
|
true
|
|
1404
1420
|
);
|
|
1405
|
-
var pcbSameXConstraintProps =
|
|
1406
|
-
pcb:
|
|
1407
|
-
sameX:
|
|
1408
|
-
for:
|
|
1421
|
+
var pcbSameXConstraintProps = z56.object({
|
|
1422
|
+
pcb: z56.literal(true).optional(),
|
|
1423
|
+
sameX: z56.literal(true).optional(),
|
|
1424
|
+
for: z56.array(z56.string())
|
|
1409
1425
|
});
|
|
1410
1426
|
expectTypesMatch(
|
|
1411
1427
|
true
|
|
1412
1428
|
);
|
|
1413
|
-
var constraintProps =
|
|
1429
|
+
var constraintProps = z56.union([
|
|
1414
1430
|
pcbXDistConstraintProps,
|
|
1415
1431
|
pcbYDistConstraintProps,
|
|
1416
1432
|
pcbSameYConstraintProps,
|
|
@@ -1419,13 +1435,13 @@ var constraintProps = z55.union([
|
|
|
1419
1435
|
expectTypesMatch(true);
|
|
1420
1436
|
|
|
1421
1437
|
// lib/components/cutout.ts
|
|
1422
|
-
import { z as
|
|
1438
|
+
import { z as z57 } from "zod";
|
|
1423
1439
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1424
1440
|
layer: true,
|
|
1425
1441
|
pcbRotation: true
|
|
1426
1442
|
}).extend({
|
|
1427
|
-
name:
|
|
1428
|
-
shape:
|
|
1443
|
+
name: z57.string().optional(),
|
|
1444
|
+
shape: z57.literal("rect"),
|
|
1429
1445
|
width: distance,
|
|
1430
1446
|
height: distance
|
|
1431
1447
|
});
|
|
@@ -1434,8 +1450,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1434
1450
|
layer: true,
|
|
1435
1451
|
pcbRotation: true
|
|
1436
1452
|
}).extend({
|
|
1437
|
-
name:
|
|
1438
|
-
shape:
|
|
1453
|
+
name: z57.string().optional(),
|
|
1454
|
+
shape: z57.literal("circle"),
|
|
1439
1455
|
radius: distance
|
|
1440
1456
|
});
|
|
1441
1457
|
expectTypesMatch(true);
|
|
@@ -1443,28 +1459,28 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1443
1459
|
layer: true,
|
|
1444
1460
|
pcbRotation: true
|
|
1445
1461
|
}).extend({
|
|
1446
|
-
name:
|
|
1447
|
-
shape:
|
|
1448
|
-
points:
|
|
1462
|
+
name: z57.string().optional(),
|
|
1463
|
+
shape: z57.literal("polygon"),
|
|
1464
|
+
points: z57.array(point)
|
|
1449
1465
|
});
|
|
1450
1466
|
expectTypesMatch(true);
|
|
1451
|
-
var cutoutProps =
|
|
1467
|
+
var cutoutProps = z57.discriminatedUnion("shape", [
|
|
1452
1468
|
rectCutoutProps,
|
|
1453
1469
|
circleCutoutProps,
|
|
1454
1470
|
polygonCutoutProps
|
|
1455
1471
|
]);
|
|
1456
1472
|
|
|
1457
1473
|
// lib/components/smtpad.ts
|
|
1458
|
-
import { z as
|
|
1474
|
+
import { z as z58 } from "zod";
|
|
1459
1475
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1460
|
-
name:
|
|
1461
|
-
shape:
|
|
1476
|
+
name: z58.string().optional(),
|
|
1477
|
+
shape: z58.literal("rect"),
|
|
1462
1478
|
width: distance,
|
|
1463
1479
|
height: distance,
|
|
1464
1480
|
rectBorderRadius: distance.optional(),
|
|
1465
1481
|
cornerRadius: distance.optional(),
|
|
1466
1482
|
portHints: portHints.optional(),
|
|
1467
|
-
coveredWithSolderMask:
|
|
1483
|
+
coveredWithSolderMask: z58.boolean().optional(),
|
|
1468
1484
|
solderMaskMargin: distance.optional(),
|
|
1469
1485
|
solderMaskMarginLeft: distance.optional(),
|
|
1470
1486
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1473,14 +1489,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1473
1489
|
});
|
|
1474
1490
|
expectTypesMatch(true);
|
|
1475
1491
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1476
|
-
name:
|
|
1477
|
-
shape:
|
|
1492
|
+
name: z58.string().optional(),
|
|
1493
|
+
shape: z58.literal("rotated_rect"),
|
|
1478
1494
|
width: distance,
|
|
1479
1495
|
height: distance,
|
|
1480
|
-
ccwRotation:
|
|
1496
|
+
ccwRotation: z58.number(),
|
|
1481
1497
|
cornerRadius: distance.optional(),
|
|
1482
1498
|
portHints: portHints.optional(),
|
|
1483
|
-
coveredWithSolderMask:
|
|
1499
|
+
coveredWithSolderMask: z58.boolean().optional(),
|
|
1484
1500
|
solderMaskMargin: distance.optional(),
|
|
1485
1501
|
solderMaskMarginLeft: distance.optional(),
|
|
1486
1502
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1489,35 +1505,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1489
1505
|
});
|
|
1490
1506
|
expectTypesMatch(true);
|
|
1491
1507
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1492
|
-
name:
|
|
1493
|
-
shape:
|
|
1508
|
+
name: z58.string().optional(),
|
|
1509
|
+
shape: z58.literal("circle"),
|
|
1494
1510
|
radius: distance,
|
|
1495
1511
|
portHints: portHints.optional(),
|
|
1496
|
-
coveredWithSolderMask:
|
|
1512
|
+
coveredWithSolderMask: z58.boolean().optional(),
|
|
1497
1513
|
solderMaskMargin: distance.optional()
|
|
1498
1514
|
});
|
|
1499
1515
|
expectTypesMatch(true);
|
|
1500
1516
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1501
|
-
name:
|
|
1502
|
-
shape:
|
|
1517
|
+
name: z58.string().optional(),
|
|
1518
|
+
shape: z58.literal("pill"),
|
|
1503
1519
|
width: distance,
|
|
1504
1520
|
height: distance,
|
|
1505
1521
|
radius: distance,
|
|
1506
1522
|
portHints: portHints.optional(),
|
|
1507
|
-
coveredWithSolderMask:
|
|
1523
|
+
coveredWithSolderMask: z58.boolean().optional(),
|
|
1508
1524
|
solderMaskMargin: distance.optional()
|
|
1509
1525
|
});
|
|
1510
1526
|
expectTypesMatch(true);
|
|
1511
1527
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1512
|
-
name:
|
|
1513
|
-
shape:
|
|
1514
|
-
points:
|
|
1528
|
+
name: z58.string().optional(),
|
|
1529
|
+
shape: z58.literal("polygon"),
|
|
1530
|
+
points: z58.array(point),
|
|
1515
1531
|
portHints: portHints.optional(),
|
|
1516
|
-
coveredWithSolderMask:
|
|
1532
|
+
coveredWithSolderMask: z58.boolean().optional(),
|
|
1517
1533
|
solderMaskMargin: distance.optional()
|
|
1518
1534
|
});
|
|
1519
1535
|
expectTypesMatch(true);
|
|
1520
|
-
var smtPadProps =
|
|
1536
|
+
var smtPadProps = z58.discriminatedUnion("shape", [
|
|
1521
1537
|
circleSmtPadProps,
|
|
1522
1538
|
rectSmtPadProps,
|
|
1523
1539
|
rotatedRectSmtPadProps,
|
|
@@ -1527,55 +1543,55 @@ var smtPadProps = z57.discriminatedUnion("shape", [
|
|
|
1527
1543
|
expectTypesMatch(true);
|
|
1528
1544
|
|
|
1529
1545
|
// lib/components/solderpaste.ts
|
|
1530
|
-
import { z as
|
|
1546
|
+
import { z as z59 } from "zod";
|
|
1531
1547
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1532
|
-
shape:
|
|
1548
|
+
shape: z59.literal("rect"),
|
|
1533
1549
|
width: distance,
|
|
1534
1550
|
height: distance
|
|
1535
1551
|
});
|
|
1536
1552
|
expectTypesMatch(true);
|
|
1537
1553
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1538
|
-
shape:
|
|
1554
|
+
shape: z59.literal("circle"),
|
|
1539
1555
|
radius: distance
|
|
1540
1556
|
});
|
|
1541
1557
|
expectTypesMatch(true);
|
|
1542
|
-
var solderPasteProps =
|
|
1558
|
+
var solderPasteProps = z59.union([
|
|
1543
1559
|
circleSolderPasteProps,
|
|
1544
1560
|
rectSolderPasteProps
|
|
1545
1561
|
]);
|
|
1546
1562
|
expectTypesMatch(true);
|
|
1547
1563
|
|
|
1548
1564
|
// lib/components/hole.ts
|
|
1549
|
-
import { z as
|
|
1565
|
+
import { z as z60 } from "zod";
|
|
1550
1566
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1551
|
-
name:
|
|
1552
|
-
shape:
|
|
1567
|
+
name: z60.string().optional(),
|
|
1568
|
+
shape: z60.literal("circle").optional(),
|
|
1553
1569
|
diameter: distance.optional(),
|
|
1554
1570
|
radius: distance.optional(),
|
|
1555
1571
|
solderMaskMargin: distance.optional(),
|
|
1556
|
-
coveredWithSolderMask:
|
|
1572
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
1557
1573
|
}).transform((d) => ({
|
|
1558
1574
|
...d,
|
|
1559
1575
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1560
1576
|
radius: d.radius ?? d.diameter / 2
|
|
1561
1577
|
}));
|
|
1562
1578
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1563
|
-
name:
|
|
1564
|
-
shape:
|
|
1579
|
+
name: z60.string().optional(),
|
|
1580
|
+
shape: z60.literal("pill"),
|
|
1565
1581
|
width: distance,
|
|
1566
1582
|
height: distance,
|
|
1567
1583
|
solderMaskMargin: distance.optional(),
|
|
1568
|
-
coveredWithSolderMask:
|
|
1584
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
1569
1585
|
});
|
|
1570
1586
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1571
|
-
name:
|
|
1572
|
-
shape:
|
|
1587
|
+
name: z60.string().optional(),
|
|
1588
|
+
shape: z60.literal("rect"),
|
|
1573
1589
|
width: distance,
|
|
1574
1590
|
height: distance,
|
|
1575
1591
|
solderMaskMargin: distance.optional(),
|
|
1576
|
-
coveredWithSolderMask:
|
|
1592
|
+
coveredWithSolderMask: z60.boolean().optional()
|
|
1577
1593
|
});
|
|
1578
|
-
var holeProps =
|
|
1594
|
+
var holeProps = z60.union([
|
|
1579
1595
|
circleHoleProps,
|
|
1580
1596
|
pillHoleProps,
|
|
1581
1597
|
rectHoleProps
|
|
@@ -1584,54 +1600,54 @@ expectTypesMatch(true);
|
|
|
1584
1600
|
|
|
1585
1601
|
// lib/components/trace.ts
|
|
1586
1602
|
import { distance as distance18, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1587
|
-
import { z as
|
|
1588
|
-
var portRef =
|
|
1589
|
-
|
|
1590
|
-
|
|
1603
|
+
import { z as z61 } from "zod";
|
|
1604
|
+
var portRef = z61.union([
|
|
1605
|
+
z61.string(),
|
|
1606
|
+
z61.custom(
|
|
1591
1607
|
(v) => Boolean(v.getPortSelector)
|
|
1592
1608
|
)
|
|
1593
1609
|
]);
|
|
1594
1610
|
var pcbPathPoint = point.extend({
|
|
1595
|
-
via:
|
|
1611
|
+
via: z61.boolean().optional(),
|
|
1596
1612
|
fromLayer: layer_ref4.optional(),
|
|
1597
1613
|
toLayer: layer_ref4.optional()
|
|
1598
1614
|
}).superRefine((value, ctx) => {
|
|
1599
1615
|
if (value.via) {
|
|
1600
1616
|
if (!value.toLayer) {
|
|
1601
1617
|
ctx.addIssue({
|
|
1602
|
-
code:
|
|
1618
|
+
code: z61.ZodIssueCode.custom,
|
|
1603
1619
|
message: "toLayer is required when via is true",
|
|
1604
1620
|
path: ["toLayer"]
|
|
1605
1621
|
});
|
|
1606
1622
|
}
|
|
1607
1623
|
} else if (value.fromLayer || value.toLayer) {
|
|
1608
1624
|
ctx.addIssue({
|
|
1609
|
-
code:
|
|
1625
|
+
code: z61.ZodIssueCode.custom,
|
|
1610
1626
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
1611
1627
|
path: ["via"]
|
|
1612
1628
|
});
|
|
1613
1629
|
}
|
|
1614
1630
|
});
|
|
1615
|
-
var pcbPath =
|
|
1616
|
-
var baseTraceProps =
|
|
1617
|
-
key:
|
|
1631
|
+
var pcbPath = z61.array(z61.union([pcbPathPoint, z61.string()]));
|
|
1632
|
+
var baseTraceProps = z61.object({
|
|
1633
|
+
key: z61.string().optional(),
|
|
1618
1634
|
thickness: distance18.optional(),
|
|
1619
1635
|
width: distance18.optional().describe("Alias for trace thickness"),
|
|
1620
|
-
schematicRouteHints:
|
|
1621
|
-
pcbRouteHints:
|
|
1622
|
-
pcbPathRelativeTo:
|
|
1636
|
+
schematicRouteHints: z61.array(point).optional(),
|
|
1637
|
+
pcbRouteHints: z61.array(route_hint_point2).optional(),
|
|
1638
|
+
pcbPathRelativeTo: z61.string().optional(),
|
|
1623
1639
|
pcbPath: pcbPath.optional(),
|
|
1624
|
-
pcbPaths:
|
|
1625
|
-
pcbStraightLine:
|
|
1626
|
-
schDisplayLabel:
|
|
1627
|
-
schStroke:
|
|
1628
|
-
highlightColor:
|
|
1640
|
+
pcbPaths: z61.array(pcbPath).optional(),
|
|
1641
|
+
pcbStraightLine: z61.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1642
|
+
schDisplayLabel: z61.string().optional(),
|
|
1643
|
+
schStroke: z61.string().optional(),
|
|
1644
|
+
highlightColor: z61.string().optional(),
|
|
1629
1645
|
maxLength: distance18.optional(),
|
|
1630
|
-
connectsTo:
|
|
1646
|
+
connectsTo: z61.string().or(z61.array(z61.string())).optional()
|
|
1631
1647
|
});
|
|
1632
|
-
var traceProps =
|
|
1648
|
+
var traceProps = z61.union([
|
|
1633
1649
|
baseTraceProps.extend({
|
|
1634
|
-
path:
|
|
1650
|
+
path: z61.array(portRef)
|
|
1635
1651
|
}),
|
|
1636
1652
|
baseTraceProps.extend({
|
|
1637
1653
|
from: portRef,
|
|
@@ -1641,28 +1657,28 @@ var traceProps = z60.union([
|
|
|
1641
1657
|
|
|
1642
1658
|
// lib/components/footprint.ts
|
|
1643
1659
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
1644
|
-
import { z as
|
|
1645
|
-
var footprintProps =
|
|
1646
|
-
children:
|
|
1660
|
+
import { z as z62 } from "zod";
|
|
1661
|
+
var footprintProps = z62.object({
|
|
1662
|
+
children: z62.any().optional(),
|
|
1647
1663
|
originalLayer: layer_ref5.default("top").optional(),
|
|
1648
|
-
circuitJson:
|
|
1664
|
+
circuitJson: z62.array(z62.any()).optional()
|
|
1649
1665
|
});
|
|
1650
1666
|
expectTypesMatch(true);
|
|
1651
1667
|
|
|
1652
1668
|
// lib/components/symbol.ts
|
|
1653
|
-
import { z as
|
|
1654
|
-
var symbolProps =
|
|
1655
|
-
originalFacingDirection:
|
|
1669
|
+
import { z as z63 } from "zod";
|
|
1670
|
+
var symbolProps = z63.object({
|
|
1671
|
+
originalFacingDirection: z63.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
1656
1672
|
width: distance.optional(),
|
|
1657
1673
|
height: distance.optional(),
|
|
1658
|
-
name:
|
|
1674
|
+
name: z63.string().optional()
|
|
1659
1675
|
});
|
|
1660
1676
|
expectTypesMatch(true);
|
|
1661
1677
|
|
|
1662
1678
|
// lib/components/battery.ts
|
|
1663
1679
|
import { voltage as voltage2 } from "circuit-json";
|
|
1664
|
-
import { z as
|
|
1665
|
-
var capacity =
|
|
1680
|
+
import { z as z64 } from "zod";
|
|
1681
|
+
var capacity = z64.number().or(z64.string().endsWith("mAh")).transform((v) => {
|
|
1666
1682
|
if (typeof v === "string") {
|
|
1667
1683
|
const valString = v.replace("mAh", "");
|
|
1668
1684
|
const num = Number.parseFloat(valString);
|
|
@@ -1676,17 +1692,17 @@ var capacity = z63.number().or(z63.string().endsWith("mAh")).transform((v) => {
|
|
|
1676
1692
|
var batteryProps = commonComponentProps.extend({
|
|
1677
1693
|
capacity: capacity.optional(),
|
|
1678
1694
|
voltage: voltage2.optional(),
|
|
1679
|
-
standard:
|
|
1695
|
+
standard: z64.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1680
1696
|
schOrientation: schematicOrientation.optional()
|
|
1681
1697
|
});
|
|
1682
1698
|
var batteryPins = lrPolarPins;
|
|
1683
1699
|
expectTypesMatch(true);
|
|
1684
1700
|
|
|
1685
1701
|
// lib/components/mountedboard.ts
|
|
1686
|
-
import { z as
|
|
1702
|
+
import { z as z65 } from "zod";
|
|
1687
1703
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
1688
1704
|
boardToBoardDistance: distance.optional(),
|
|
1689
|
-
mountOrientation:
|
|
1705
|
+
mountOrientation: z65.enum(["faceDown", "faceUp"]).optional()
|
|
1690
1706
|
});
|
|
1691
1707
|
expectTypesMatch(true);
|
|
1692
1708
|
|
|
@@ -1694,29 +1710,29 @@ expectTypesMatch(true);
|
|
|
1694
1710
|
import { distance as distance19 } from "circuit-json";
|
|
1695
1711
|
|
|
1696
1712
|
// lib/common/pcbOrientation.ts
|
|
1697
|
-
import { z as
|
|
1698
|
-
var pcbOrientation =
|
|
1713
|
+
import { z as z66 } from "zod";
|
|
1714
|
+
var pcbOrientation = z66.enum(["vertical", "horizontal"]).describe(
|
|
1699
1715
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1700
1716
|
);
|
|
1701
1717
|
expectTypesMatch(true);
|
|
1702
1718
|
|
|
1703
1719
|
// lib/components/pin-header.ts
|
|
1704
|
-
import { z as
|
|
1720
|
+
import { z as z67 } from "zod";
|
|
1705
1721
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1706
|
-
pinCount:
|
|
1722
|
+
pinCount: z67.number(),
|
|
1707
1723
|
pitch: distance19.optional(),
|
|
1708
|
-
schFacingDirection:
|
|
1709
|
-
gender:
|
|
1710
|
-
showSilkscreenPinLabels:
|
|
1711
|
-
pcbPinLabels:
|
|
1712
|
-
doubleRow:
|
|
1713
|
-
rightAngle:
|
|
1724
|
+
schFacingDirection: z67.enum(["up", "down", "left", "right"]).optional(),
|
|
1725
|
+
gender: z67.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1726
|
+
showSilkscreenPinLabels: z67.boolean().optional(),
|
|
1727
|
+
pcbPinLabels: z67.record(z67.string(), z67.string()).optional(),
|
|
1728
|
+
doubleRow: z67.boolean().optional(),
|
|
1729
|
+
rightAngle: z67.boolean().optional(),
|
|
1714
1730
|
pcbOrientation: pcbOrientation.optional(),
|
|
1715
1731
|
holeDiameter: distance19.optional(),
|
|
1716
1732
|
platedDiameter: distance19.optional(),
|
|
1717
|
-
pinLabels:
|
|
1718
|
-
connections:
|
|
1719
|
-
facingDirection:
|
|
1733
|
+
pinLabels: z67.record(z67.string(), schematicPinLabel).or(z67.array(schematicPinLabel)).optional(),
|
|
1734
|
+
connections: z67.custom().pipe(z67.record(z67.string(), connectionTarget)).optional(),
|
|
1735
|
+
facingDirection: z67.enum(["left", "right"]).optional(),
|
|
1720
1736
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1721
1737
|
schPinStyle: schematicPinStyle.optional(),
|
|
1722
1738
|
schPinSpacing: distance19.optional(),
|
|
@@ -1726,29 +1742,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
1726
1742
|
expectTypesMatch(true);
|
|
1727
1743
|
|
|
1728
1744
|
// lib/components/netalias.ts
|
|
1729
|
-
import { z as
|
|
1745
|
+
import { z as z68 } from "zod";
|
|
1730
1746
|
import { rotation as rotation3 } from "circuit-json";
|
|
1731
|
-
var netAliasProps =
|
|
1732
|
-
net:
|
|
1733
|
-
connection:
|
|
1747
|
+
var netAliasProps = z68.object({
|
|
1748
|
+
net: z68.string().optional(),
|
|
1749
|
+
connection: z68.string().optional(),
|
|
1734
1750
|
schX: distance.optional(),
|
|
1735
1751
|
schY: distance.optional(),
|
|
1736
1752
|
schRotation: rotation3.optional(),
|
|
1737
|
-
anchorSide:
|
|
1753
|
+
anchorSide: z68.enum(["left", "top", "right", "bottom"]).optional()
|
|
1738
1754
|
});
|
|
1739
1755
|
expectTypesMatch(true);
|
|
1740
1756
|
|
|
1741
1757
|
// lib/components/netlabel.ts
|
|
1742
|
-
import { z as
|
|
1758
|
+
import { z as z69 } from "zod";
|
|
1743
1759
|
import { rotation as rotation4 } from "circuit-json";
|
|
1744
|
-
var netLabelProps =
|
|
1745
|
-
net:
|
|
1746
|
-
connection:
|
|
1747
|
-
connectsTo:
|
|
1760
|
+
var netLabelProps = z69.object({
|
|
1761
|
+
net: z69.string().optional(),
|
|
1762
|
+
connection: z69.string().optional(),
|
|
1763
|
+
connectsTo: z69.string().or(z69.array(z69.string())).optional(),
|
|
1748
1764
|
schX: distance.optional(),
|
|
1749
1765
|
schY: distance.optional(),
|
|
1750
1766
|
schRotation: rotation4.optional(),
|
|
1751
|
-
anchorSide:
|
|
1767
|
+
anchorSide: z69.enum(["left", "top", "right", "bottom"]).optional()
|
|
1752
1768
|
});
|
|
1753
1769
|
expectTypesMatch(true);
|
|
1754
1770
|
|
|
@@ -1763,12 +1779,12 @@ expectTypesMatch(true);
|
|
|
1763
1779
|
|
|
1764
1780
|
// lib/components/analogsimulation.ts
|
|
1765
1781
|
import { ms } from "circuit-json";
|
|
1766
|
-
import { z as
|
|
1767
|
-
var spiceEngine =
|
|
1782
|
+
import { z as z71 } from "zod";
|
|
1783
|
+
var spiceEngine = z71.custom(
|
|
1768
1784
|
(value) => typeof value === "string"
|
|
1769
1785
|
);
|
|
1770
|
-
var analogSimulationProps =
|
|
1771
|
-
simulationType:
|
|
1786
|
+
var analogSimulationProps = z71.object({
|
|
1787
|
+
simulationType: z71.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1772
1788
|
duration: ms.optional(),
|
|
1773
1789
|
timePerStep: ms.optional(),
|
|
1774
1790
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1778,7 +1794,7 @@ expectTypesMatch(
|
|
|
1778
1794
|
);
|
|
1779
1795
|
|
|
1780
1796
|
// lib/components/transistor.ts
|
|
1781
|
-
import { z as
|
|
1797
|
+
import { z as z72 } from "zod";
|
|
1782
1798
|
var transistorPinsLabels = [
|
|
1783
1799
|
"pin1",
|
|
1784
1800
|
"pin2",
|
|
@@ -1791,7 +1807,7 @@ var transistorPinsLabels = [
|
|
|
1791
1807
|
"drain"
|
|
1792
1808
|
];
|
|
1793
1809
|
var transistorProps = commonComponentProps.extend({
|
|
1794
|
-
type:
|
|
1810
|
+
type: z72.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1795
1811
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1796
1812
|
});
|
|
1797
1813
|
var transistorPins = [
|
|
@@ -1805,10 +1821,10 @@ var transistorPins = [
|
|
|
1805
1821
|
expectTypesMatch(true);
|
|
1806
1822
|
|
|
1807
1823
|
// lib/components/mosfet.ts
|
|
1808
|
-
import { z as
|
|
1824
|
+
import { z as z73 } from "zod";
|
|
1809
1825
|
var mosfetProps = commonComponentProps.extend({
|
|
1810
|
-
channelType:
|
|
1811
|
-
mosfetMode:
|
|
1826
|
+
channelType: z73.enum(["n", "p"]),
|
|
1827
|
+
mosfetMode: z73.enum(["enhancement", "depletion"])
|
|
1812
1828
|
});
|
|
1813
1829
|
var mosfetPins = [
|
|
1814
1830
|
"pin1",
|
|
@@ -1837,19 +1853,19 @@ expectTypesMatch(true);
|
|
|
1837
1853
|
|
|
1838
1854
|
// lib/components/inductor.ts
|
|
1839
1855
|
import { inductance } from "circuit-json";
|
|
1840
|
-
import { z as
|
|
1856
|
+
import { z as z75 } from "zod";
|
|
1841
1857
|
var inductorPins = lrPins;
|
|
1842
1858
|
var inductorProps = commonComponentProps.extend({
|
|
1843
1859
|
inductance,
|
|
1844
|
-
maxCurrentRating:
|
|
1860
|
+
maxCurrentRating: z75.union([z75.string(), z75.number()]).optional(),
|
|
1845
1861
|
schOrientation: schematicOrientation.optional(),
|
|
1846
1862
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1847
1863
|
});
|
|
1848
1864
|
expectTypesMatch(true);
|
|
1849
1865
|
|
|
1850
1866
|
// lib/components/diode.ts
|
|
1851
|
-
import { z as
|
|
1852
|
-
var diodeConnectionKeys =
|
|
1867
|
+
import { z as z76 } from "zod";
|
|
1868
|
+
var diodeConnectionKeys = z76.enum([
|
|
1853
1869
|
"anode",
|
|
1854
1870
|
"cathode",
|
|
1855
1871
|
"pin1",
|
|
@@ -1857,9 +1873,9 @@ var diodeConnectionKeys = z75.enum([
|
|
|
1857
1873
|
"pos",
|
|
1858
1874
|
"neg"
|
|
1859
1875
|
]);
|
|
1860
|
-
var connectionTarget3 =
|
|
1861
|
-
var connectionsProp2 =
|
|
1862
|
-
var diodeVariant =
|
|
1876
|
+
var connectionTarget3 = z76.string().or(z76.array(z76.string()).readonly()).or(z76.array(z76.string()));
|
|
1877
|
+
var connectionsProp2 = z76.record(diodeConnectionKeys, connectionTarget3);
|
|
1878
|
+
var diodeVariant = z76.enum([
|
|
1863
1879
|
"standard",
|
|
1864
1880
|
"schottky",
|
|
1865
1881
|
"zener",
|
|
@@ -1870,12 +1886,12 @@ var diodeVariant = z75.enum([
|
|
|
1870
1886
|
var diodeProps = commonComponentProps.extend({
|
|
1871
1887
|
connections: connectionsProp2.optional(),
|
|
1872
1888
|
variant: diodeVariant.optional().default("standard"),
|
|
1873
|
-
standard:
|
|
1874
|
-
schottky:
|
|
1875
|
-
zener:
|
|
1876
|
-
avalanche:
|
|
1877
|
-
photo:
|
|
1878
|
-
tvs:
|
|
1889
|
+
standard: z76.boolean().optional(),
|
|
1890
|
+
schottky: z76.boolean().optional(),
|
|
1891
|
+
zener: z76.boolean().optional(),
|
|
1892
|
+
avalanche: z76.boolean().optional(),
|
|
1893
|
+
photo: z76.boolean().optional(),
|
|
1894
|
+
tvs: z76.boolean().optional(),
|
|
1879
1895
|
schOrientation: schematicOrientation.optional()
|
|
1880
1896
|
}).superRefine((data, ctx) => {
|
|
1881
1897
|
const enabledFlags = [
|
|
@@ -1888,11 +1904,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1888
1904
|
].filter(Boolean).length;
|
|
1889
1905
|
if (enabledFlags > 1) {
|
|
1890
1906
|
ctx.addIssue({
|
|
1891
|
-
code:
|
|
1907
|
+
code: z76.ZodIssueCode.custom,
|
|
1892
1908
|
message: "Exactly one diode variant must be enabled",
|
|
1893
1909
|
path: []
|
|
1894
1910
|
});
|
|
1895
|
-
return
|
|
1911
|
+
return z76.INVALID;
|
|
1896
1912
|
}
|
|
1897
1913
|
}).transform((data) => {
|
|
1898
1914
|
const result = {
|
|
@@ -1939,33 +1955,33 @@ var diodePins = lrPolarPins;
|
|
|
1939
1955
|
expectTypesMatch(true);
|
|
1940
1956
|
|
|
1941
1957
|
// lib/components/led.ts
|
|
1942
|
-
import { z as
|
|
1958
|
+
import { z as z77 } from "zod";
|
|
1943
1959
|
var ledProps = commonComponentProps.extend({
|
|
1944
|
-
color:
|
|
1945
|
-
wavelength:
|
|
1946
|
-
schDisplayValue:
|
|
1960
|
+
color: z77.string().optional(),
|
|
1961
|
+
wavelength: z77.string().optional(),
|
|
1962
|
+
schDisplayValue: z77.string().optional(),
|
|
1947
1963
|
schOrientation: schematicOrientation.optional(),
|
|
1948
1964
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1949
|
-
laser:
|
|
1965
|
+
laser: z77.boolean().optional()
|
|
1950
1966
|
});
|
|
1951
1967
|
var ledPins = lrPolarPins;
|
|
1952
1968
|
|
|
1953
1969
|
// lib/components/switch.ts
|
|
1954
1970
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
1955
|
-
import { z as
|
|
1971
|
+
import { z as z78 } from "zod";
|
|
1956
1972
|
var switchProps = commonComponentProps.extend({
|
|
1957
|
-
type:
|
|
1958
|
-
isNormallyClosed:
|
|
1959
|
-
spst:
|
|
1960
|
-
spdt:
|
|
1961
|
-
dpst:
|
|
1962
|
-
dpdt:
|
|
1973
|
+
type: z78.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1974
|
+
isNormallyClosed: z78.boolean().optional().default(false),
|
|
1975
|
+
spst: z78.boolean().optional(),
|
|
1976
|
+
spdt: z78.boolean().optional(),
|
|
1977
|
+
dpst: z78.boolean().optional(),
|
|
1978
|
+
dpdt: z78.boolean().optional(),
|
|
1963
1979
|
simSwitchFrequency: frequency3.optional(),
|
|
1964
1980
|
simCloseAt: ms2.optional(),
|
|
1965
1981
|
simOpenAt: ms2.optional(),
|
|
1966
|
-
simStartClosed:
|
|
1967
|
-
simStartOpen:
|
|
1968
|
-
connections:
|
|
1982
|
+
simStartClosed: z78.boolean().optional(),
|
|
1983
|
+
simStartOpen: z78.boolean().optional(),
|
|
1984
|
+
connections: z78.custom().pipe(z78.record(z78.string(), connectionTarget)).optional()
|
|
1969
1985
|
}).transform((props) => {
|
|
1970
1986
|
const updatedProps = { ...props };
|
|
1971
1987
|
if (updatedProps.dpdt) {
|
|
@@ -1996,34 +2012,34 @@ var switchProps = commonComponentProps.extend({
|
|
|
1996
2012
|
expectTypesMatch(true);
|
|
1997
2013
|
|
|
1998
2014
|
// lib/components/fabrication-note-text.ts
|
|
1999
|
-
import { length as
|
|
2000
|
-
import { z as
|
|
2015
|
+
import { length as length4 } from "circuit-json";
|
|
2016
|
+
import { z as z79 } from "zod";
|
|
2001
2017
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
2002
|
-
text:
|
|
2003
|
-
anchorAlignment:
|
|
2004
|
-
font:
|
|
2005
|
-
fontSize:
|
|
2006
|
-
color:
|
|
2018
|
+
text: z79.string(),
|
|
2019
|
+
anchorAlignment: z79.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2020
|
+
font: z79.enum(["tscircuit2024"]).optional(),
|
|
2021
|
+
fontSize: length4.optional(),
|
|
2022
|
+
color: z79.string().optional()
|
|
2007
2023
|
});
|
|
2008
2024
|
expectTypesMatch(true);
|
|
2009
2025
|
|
|
2010
2026
|
// lib/components/fabrication-note-rect.ts
|
|
2011
2027
|
import { distance as distance20 } from "circuit-json";
|
|
2012
|
-
import { z as
|
|
2028
|
+
import { z as z80 } from "zod";
|
|
2013
2029
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2014
2030
|
width: distance20,
|
|
2015
2031
|
height: distance20,
|
|
2016
2032
|
strokeWidth: distance20.optional(),
|
|
2017
|
-
isFilled:
|
|
2018
|
-
hasStroke:
|
|
2019
|
-
isStrokeDashed:
|
|
2020
|
-
color:
|
|
2033
|
+
isFilled: z80.boolean().optional(),
|
|
2034
|
+
hasStroke: z80.boolean().optional(),
|
|
2035
|
+
isStrokeDashed: z80.boolean().optional(),
|
|
2036
|
+
color: z80.string().optional(),
|
|
2021
2037
|
cornerRadius: distance20.optional()
|
|
2022
2038
|
});
|
|
2023
2039
|
|
|
2024
2040
|
// lib/components/fabrication-note-path.ts
|
|
2025
|
-
import { length as
|
|
2026
|
-
import { z as
|
|
2041
|
+
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
2042
|
+
import { z as z81 } from "zod";
|
|
2027
2043
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
2028
2044
|
pcbLeftEdgeX: true,
|
|
2029
2045
|
pcbRightEdgeX: true,
|
|
@@ -2035,15 +2051,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
2035
2051
|
pcbOffsetY: true,
|
|
2036
2052
|
pcbRotation: true
|
|
2037
2053
|
}).extend({
|
|
2038
|
-
route:
|
|
2039
|
-
strokeWidth:
|
|
2040
|
-
color:
|
|
2054
|
+
route: z81.array(route_hint_point3),
|
|
2055
|
+
strokeWidth: length5.optional(),
|
|
2056
|
+
color: z81.string().optional()
|
|
2041
2057
|
});
|
|
2042
2058
|
|
|
2043
2059
|
// lib/components/fabrication-note-dimension.ts
|
|
2044
|
-
import { distance as distance21, length as
|
|
2045
|
-
import { z as
|
|
2046
|
-
var dimensionTarget =
|
|
2060
|
+
import { distance as distance21, length as length6 } from "circuit-json";
|
|
2061
|
+
import { z as z82 } from "zod";
|
|
2062
|
+
var dimensionTarget = z82.union([z82.string(), point]);
|
|
2047
2063
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
2048
2064
|
pcbLeftEdgeX: true,
|
|
2049
2065
|
pcbRightEdgeX: true,
|
|
@@ -2057,53 +2073,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2057
2073
|
}).extend({
|
|
2058
2074
|
from: dimensionTarget,
|
|
2059
2075
|
to: dimensionTarget,
|
|
2060
|
-
text:
|
|
2076
|
+
text: z82.string().optional(),
|
|
2061
2077
|
offset: distance21.optional(),
|
|
2062
|
-
font:
|
|
2063
|
-
fontSize:
|
|
2064
|
-
color:
|
|
2078
|
+
font: z82.enum(["tscircuit2024"]).optional(),
|
|
2079
|
+
fontSize: length6.optional(),
|
|
2080
|
+
color: z82.string().optional(),
|
|
2065
2081
|
arrowSize: distance21.optional(),
|
|
2066
|
-
units:
|
|
2067
|
-
outerEdgeToEdge:
|
|
2068
|
-
centerToCenter:
|
|
2069
|
-
innerEdgeToEdge:
|
|
2082
|
+
units: z82.enum(["in", "mm"]).optional(),
|
|
2083
|
+
outerEdgeToEdge: z82.literal(true).optional(),
|
|
2084
|
+
centerToCenter: z82.literal(true).optional(),
|
|
2085
|
+
innerEdgeToEdge: z82.literal(true).optional()
|
|
2070
2086
|
});
|
|
2071
2087
|
expectTypesMatch(true);
|
|
2072
2088
|
|
|
2073
2089
|
// lib/components/pcb-trace.ts
|
|
2074
2090
|
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
2075
|
-
import { z as
|
|
2076
|
-
var pcbTraceProps =
|
|
2077
|
-
layer:
|
|
2091
|
+
import { z as z83 } from "zod";
|
|
2092
|
+
var pcbTraceProps = z83.object({
|
|
2093
|
+
layer: z83.string().optional(),
|
|
2078
2094
|
thickness: distance22.optional(),
|
|
2079
|
-
route:
|
|
2095
|
+
route: z83.array(route_hint_point4)
|
|
2080
2096
|
});
|
|
2081
2097
|
|
|
2082
2098
|
// lib/components/via.ts
|
|
2083
2099
|
import { distance as distance23, layer_ref as layer_ref6 } from "circuit-json";
|
|
2084
|
-
import { z as
|
|
2100
|
+
import { z as z84 } from "zod";
|
|
2085
2101
|
var viaProps = commonLayoutProps.extend({
|
|
2086
|
-
name:
|
|
2102
|
+
name: z84.string().optional(),
|
|
2087
2103
|
fromLayer: layer_ref6,
|
|
2088
2104
|
toLayer: layer_ref6,
|
|
2089
2105
|
holeDiameter: distance23.optional(),
|
|
2090
2106
|
outerDiameter: distance23.optional(),
|
|
2091
|
-
connectsTo:
|
|
2092
|
-
netIsAssignable:
|
|
2107
|
+
connectsTo: z84.string().or(z84.array(z84.string())).optional(),
|
|
2108
|
+
netIsAssignable: z84.boolean().optional()
|
|
2093
2109
|
});
|
|
2094
2110
|
expectTypesMatch(true);
|
|
2095
2111
|
|
|
2096
2112
|
// lib/components/testpoint.ts
|
|
2097
2113
|
import { distance as distance24 } from "circuit-json";
|
|
2098
|
-
import { z as
|
|
2114
|
+
import { z as z85 } from "zod";
|
|
2099
2115
|
var testpointPins = ["pin1"];
|
|
2100
|
-
var testpointConnectionsProp =
|
|
2116
|
+
var testpointConnectionsProp = z85.object({
|
|
2101
2117
|
pin1: connectionTarget
|
|
2102
2118
|
}).strict();
|
|
2103
2119
|
var testpointProps = commonComponentProps.extend({
|
|
2104
2120
|
connections: testpointConnectionsProp.optional(),
|
|
2105
|
-
footprintVariant:
|
|
2106
|
-
padShape:
|
|
2121
|
+
footprintVariant: z85.enum(["pad", "through_hole"]).optional(),
|
|
2122
|
+
padShape: z85.enum(["rect", "circle"]).optional().default("circle"),
|
|
2107
2123
|
padDiameter: distance24.optional(),
|
|
2108
2124
|
holeDiameter: distance24.optional(),
|
|
2109
2125
|
width: distance24.optional(),
|
|
@@ -2115,22 +2131,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
2115
2131
|
expectTypesMatch(true);
|
|
2116
2132
|
|
|
2117
2133
|
// lib/components/breakoutpoint.ts
|
|
2118
|
-
import { z as
|
|
2134
|
+
import { z as z86 } from "zod";
|
|
2119
2135
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
2120
|
-
connection:
|
|
2136
|
+
connection: z86.string()
|
|
2121
2137
|
});
|
|
2122
2138
|
expectTypesMatch(true);
|
|
2123
2139
|
|
|
2124
2140
|
// lib/components/pcb-keepout.ts
|
|
2125
2141
|
import { distance as distance25 } from "circuit-json";
|
|
2126
|
-
import { z as
|
|
2127
|
-
var pcbKeepoutProps =
|
|
2142
|
+
import { z as z87 } from "zod";
|
|
2143
|
+
var pcbKeepoutProps = z87.union([
|
|
2128
2144
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2129
|
-
shape:
|
|
2145
|
+
shape: z87.literal("circle"),
|
|
2130
2146
|
radius: distance25
|
|
2131
2147
|
}),
|
|
2132
2148
|
pcbLayoutProps.extend({
|
|
2133
|
-
shape:
|
|
2149
|
+
shape: z87.literal("rect"),
|
|
2134
2150
|
width: distance25,
|
|
2135
2151
|
height: distance25
|
|
2136
2152
|
})
|
|
@@ -2138,20 +2154,20 @@ var pcbKeepoutProps = z86.union([
|
|
|
2138
2154
|
|
|
2139
2155
|
// lib/components/courtyard-rect.ts
|
|
2140
2156
|
import { distance as distance26 } from "circuit-json";
|
|
2141
|
-
import { z as
|
|
2157
|
+
import { z as z88 } from "zod";
|
|
2142
2158
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2143
2159
|
width: distance26,
|
|
2144
2160
|
height: distance26,
|
|
2145
2161
|
strokeWidth: distance26.optional(),
|
|
2146
|
-
isFilled:
|
|
2147
|
-
hasStroke:
|
|
2148
|
-
isStrokeDashed:
|
|
2149
|
-
color:
|
|
2162
|
+
isFilled: z88.boolean().optional(),
|
|
2163
|
+
hasStroke: z88.boolean().optional(),
|
|
2164
|
+
isStrokeDashed: z88.boolean().optional(),
|
|
2165
|
+
color: z88.string().optional()
|
|
2150
2166
|
});
|
|
2151
2167
|
|
|
2152
2168
|
// lib/components/courtyard-outline.ts
|
|
2153
|
-
import { length as
|
|
2154
|
-
import { z as
|
|
2169
|
+
import { length as length7 } from "circuit-json";
|
|
2170
|
+
import { z as z89 } from "zod";
|
|
2155
2171
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
2156
2172
|
pcbLeftEdgeX: true,
|
|
2157
2173
|
pcbRightEdgeX: true,
|
|
@@ -2163,11 +2179,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
2163
2179
|
pcbOffsetY: true,
|
|
2164
2180
|
pcbRotation: true
|
|
2165
2181
|
}).extend({
|
|
2166
|
-
outline:
|
|
2167
|
-
strokeWidth:
|
|
2168
|
-
isClosed:
|
|
2169
|
-
isStrokeDashed:
|
|
2170
|
-
color:
|
|
2182
|
+
outline: z89.array(point),
|
|
2183
|
+
strokeWidth: length7.optional(),
|
|
2184
|
+
isClosed: z89.boolean().optional(),
|
|
2185
|
+
isStrokeDashed: z89.boolean().optional(),
|
|
2186
|
+
color: z89.string().optional()
|
|
2171
2187
|
});
|
|
2172
2188
|
|
|
2173
2189
|
// lib/components/courtyard-circle.ts
|
|
@@ -2187,34 +2203,34 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2187
2203
|
});
|
|
2188
2204
|
|
|
2189
2205
|
// lib/components/copper-pour.ts
|
|
2190
|
-
import { z as
|
|
2206
|
+
import { z as z92 } from "zod";
|
|
2191
2207
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
2192
|
-
var copperPourProps =
|
|
2193
|
-
name:
|
|
2208
|
+
var copperPourProps = z92.object({
|
|
2209
|
+
name: z92.string().optional(),
|
|
2194
2210
|
layer: layer_ref7,
|
|
2195
|
-
connectsTo:
|
|
2211
|
+
connectsTo: z92.string(),
|
|
2196
2212
|
padMargin: distance.optional(),
|
|
2197
2213
|
traceMargin: distance.optional(),
|
|
2198
2214
|
clearance: distance.optional(),
|
|
2199
2215
|
boardEdgeMargin: distance.optional(),
|
|
2200
2216
|
cutoutMargin: distance.optional(),
|
|
2201
|
-
outline:
|
|
2202
|
-
coveredWithSolderMask:
|
|
2217
|
+
outline: z92.array(point).optional(),
|
|
2218
|
+
coveredWithSolderMask: z92.boolean().optional().default(true)
|
|
2203
2219
|
});
|
|
2204
2220
|
expectTypesMatch(true);
|
|
2205
2221
|
|
|
2206
2222
|
// lib/components/cadassembly.ts
|
|
2207
2223
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
2208
|
-
import { z as
|
|
2209
|
-
var cadassemblyProps =
|
|
2224
|
+
import { z as z93 } from "zod";
|
|
2225
|
+
var cadassemblyProps = z93.object({
|
|
2210
2226
|
originalLayer: layer_ref8.default("top").optional(),
|
|
2211
|
-
children:
|
|
2227
|
+
children: z93.any().optional()
|
|
2212
2228
|
});
|
|
2213
2229
|
expectTypesMatch(true);
|
|
2214
2230
|
|
|
2215
2231
|
// lib/components/cadmodel.ts
|
|
2216
|
-
import { z as
|
|
2217
|
-
var pcbPosition =
|
|
2232
|
+
import { z as z94 } from "zod";
|
|
2233
|
+
var pcbPosition = z94.object({
|
|
2218
2234
|
pcbX: pcbCoordinate.optional(),
|
|
2219
2235
|
pcbY: pcbCoordinate.optional(),
|
|
2220
2236
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -2231,7 +2247,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
2231
2247
|
});
|
|
2232
2248
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
2233
2249
|
expectTypesMatch(true);
|
|
2234
|
-
var cadmodelProps =
|
|
2250
|
+
var cadmodelProps = z94.union([z94.null(), url, cadModelObject]);
|
|
2235
2251
|
|
|
2236
2252
|
// lib/components/power-source.ts
|
|
2237
2253
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -2241,9 +2257,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
2241
2257
|
|
|
2242
2258
|
// lib/components/voltagesource.ts
|
|
2243
2259
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
2244
|
-
import { z as
|
|
2260
|
+
import { z as z95 } from "zod";
|
|
2245
2261
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2246
|
-
var percentage =
|
|
2262
|
+
var percentage = z95.union([z95.string(), z95.number()]).transform((val) => {
|
|
2247
2263
|
if (typeof val === "string") {
|
|
2248
2264
|
if (val.endsWith("%")) {
|
|
2249
2265
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2252,13 +2268,13 @@ var percentage = z94.union([z94.string(), z94.number()]).transform((val) => {
|
|
|
2252
2268
|
}
|
|
2253
2269
|
return val;
|
|
2254
2270
|
}).pipe(
|
|
2255
|
-
|
|
2271
|
+
z95.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2256
2272
|
);
|
|
2257
2273
|
var voltageSourceProps = commonComponentProps.extend({
|
|
2258
2274
|
voltage: voltage4.optional(),
|
|
2259
2275
|
frequency: frequency4.optional(),
|
|
2260
2276
|
peakToPeakVoltage: voltage4.optional(),
|
|
2261
|
-
waveShape:
|
|
2277
|
+
waveShape: z95.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2262
2278
|
phase: rotation5.optional(),
|
|
2263
2279
|
dutyCycle: percentage.optional(),
|
|
2264
2280
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -2268,9 +2284,9 @@ expectTypesMatch(true);
|
|
|
2268
2284
|
|
|
2269
2285
|
// lib/components/currentsource.ts
|
|
2270
2286
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
2271
|
-
import { z as
|
|
2287
|
+
import { z as z96 } from "zod";
|
|
2272
2288
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2273
|
-
var percentage2 =
|
|
2289
|
+
var percentage2 = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
2274
2290
|
if (typeof val === "string") {
|
|
2275
2291
|
if (val.endsWith("%")) {
|
|
2276
2292
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2279,13 +2295,13 @@ var percentage2 = z95.union([z95.string(), z95.number()]).transform((val) => {
|
|
|
2279
2295
|
}
|
|
2280
2296
|
return val;
|
|
2281
2297
|
}).pipe(
|
|
2282
|
-
|
|
2298
|
+
z96.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2283
2299
|
);
|
|
2284
2300
|
var currentSourceProps = commonComponentProps.extend({
|
|
2285
2301
|
current: current.optional(),
|
|
2286
2302
|
frequency: frequency5.optional(),
|
|
2287
2303
|
peakToPeakCurrent: current.optional(),
|
|
2288
|
-
waveShape:
|
|
2304
|
+
waveShape: z96.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2289
2305
|
phase: rotation6.optional(),
|
|
2290
2306
|
dutyCycle: percentage2.optional(),
|
|
2291
2307
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -2294,57 +2310,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
2294
2310
|
expectTypesMatch(true);
|
|
2295
2311
|
|
|
2296
2312
|
// lib/components/voltageprobe.ts
|
|
2297
|
-
import { z as
|
|
2313
|
+
import { z as z97 } from "zod";
|
|
2298
2314
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
2299
|
-
name:
|
|
2300
|
-
connectsTo:
|
|
2301
|
-
referenceTo:
|
|
2302
|
-
color:
|
|
2315
|
+
name: z97.string().optional(),
|
|
2316
|
+
connectsTo: z97.string(),
|
|
2317
|
+
referenceTo: z97.string().optional(),
|
|
2318
|
+
color: z97.string().optional()
|
|
2303
2319
|
});
|
|
2304
2320
|
expectTypesMatch(true);
|
|
2305
2321
|
|
|
2306
2322
|
// lib/components/schematic-arc.ts
|
|
2307
2323
|
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
2308
|
-
import { z as
|
|
2309
|
-
var schematicArcProps =
|
|
2324
|
+
import { z as z98 } from "zod";
|
|
2325
|
+
var schematicArcProps = z98.object({
|
|
2310
2326
|
center: point5,
|
|
2311
2327
|
radius: distance29,
|
|
2312
2328
|
startAngleDegrees: rotation7,
|
|
2313
2329
|
endAngleDegrees: rotation7,
|
|
2314
|
-
direction:
|
|
2330
|
+
direction: z98.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2315
2331
|
strokeWidth: distance29.optional(),
|
|
2316
|
-
color:
|
|
2317
|
-
isDashed:
|
|
2332
|
+
color: z98.string().optional(),
|
|
2333
|
+
isDashed: z98.boolean().optional().default(false)
|
|
2318
2334
|
});
|
|
2319
2335
|
expectTypesMatch(true);
|
|
2320
2336
|
|
|
2321
2337
|
// lib/components/toolingrail.ts
|
|
2322
|
-
import { z as
|
|
2323
|
-
var toolingrailProps =
|
|
2324
|
-
children:
|
|
2338
|
+
import { z as z99 } from "zod";
|
|
2339
|
+
var toolingrailProps = z99.object({
|
|
2340
|
+
children: z99.any().optional()
|
|
2325
2341
|
});
|
|
2326
2342
|
expectTypesMatch(true);
|
|
2327
2343
|
|
|
2328
2344
|
// lib/components/schematic-box.ts
|
|
2329
2345
|
import { distance as distance30 } from "circuit-json";
|
|
2330
|
-
import { z as
|
|
2331
|
-
var schematicBoxProps =
|
|
2346
|
+
import { z as z100 } from "zod";
|
|
2347
|
+
var schematicBoxProps = z100.object({
|
|
2332
2348
|
schX: distance30.optional(),
|
|
2333
2349
|
schY: distance30.optional(),
|
|
2334
2350
|
width: distance30.optional(),
|
|
2335
2351
|
height: distance30.optional(),
|
|
2336
|
-
overlay:
|
|
2352
|
+
overlay: z100.array(z100.string()).optional(),
|
|
2337
2353
|
padding: distance30.optional(),
|
|
2338
2354
|
paddingLeft: distance30.optional(),
|
|
2339
2355
|
paddingRight: distance30.optional(),
|
|
2340
2356
|
paddingTop: distance30.optional(),
|
|
2341
2357
|
paddingBottom: distance30.optional(),
|
|
2342
|
-
title:
|
|
2358
|
+
title: z100.string().optional(),
|
|
2343
2359
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2344
|
-
titleColor:
|
|
2360
|
+
titleColor: z100.string().optional(),
|
|
2345
2361
|
titleFontSize: distance30.optional(),
|
|
2346
|
-
titleInside:
|
|
2347
|
-
strokeStyle:
|
|
2362
|
+
titleInside: z100.boolean().default(false),
|
|
2363
|
+
strokeStyle: z100.enum(["solid", "dashed"]).default("solid")
|
|
2348
2364
|
}).refine(
|
|
2349
2365
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2350
2366
|
{
|
|
@@ -2360,15 +2376,15 @@ expectTypesMatch(true);
|
|
|
2360
2376
|
|
|
2361
2377
|
// lib/components/schematic-circle.ts
|
|
2362
2378
|
import { distance as distance31, point as point6 } from "circuit-json";
|
|
2363
|
-
import { z as
|
|
2364
|
-
var schematicCircleProps =
|
|
2379
|
+
import { z as z101 } from "zod";
|
|
2380
|
+
var schematicCircleProps = z101.object({
|
|
2365
2381
|
center: point6,
|
|
2366
2382
|
radius: distance31,
|
|
2367
2383
|
strokeWidth: distance31.optional(),
|
|
2368
|
-
color:
|
|
2369
|
-
isFilled:
|
|
2370
|
-
fillColor:
|
|
2371
|
-
isDashed:
|
|
2384
|
+
color: z101.string().optional(),
|
|
2385
|
+
isFilled: z101.boolean().optional().default(false),
|
|
2386
|
+
fillColor: z101.string().optional(),
|
|
2387
|
+
isDashed: z101.boolean().optional().default(false)
|
|
2372
2388
|
});
|
|
2373
2389
|
expectTypesMatch(
|
|
2374
2390
|
true
|
|
@@ -2376,43 +2392,43 @@ expectTypesMatch(
|
|
|
2376
2392
|
|
|
2377
2393
|
// lib/components/schematic-rect.ts
|
|
2378
2394
|
import { distance as distance32, rotation as rotation8 } from "circuit-json";
|
|
2379
|
-
import { z as
|
|
2380
|
-
var schematicRectProps =
|
|
2395
|
+
import { z as z102 } from "zod";
|
|
2396
|
+
var schematicRectProps = z102.object({
|
|
2381
2397
|
schX: distance32.optional(),
|
|
2382
2398
|
schY: distance32.optional(),
|
|
2383
2399
|
width: distance32,
|
|
2384
2400
|
height: distance32,
|
|
2385
2401
|
rotation: rotation8.default(0),
|
|
2386
2402
|
strokeWidth: distance32.optional(),
|
|
2387
|
-
color:
|
|
2388
|
-
isFilled:
|
|
2389
|
-
fillColor:
|
|
2390
|
-
isDashed:
|
|
2403
|
+
color: z102.string().optional(),
|
|
2404
|
+
isFilled: z102.boolean().optional().default(false),
|
|
2405
|
+
fillColor: z102.string().optional(),
|
|
2406
|
+
isDashed: z102.boolean().optional().default(false),
|
|
2391
2407
|
cornerRadius: distance32.optional()
|
|
2392
2408
|
});
|
|
2393
2409
|
expectTypesMatch(true);
|
|
2394
2410
|
|
|
2395
2411
|
// lib/components/schematic-line.ts
|
|
2396
2412
|
import { distance as distance33 } from "circuit-json";
|
|
2397
|
-
import { z as
|
|
2398
|
-
var schematicLineProps =
|
|
2413
|
+
import { z as z103 } from "zod";
|
|
2414
|
+
var schematicLineProps = z103.object({
|
|
2399
2415
|
x1: distance33,
|
|
2400
2416
|
y1: distance33,
|
|
2401
2417
|
x2: distance33,
|
|
2402
2418
|
y2: distance33,
|
|
2403
2419
|
strokeWidth: distance33.optional(),
|
|
2404
|
-
color:
|
|
2405
|
-
isDashed:
|
|
2420
|
+
color: z103.string().optional(),
|
|
2421
|
+
isDashed: z103.boolean().optional().default(false)
|
|
2406
2422
|
});
|
|
2407
2423
|
expectTypesMatch(true);
|
|
2408
2424
|
|
|
2409
2425
|
// lib/components/schematic-text.ts
|
|
2410
2426
|
import { distance as distance34, rotation as rotation9 } from "circuit-json";
|
|
2411
|
-
import { z as
|
|
2427
|
+
import { z as z105 } from "zod";
|
|
2412
2428
|
|
|
2413
2429
|
// lib/common/fivePointAnchor.ts
|
|
2414
|
-
import { z as
|
|
2415
|
-
var fivePointAnchor =
|
|
2430
|
+
import { z as z104 } from "zod";
|
|
2431
|
+
var fivePointAnchor = z104.enum([
|
|
2416
2432
|
"center",
|
|
2417
2433
|
"left",
|
|
2418
2434
|
"right",
|
|
@@ -2421,37 +2437,37 @@ var fivePointAnchor = z103.enum([
|
|
|
2421
2437
|
]);
|
|
2422
2438
|
|
|
2423
2439
|
// lib/components/schematic-text.ts
|
|
2424
|
-
var schematicTextProps =
|
|
2440
|
+
var schematicTextProps = z105.object({
|
|
2425
2441
|
schX: distance34.optional(),
|
|
2426
2442
|
schY: distance34.optional(),
|
|
2427
|
-
text:
|
|
2428
|
-
fontSize:
|
|
2429
|
-
anchor:
|
|
2430
|
-
color:
|
|
2443
|
+
text: z105.string(),
|
|
2444
|
+
fontSize: z105.number().default(1),
|
|
2445
|
+
anchor: z105.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2446
|
+
color: z105.string().default("#000000"),
|
|
2431
2447
|
schRotation: rotation9.default(0)
|
|
2432
2448
|
});
|
|
2433
2449
|
expectTypesMatch(true);
|
|
2434
2450
|
|
|
2435
2451
|
// lib/components/schematic-path.ts
|
|
2436
2452
|
import { distance as distance35, point as point8 } from "circuit-json";
|
|
2437
|
-
import { z as
|
|
2438
|
-
var schematicPathProps =
|
|
2439
|
-
points:
|
|
2440
|
-
svgPath:
|
|
2453
|
+
import { z as z106 } from "zod";
|
|
2454
|
+
var schematicPathProps = z106.object({
|
|
2455
|
+
points: z106.array(point8).optional(),
|
|
2456
|
+
svgPath: z106.string().optional(),
|
|
2441
2457
|
strokeWidth: distance35.optional(),
|
|
2442
|
-
strokeColor:
|
|
2443
|
-
isFilled:
|
|
2444
|
-
fillColor:
|
|
2458
|
+
strokeColor: z106.string().optional(),
|
|
2459
|
+
isFilled: z106.boolean().optional().default(false),
|
|
2460
|
+
fillColor: z106.string().optional()
|
|
2445
2461
|
});
|
|
2446
2462
|
expectTypesMatch(true);
|
|
2447
2463
|
|
|
2448
2464
|
// lib/components/schematic-table.ts
|
|
2449
2465
|
import { distance as distance36 } from "circuit-json";
|
|
2450
|
-
import { z as
|
|
2451
|
-
var schematicTableProps =
|
|
2466
|
+
import { z as z107 } from "zod";
|
|
2467
|
+
var schematicTableProps = z107.object({
|
|
2452
2468
|
schX: distance36.optional(),
|
|
2453
2469
|
schY: distance36.optional(),
|
|
2454
|
-
children:
|
|
2470
|
+
children: z107.any().optional(),
|
|
2455
2471
|
cellPadding: distance36.optional(),
|
|
2456
2472
|
borderWidth: distance36.optional(),
|
|
2457
2473
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2461,64 +2477,64 @@ expectTypesMatch(true);
|
|
|
2461
2477
|
|
|
2462
2478
|
// lib/components/schematic-row.ts
|
|
2463
2479
|
import { distance as distance37 } from "circuit-json";
|
|
2464
|
-
import { z as
|
|
2465
|
-
var schematicRowProps =
|
|
2466
|
-
children:
|
|
2480
|
+
import { z as z108 } from "zod";
|
|
2481
|
+
var schematicRowProps = z108.object({
|
|
2482
|
+
children: z108.any().optional(),
|
|
2467
2483
|
height: distance37.optional()
|
|
2468
2484
|
});
|
|
2469
2485
|
expectTypesMatch(true);
|
|
2470
2486
|
|
|
2471
2487
|
// lib/components/schematic-cell.ts
|
|
2472
2488
|
import { distance as distance38 } from "circuit-json";
|
|
2473
|
-
import { z as
|
|
2474
|
-
var schematicCellProps =
|
|
2475
|
-
children:
|
|
2476
|
-
horizontalAlign:
|
|
2477
|
-
verticalAlign:
|
|
2489
|
+
import { z as z109 } from "zod";
|
|
2490
|
+
var schematicCellProps = z109.object({
|
|
2491
|
+
children: z109.string().optional(),
|
|
2492
|
+
horizontalAlign: z109.enum(["left", "center", "right"]).optional(),
|
|
2493
|
+
verticalAlign: z109.enum(["top", "middle", "bottom"]).optional(),
|
|
2478
2494
|
fontSize: distance38.optional(),
|
|
2479
|
-
rowSpan:
|
|
2480
|
-
colSpan:
|
|
2495
|
+
rowSpan: z109.number().optional(),
|
|
2496
|
+
colSpan: z109.number().optional(),
|
|
2481
2497
|
width: distance38.optional(),
|
|
2482
|
-
text:
|
|
2498
|
+
text: z109.string().optional()
|
|
2483
2499
|
});
|
|
2484
2500
|
expectTypesMatch(true);
|
|
2485
2501
|
|
|
2486
2502
|
// lib/components/copper-text.ts
|
|
2487
|
-
import { layer_ref as layer_ref9, length as
|
|
2488
|
-
import { z as
|
|
2503
|
+
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2504
|
+
import { z as z110 } from "zod";
|
|
2489
2505
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2490
|
-
text:
|
|
2506
|
+
text: z110.string(),
|
|
2491
2507
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2492
|
-
font:
|
|
2493
|
-
fontSize:
|
|
2494
|
-
layers:
|
|
2495
|
-
knockout:
|
|
2496
|
-
mirrored:
|
|
2508
|
+
font: z110.enum(["tscircuit2024"]).optional(),
|
|
2509
|
+
fontSize: length8.optional(),
|
|
2510
|
+
layers: z110.array(layer_ref9).optional(),
|
|
2511
|
+
knockout: z110.boolean().optional(),
|
|
2512
|
+
mirrored: z110.boolean().optional()
|
|
2497
2513
|
});
|
|
2498
2514
|
|
|
2499
2515
|
// lib/components/silkscreen-text.ts
|
|
2500
|
-
import { layer_ref as layer_ref10, length as
|
|
2501
|
-
import { z as
|
|
2516
|
+
import { layer_ref as layer_ref10, length as length9 } from "circuit-json";
|
|
2517
|
+
import { z as z111 } from "zod";
|
|
2502
2518
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2503
|
-
text:
|
|
2519
|
+
text: z111.string(),
|
|
2504
2520
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2505
|
-
font:
|
|
2506
|
-
fontSize:
|
|
2521
|
+
font: z111.enum(["tscircuit2024"]).optional(),
|
|
2522
|
+
fontSize: length9.optional(),
|
|
2507
2523
|
/**
|
|
2508
2524
|
* If true, text will knock out underlying silkscreen
|
|
2509
2525
|
*/
|
|
2510
|
-
isKnockout:
|
|
2511
|
-
knockoutPadding:
|
|
2512
|
-
knockoutPaddingLeft:
|
|
2513
|
-
knockoutPaddingRight:
|
|
2514
|
-
knockoutPaddingTop:
|
|
2515
|
-
knockoutPaddingBottom:
|
|
2516
|
-
layers:
|
|
2526
|
+
isKnockout: z111.boolean().optional(),
|
|
2527
|
+
knockoutPadding: length9.optional(),
|
|
2528
|
+
knockoutPaddingLeft: length9.optional(),
|
|
2529
|
+
knockoutPaddingRight: length9.optional(),
|
|
2530
|
+
knockoutPaddingTop: length9.optional(),
|
|
2531
|
+
knockoutPaddingBottom: length9.optional(),
|
|
2532
|
+
layers: z111.array(layer_ref10).optional()
|
|
2517
2533
|
});
|
|
2518
2534
|
|
|
2519
2535
|
// lib/components/silkscreen-path.ts
|
|
2520
|
-
import { length as
|
|
2521
|
-
import { z as
|
|
2536
|
+
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2537
|
+
import { z as z112 } from "zod";
|
|
2522
2538
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2523
2539
|
pcbLeftEdgeX: true,
|
|
2524
2540
|
pcbRightEdgeX: true,
|
|
@@ -2530,8 +2546,8 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2530
2546
|
pcbOffsetY: true,
|
|
2531
2547
|
pcbRotation: true
|
|
2532
2548
|
}).extend({
|
|
2533
|
-
route:
|
|
2534
|
-
strokeWidth:
|
|
2549
|
+
route: z112.array(route_hint_point5),
|
|
2550
|
+
strokeWidth: length10.optional()
|
|
2535
2551
|
});
|
|
2536
2552
|
|
|
2537
2553
|
// lib/components/silkscreen-line.ts
|
|
@@ -2552,10 +2568,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2552
2568
|
|
|
2553
2569
|
// lib/components/silkscreen-rect.ts
|
|
2554
2570
|
import { distance as distance40 } from "circuit-json";
|
|
2555
|
-
import { z as
|
|
2571
|
+
import { z as z113 } from "zod";
|
|
2556
2572
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2557
|
-
filled:
|
|
2558
|
-
stroke:
|
|
2573
|
+
filled: z113.boolean().default(true).optional(),
|
|
2574
|
+
stroke: z113.enum(["dashed", "solid", "none"]).optional(),
|
|
2559
2575
|
strokeWidth: distance40.optional(),
|
|
2560
2576
|
width: distance40,
|
|
2561
2577
|
height: distance40,
|
|
@@ -2564,77 +2580,77 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2564
2580
|
|
|
2565
2581
|
// lib/components/silkscreen-circle.ts
|
|
2566
2582
|
import { distance as distance41 } from "circuit-json";
|
|
2567
|
-
import { z as
|
|
2583
|
+
import { z as z114 } from "zod";
|
|
2568
2584
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2569
|
-
isFilled:
|
|
2570
|
-
isOutline:
|
|
2585
|
+
isFilled: z114.boolean().optional(),
|
|
2586
|
+
isOutline: z114.boolean().optional(),
|
|
2571
2587
|
strokeWidth: distance41.optional(),
|
|
2572
2588
|
radius: distance41
|
|
2573
2589
|
});
|
|
2574
2590
|
|
|
2575
2591
|
// lib/components/trace-hint.ts
|
|
2576
2592
|
import { distance as distance42, layer_ref as layer_ref11, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2577
|
-
import { z as
|
|
2578
|
-
var routeHintPointProps =
|
|
2593
|
+
import { z as z115 } from "zod";
|
|
2594
|
+
var routeHintPointProps = z115.object({
|
|
2579
2595
|
x: distance42,
|
|
2580
2596
|
y: distance42,
|
|
2581
|
-
via:
|
|
2597
|
+
via: z115.boolean().optional(),
|
|
2582
2598
|
toLayer: layer_ref11.optional()
|
|
2583
2599
|
});
|
|
2584
|
-
var traceHintProps =
|
|
2585
|
-
for:
|
|
2600
|
+
var traceHintProps = z115.object({
|
|
2601
|
+
for: z115.string().optional().describe(
|
|
2586
2602
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2587
2603
|
),
|
|
2588
|
-
order:
|
|
2604
|
+
order: z115.number().optional(),
|
|
2589
2605
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2590
|
-
offsets:
|
|
2591
|
-
traceWidth:
|
|
2606
|
+
offsets: z115.array(route_hint_point6).or(z115.array(routeHintPointProps)).optional(),
|
|
2607
|
+
traceWidth: z115.number().optional()
|
|
2592
2608
|
});
|
|
2593
2609
|
|
|
2594
2610
|
// lib/components/port.ts
|
|
2595
|
-
import { z as
|
|
2611
|
+
import { z as z116 } from "zod";
|
|
2596
2612
|
var portProps = commonLayoutProps.extend({
|
|
2597
|
-
name:
|
|
2598
|
-
pinNumber:
|
|
2599
|
-
aliases:
|
|
2613
|
+
name: z116.string(),
|
|
2614
|
+
pinNumber: z116.number().optional(),
|
|
2615
|
+
aliases: z116.array(z116.string()).optional(),
|
|
2600
2616
|
direction,
|
|
2601
|
-
connectsTo:
|
|
2617
|
+
connectsTo: z116.string().or(z116.array(z116.string())).optional(),
|
|
2602
2618
|
kicadPinMetadata: kicadPinMetadata.optional()
|
|
2603
2619
|
});
|
|
2604
2620
|
|
|
2605
2621
|
// lib/components/pcb-note-text.ts
|
|
2606
|
-
import { length as
|
|
2607
|
-
import { z as
|
|
2622
|
+
import { length as length11 } from "circuit-json";
|
|
2623
|
+
import { z as z117 } from "zod";
|
|
2608
2624
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2609
|
-
text:
|
|
2610
|
-
anchorAlignment:
|
|
2611
|
-
font:
|
|
2612
|
-
fontSize:
|
|
2613
|
-
color:
|
|
2625
|
+
text: z117.string(),
|
|
2626
|
+
anchorAlignment: z117.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2627
|
+
font: z117.enum(["tscircuit2024"]).optional(),
|
|
2628
|
+
fontSize: length11.optional(),
|
|
2629
|
+
color: z117.string().optional()
|
|
2614
2630
|
});
|
|
2615
2631
|
expectTypesMatch(true);
|
|
2616
2632
|
|
|
2617
2633
|
// lib/components/pcb-note-rect.ts
|
|
2618
2634
|
import { distance as distance43 } from "circuit-json";
|
|
2619
|
-
import { z as
|
|
2635
|
+
import { z as z118 } from "zod";
|
|
2620
2636
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2621
2637
|
width: distance43,
|
|
2622
2638
|
height: distance43,
|
|
2623
2639
|
strokeWidth: distance43.optional(),
|
|
2624
|
-
isFilled:
|
|
2625
|
-
hasStroke:
|
|
2626
|
-
isStrokeDashed:
|
|
2627
|
-
color:
|
|
2640
|
+
isFilled: z118.boolean().optional(),
|
|
2641
|
+
hasStroke: z118.boolean().optional(),
|
|
2642
|
+
isStrokeDashed: z118.boolean().optional(),
|
|
2643
|
+
color: z118.string().optional(),
|
|
2628
2644
|
cornerRadius: distance43.optional()
|
|
2629
2645
|
});
|
|
2630
2646
|
expectTypesMatch(true);
|
|
2631
2647
|
|
|
2632
2648
|
// lib/components/pcb-note-path.ts
|
|
2633
2649
|
import {
|
|
2634
|
-
length as
|
|
2650
|
+
length as length12,
|
|
2635
2651
|
route_hint_point as route_hint_point7
|
|
2636
2652
|
} from "circuit-json";
|
|
2637
|
-
import { z as
|
|
2653
|
+
import { z as z119 } from "zod";
|
|
2638
2654
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2639
2655
|
pcbLeftEdgeX: true,
|
|
2640
2656
|
pcbRightEdgeX: true,
|
|
@@ -2646,15 +2662,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2646
2662
|
pcbOffsetY: true,
|
|
2647
2663
|
pcbRotation: true
|
|
2648
2664
|
}).extend({
|
|
2649
|
-
route:
|
|
2650
|
-
strokeWidth:
|
|
2651
|
-
color:
|
|
2665
|
+
route: z119.array(route_hint_point7),
|
|
2666
|
+
strokeWidth: length12.optional(),
|
|
2667
|
+
color: z119.string().optional()
|
|
2652
2668
|
});
|
|
2653
2669
|
expectTypesMatch(true);
|
|
2654
2670
|
|
|
2655
2671
|
// lib/components/pcb-note-line.ts
|
|
2656
2672
|
import { distance as distance44 } from "circuit-json";
|
|
2657
|
-
import { z as
|
|
2673
|
+
import { z as z120 } from "zod";
|
|
2658
2674
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2659
2675
|
pcbLeftEdgeX: true,
|
|
2660
2676
|
pcbRightEdgeX: true,
|
|
@@ -2671,15 +2687,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2671
2687
|
x2: distance44,
|
|
2672
2688
|
y2: distance44,
|
|
2673
2689
|
strokeWidth: distance44.optional(),
|
|
2674
|
-
color:
|
|
2675
|
-
isDashed:
|
|
2690
|
+
color: z120.string().optional(),
|
|
2691
|
+
isDashed: z120.boolean().optional()
|
|
2676
2692
|
});
|
|
2677
2693
|
expectTypesMatch(true);
|
|
2678
2694
|
|
|
2679
2695
|
// lib/components/pcb-note-dimension.ts
|
|
2680
|
-
import { distance as distance45, length as
|
|
2681
|
-
import { z as
|
|
2682
|
-
var dimensionTarget2 =
|
|
2696
|
+
import { distance as distance45, length as length13 } from "circuit-json";
|
|
2697
|
+
import { z as z121 } from "zod";
|
|
2698
|
+
var dimensionTarget2 = z121.union([z121.string(), point]);
|
|
2683
2699
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2684
2700
|
pcbLeftEdgeX: true,
|
|
2685
2701
|
pcbRightEdgeX: true,
|
|
@@ -2693,94 +2709,94 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2693
2709
|
}).extend({
|
|
2694
2710
|
from: dimensionTarget2,
|
|
2695
2711
|
to: dimensionTarget2,
|
|
2696
|
-
text:
|
|
2712
|
+
text: z121.string().optional(),
|
|
2697
2713
|
offset: distance45.optional(),
|
|
2698
|
-
font:
|
|
2699
|
-
fontSize:
|
|
2700
|
-
color:
|
|
2714
|
+
font: z121.enum(["tscircuit2024"]).optional(),
|
|
2715
|
+
fontSize: length13.optional(),
|
|
2716
|
+
color: z121.string().optional(),
|
|
2701
2717
|
arrowSize: distance45.optional(),
|
|
2702
|
-
units:
|
|
2703
|
-
outerEdgeToEdge:
|
|
2704
|
-
centerToCenter:
|
|
2705
|
-
innerEdgeToEdge:
|
|
2718
|
+
units: z121.enum(["in", "mm"]).optional(),
|
|
2719
|
+
outerEdgeToEdge: z121.literal(true).optional(),
|
|
2720
|
+
centerToCenter: z121.literal(true).optional(),
|
|
2721
|
+
innerEdgeToEdge: z121.literal(true).optional()
|
|
2706
2722
|
});
|
|
2707
2723
|
expectTypesMatch(
|
|
2708
2724
|
true
|
|
2709
2725
|
);
|
|
2710
2726
|
|
|
2711
2727
|
// lib/platformConfig.ts
|
|
2712
|
-
import { z as
|
|
2713
|
-
var unvalidatedCircuitJson =
|
|
2714
|
-
var footprintLibraryResult =
|
|
2715
|
-
footprintCircuitJson:
|
|
2728
|
+
import { z as z122 } from "zod";
|
|
2729
|
+
var unvalidatedCircuitJson = z122.array(z122.any()).describe("Circuit JSON");
|
|
2730
|
+
var footprintLibraryResult = z122.object({
|
|
2731
|
+
footprintCircuitJson: z122.array(z122.any()),
|
|
2716
2732
|
cadModel: cadModelProp.optional()
|
|
2717
2733
|
});
|
|
2718
|
-
var pathToCircuitJsonFn =
|
|
2719
|
-
|
|
2720
|
-
|
|
2721
|
-
|
|
2722
|
-
).returns(
|
|
2734
|
+
var pathToCircuitJsonFn = z122.function().args(z122.string()).returns(z122.promise(footprintLibraryResult)).or(
|
|
2735
|
+
z122.function().args(
|
|
2736
|
+
z122.string(),
|
|
2737
|
+
z122.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2738
|
+
).returns(z122.promise(footprintLibraryResult))
|
|
2723
2739
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2724
|
-
var footprintFileParserEntry =
|
|
2725
|
-
loadFromUrl:
|
|
2740
|
+
var footprintFileParserEntry = z122.object({
|
|
2741
|
+
loadFromUrl: z122.function().args(z122.string()).returns(z122.promise(footprintLibraryResult)).describe(
|
|
2726
2742
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2727
2743
|
)
|
|
2728
2744
|
});
|
|
2729
|
-
var spiceEngineSimulationResult =
|
|
2730
|
-
engineVersionString:
|
|
2745
|
+
var spiceEngineSimulationResult = z122.object({
|
|
2746
|
+
engineVersionString: z122.string().optional(),
|
|
2731
2747
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2732
2748
|
});
|
|
2733
|
-
var spiceEngineZod =
|
|
2734
|
-
simulate:
|
|
2749
|
+
var spiceEngineZod = z122.object({
|
|
2750
|
+
simulate: z122.function().args(z122.string()).returns(z122.promise(spiceEngineSimulationResult)).describe(
|
|
2735
2751
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2736
2752
|
)
|
|
2737
2753
|
});
|
|
2738
|
-
var defaultSpiceEngine =
|
|
2754
|
+
var defaultSpiceEngine = z122.custom(
|
|
2739
2755
|
(value) => typeof value === "string"
|
|
2740
2756
|
);
|
|
2741
|
-
var autorouterInstance =
|
|
2742
|
-
run:
|
|
2743
|
-
getOutputSimpleRouteJson:
|
|
2757
|
+
var autorouterInstance = z122.object({
|
|
2758
|
+
run: z122.function().args().returns(z122.promise(z122.unknown())).describe("Run the autorouter"),
|
|
2759
|
+
getOutputSimpleRouteJson: z122.function().args().returns(z122.promise(z122.any())).describe("Get the resulting SimpleRouteJson")
|
|
2744
2760
|
});
|
|
2745
|
-
var autorouterDefinition =
|
|
2746
|
-
createAutorouter:
|
|
2761
|
+
var autorouterDefinition = z122.object({
|
|
2762
|
+
createAutorouter: z122.function().args(z122.any(), z122.any().optional()).returns(z122.union([autorouterInstance, z122.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2747
2763
|
});
|
|
2748
|
-
var platformFetch =
|
|
2749
|
-
var platformConfig =
|
|
2764
|
+
var platformFetch = z122.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
2765
|
+
var platformConfig = z122.object({
|
|
2750
2766
|
partsEngine: partsEngine.optional(),
|
|
2751
2767
|
autorouter: autorouterProp.optional(),
|
|
2752
|
-
autorouterMap:
|
|
2768
|
+
autorouterMap: z122.record(z122.string(), autorouterDefinition).optional(),
|
|
2753
2769
|
registryApiUrl: url.optional(),
|
|
2754
2770
|
cloudAutorouterUrl: url.optional(),
|
|
2755
|
-
projectName:
|
|
2771
|
+
projectName: z122.string().optional(),
|
|
2756
2772
|
projectBaseUrl: url.optional(),
|
|
2757
|
-
version:
|
|
2773
|
+
version: z122.string().optional(),
|
|
2758
2774
|
url: url.optional(),
|
|
2759
|
-
printBoardInformationToSilkscreen:
|
|
2760
|
-
includeBoardFiles:
|
|
2775
|
+
printBoardInformationToSilkscreen: z122.boolean().optional(),
|
|
2776
|
+
includeBoardFiles: z122.array(z122.string()).describe(
|
|
2761
2777
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2762
2778
|
).optional(),
|
|
2763
|
-
snapshotsDir:
|
|
2779
|
+
snapshotsDir: z122.string().describe(
|
|
2764
2780
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2765
2781
|
).optional(),
|
|
2766
2782
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2767
|
-
localCacheEngine:
|
|
2768
|
-
pcbDisabled:
|
|
2769
|
-
schematicDisabled:
|
|
2770
|
-
partsEngineDisabled:
|
|
2771
|
-
spiceEngineMap:
|
|
2772
|
-
footprintLibraryMap:
|
|
2773
|
-
|
|
2774
|
-
|
|
2783
|
+
localCacheEngine: z122.any().optional(),
|
|
2784
|
+
pcbDisabled: z122.boolean().optional(),
|
|
2785
|
+
schematicDisabled: z122.boolean().optional(),
|
|
2786
|
+
partsEngineDisabled: z122.boolean().optional(),
|
|
2787
|
+
spiceEngineMap: z122.record(z122.string(), spiceEngineZod).optional(),
|
|
2788
|
+
footprintLibraryMap: z122.record(
|
|
2789
|
+
z122.string(),
|
|
2790
|
+
z122.union([
|
|
2775
2791
|
pathToCircuitJsonFn,
|
|
2776
|
-
|
|
2777
|
-
|
|
2778
|
-
|
|
2792
|
+
z122.record(
|
|
2793
|
+
z122.string(),
|
|
2794
|
+
z122.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2779
2795
|
)
|
|
2780
2796
|
])
|
|
2781
2797
|
).optional(),
|
|
2782
|
-
footprintFileParserMap:
|
|
2783
|
-
resolveProjectStaticFileImportUrl:
|
|
2798
|
+
footprintFileParserMap: z122.record(z122.string(), footprintFileParserEntry).optional(),
|
|
2799
|
+
resolveProjectStaticFileImportUrl: z122.function().args(z122.string()).returns(z122.promise(z122.string())).describe(
|
|
2784
2800
|
"A function that returns a string URL for static files for the project"
|
|
2785
2801
|
).optional(),
|
|
2786
2802
|
platformFetch: platformFetch.optional()
|
|
@@ -2930,6 +2946,8 @@ export {
|
|
|
2930
2946
|
pcbSameXConstraintProps,
|
|
2931
2947
|
pcbSameYConstraintProps,
|
|
2932
2948
|
pcbStyle,
|
|
2949
|
+
pcbSx,
|
|
2950
|
+
pcbSxValue,
|
|
2933
2951
|
pcbTraceProps,
|
|
2934
2952
|
pcbXDistConstraintProps,
|
|
2935
2953
|
pcbYDistConstraintProps,
|