@tscircuit/props 0.0.210 → 0.0.211
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +30 -0
- package/dist/index.d.ts +692 -7
- package/dist/index.js +408 -387
- package/dist/index.js.map +1 -1
- package/lib/components/breakout.ts +25 -0
- package/lib/components/breakoutpoint.ts +17 -0
- package/lib/index.ts +2 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -398,59 +398,54 @@ var boardProps = subcircuitGroupProps.extend({
|
|
|
398
398
|
});
|
|
399
399
|
expectTypesMatch(true);
|
|
400
400
|
|
|
401
|
+
// lib/components/breakout.ts
|
|
402
|
+
import { distance as distance6 } from "circuit-json";
|
|
403
|
+
import "zod";
|
|
404
|
+
var breakoutProps = subcircuitGroupProps.extend({
|
|
405
|
+
padding: distance6.optional(),
|
|
406
|
+
paddingLeft: distance6.optional(),
|
|
407
|
+
paddingRight: distance6.optional(),
|
|
408
|
+
paddingTop: distance6.optional(),
|
|
409
|
+
paddingBottom: distance6.optional()
|
|
410
|
+
});
|
|
411
|
+
expectTypesMatch(true);
|
|
412
|
+
|
|
401
413
|
// lib/components/chip.ts
|
|
402
|
-
import { distance as
|
|
403
|
-
import { z as
|
|
404
|
-
var connectionTarget =
|
|
405
|
-
var connectionsProp =
|
|
406
|
-
var pinLabelsProp =
|
|
407
|
-
|
|
408
|
-
|
|
414
|
+
import { distance as distance7, supplier_name as supplier_name2 } from "circuit-json";
|
|
415
|
+
import { z as z24 } from "zod";
|
|
416
|
+
var connectionTarget = z24.string().or(z24.array(z24.string()).readonly()).or(z24.array(z24.string()));
|
|
417
|
+
var connectionsProp = z24.custom().pipe(z24.record(z24.string(), connectionTarget));
|
|
418
|
+
var pinLabelsProp = z24.record(
|
|
419
|
+
z24.string(),
|
|
420
|
+
z24.string().or(z24.array(z24.string()).readonly()).or(z24.array(z24.string()))
|
|
409
421
|
);
|
|
410
422
|
expectTypesMatch(true);
|
|
411
|
-
var pinCompatibleVariant =
|
|
412
|
-
manufacturerPartNumber:
|
|
413
|
-
supplierPartNumber:
|
|
423
|
+
var pinCompatibleVariant = z24.object({
|
|
424
|
+
manufacturerPartNumber: z24.string().optional(),
|
|
425
|
+
supplierPartNumber: z24.record(supplier_name2, z24.array(z24.string())).optional()
|
|
414
426
|
});
|
|
415
427
|
var chipProps = commonComponentProps.extend({
|
|
416
|
-
manufacturerPartNumber:
|
|
428
|
+
manufacturerPartNumber: z24.string().optional(),
|
|
417
429
|
pinLabels: pinLabelsProp.optional(),
|
|
418
|
-
internallyConnectedPins:
|
|
419
|
-
externallyConnectedPins:
|
|
430
|
+
internallyConnectedPins: z24.array(z24.array(z24.string())).optional(),
|
|
431
|
+
externallyConnectedPins: z24.array(z24.array(z24.string())).optional(),
|
|
420
432
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
421
433
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
422
|
-
pinCompatibleVariants:
|
|
423
|
-
schPinStyle: schematicPinStyle.optional(),
|
|
424
|
-
schPinSpacing: distance6.optional(),
|
|
425
|
-
schWidth: distance6.optional(),
|
|
426
|
-
schHeight: distance6.optional(),
|
|
427
|
-
noSchematicRepresentation: z23.boolean().optional(),
|
|
428
|
-
connections: connectionsProp.optional()
|
|
429
|
-
});
|
|
430
|
-
var bugProps = chipProps;
|
|
431
|
-
expectTypesMatch(true);
|
|
432
|
-
|
|
433
|
-
// lib/components/jumper.ts
|
|
434
|
-
import { distance as distance7 } from "circuit-json";
|
|
435
|
-
import { z as z24 } from "zod";
|
|
436
|
-
var jumperProps = commonComponentProps.extend({
|
|
437
|
-
manufacturerPartNumber: z24.string().optional(),
|
|
438
|
-
pinLabels: z24.record(z24.number().or(z24.string()), z24.string().or(z24.array(z24.string()))).optional(),
|
|
434
|
+
pinCompatibleVariants: z24.array(pinCompatibleVariant).optional(),
|
|
439
435
|
schPinStyle: schematicPinStyle.optional(),
|
|
440
436
|
schPinSpacing: distance7.optional(),
|
|
441
437
|
schWidth: distance7.optional(),
|
|
442
438
|
schHeight: distance7.optional(),
|
|
443
|
-
|
|
444
|
-
|
|
445
|
-
pinCount: z24.union([z24.literal(2), z24.literal(3)]).optional(),
|
|
446
|
-
internallyConnectedPins: z24.array(z24.array(z24.string())).optional()
|
|
439
|
+
noSchematicRepresentation: z24.boolean().optional(),
|
|
440
|
+
connections: connectionsProp.optional()
|
|
447
441
|
});
|
|
442
|
+
var bugProps = chipProps;
|
|
448
443
|
expectTypesMatch(true);
|
|
449
444
|
|
|
450
|
-
// lib/components/
|
|
445
|
+
// lib/components/jumper.ts
|
|
451
446
|
import { distance as distance8 } from "circuit-json";
|
|
452
447
|
import { z as z25 } from "zod";
|
|
453
|
-
var
|
|
448
|
+
var jumperProps = commonComponentProps.extend({
|
|
454
449
|
manufacturerPartNumber: z25.string().optional(),
|
|
455
450
|
pinLabels: z25.record(z25.number().or(z25.string()), z25.string().or(z25.array(z25.string()))).optional(),
|
|
456
451
|
schPinStyle: schematicPinStyle.optional(),
|
|
@@ -459,74 +454,91 @@ var connectorProps = commonComponentProps.extend({
|
|
|
459
454
|
schHeight: distance8.optional(),
|
|
460
455
|
schDirection: z25.enum(["left", "right"]).optional(),
|
|
461
456
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
462
|
-
|
|
463
|
-
|
|
457
|
+
pinCount: z25.union([z25.literal(2), z25.literal(3)]).optional(),
|
|
458
|
+
internallyConnectedPins: z25.array(z25.array(z25.string())).optional()
|
|
464
459
|
});
|
|
465
460
|
expectTypesMatch(true);
|
|
466
461
|
|
|
467
|
-
// lib/components/
|
|
462
|
+
// lib/components/connector.ts
|
|
463
|
+
import { distance as distance9 } from "circuit-json";
|
|
468
464
|
import { z as z26 } from "zod";
|
|
465
|
+
var connectorProps = commonComponentProps.extend({
|
|
466
|
+
manufacturerPartNumber: z26.string().optional(),
|
|
467
|
+
pinLabels: z26.record(z26.number().or(z26.string()), z26.string().or(z26.array(z26.string()))).optional(),
|
|
468
|
+
schPinStyle: schematicPinStyle.optional(),
|
|
469
|
+
schPinSpacing: distance9.optional(),
|
|
470
|
+
schWidth: distance9.optional(),
|
|
471
|
+
schHeight: distance9.optional(),
|
|
472
|
+
schDirection: z26.enum(["left", "right"]).optional(),
|
|
473
|
+
schPortArrangement: schematicPortArrangement.optional(),
|
|
474
|
+
internallyConnectedPins: z26.array(z26.array(z26.string())).optional(),
|
|
475
|
+
standard: z26.enum(["usb_c", "m2"]).optional()
|
|
476
|
+
});
|
|
477
|
+
expectTypesMatch(true);
|
|
478
|
+
|
|
479
|
+
// lib/components/fuse.ts
|
|
480
|
+
import { z as z27 } from "zod";
|
|
469
481
|
var fusePinLabels = ["pin1", "pin2"];
|
|
470
482
|
var fuseProps = commonComponentProps.extend({
|
|
471
|
-
currentRating:
|
|
472
|
-
voltageRating:
|
|
473
|
-
schShowRatings:
|
|
474
|
-
connections:
|
|
475
|
-
|
|
476
|
-
|
|
477
|
-
|
|
478
|
-
|
|
479
|
-
|
|
483
|
+
currentRating: z27.union([z27.number(), z27.string()]),
|
|
484
|
+
voltageRating: z27.union([z27.number(), z27.string()]).optional(),
|
|
485
|
+
schShowRatings: z27.boolean().optional(),
|
|
486
|
+
connections: z27.record(
|
|
487
|
+
z27.string(),
|
|
488
|
+
z27.union([
|
|
489
|
+
z27.string(),
|
|
490
|
+
z27.array(z27.string()).readonly(),
|
|
491
|
+
z27.array(z27.string())
|
|
480
492
|
])
|
|
481
493
|
).optional()
|
|
482
494
|
});
|
|
483
495
|
|
|
484
496
|
// lib/components/platedhole.ts
|
|
485
|
-
import { distance as
|
|
486
|
-
import { z as
|
|
487
|
-
var distanceHiddenUndefined =
|
|
497
|
+
import { distance as distance10 } from "circuit-json";
|
|
498
|
+
import { z as z28 } from "zod";
|
|
499
|
+
var distanceHiddenUndefined = z28.custom().transform((a) => {
|
|
488
500
|
if (a === void 0)
|
|
489
501
|
return void 0;
|
|
490
|
-
return
|
|
502
|
+
return distance10.parse(a);
|
|
491
503
|
});
|
|
492
|
-
var platedHoleProps =
|
|
504
|
+
var platedHoleProps = z28.union([
|
|
493
505
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
494
|
-
name:
|
|
495
|
-
shape:
|
|
496
|
-
holeDiameter:
|
|
497
|
-
outerDiameter:
|
|
506
|
+
name: z28.string().optional(),
|
|
507
|
+
shape: z28.literal("circle"),
|
|
508
|
+
holeDiameter: distance10,
|
|
509
|
+
outerDiameter: distance10,
|
|
498
510
|
portHints: portHints.optional()
|
|
499
511
|
}),
|
|
500
512
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
501
|
-
name:
|
|
502
|
-
shape:
|
|
503
|
-
outerWidth:
|
|
504
|
-
outerHeight:
|
|
513
|
+
name: z28.string().optional(),
|
|
514
|
+
shape: z28.literal("oval"),
|
|
515
|
+
outerWidth: distance10,
|
|
516
|
+
outerHeight: distance10,
|
|
505
517
|
holeWidth: distanceHiddenUndefined,
|
|
506
518
|
holeHeight: distanceHiddenUndefined,
|
|
507
|
-
innerWidth:
|
|
508
|
-
innerHeight:
|
|
519
|
+
innerWidth: distance10.optional().describe("DEPRECATED use holeWidth"),
|
|
520
|
+
innerHeight: distance10.optional().describe("DEPRECATED use holeHeight"),
|
|
509
521
|
portHints: portHints.optional()
|
|
510
522
|
}),
|
|
511
523
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
512
|
-
name:
|
|
513
|
-
shape:
|
|
514
|
-
outerWidth:
|
|
515
|
-
outerHeight:
|
|
524
|
+
name: z28.string().optional(),
|
|
525
|
+
shape: z28.literal("pill"),
|
|
526
|
+
outerWidth: distance10,
|
|
527
|
+
outerHeight: distance10,
|
|
516
528
|
holeWidth: distanceHiddenUndefined,
|
|
517
529
|
holeHeight: distanceHiddenUndefined,
|
|
518
|
-
innerWidth:
|
|
519
|
-
innerHeight:
|
|
530
|
+
innerWidth: distance10.optional().describe("DEPRECATED use holeWidth"),
|
|
531
|
+
innerHeight: distance10.optional().describe("DEPRECATED use holeHeight"),
|
|
520
532
|
portHints: portHints.optional()
|
|
521
533
|
}),
|
|
522
534
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
523
|
-
name:
|
|
524
|
-
holeDiameter:
|
|
525
|
-
rectPadWidth:
|
|
526
|
-
rectPadHeight:
|
|
527
|
-
holeShape:
|
|
528
|
-
padShape:
|
|
529
|
-
shape:
|
|
535
|
+
name: z28.string().optional(),
|
|
536
|
+
holeDiameter: distance10,
|
|
537
|
+
rectPadWidth: distance10,
|
|
538
|
+
rectPadHeight: distance10,
|
|
539
|
+
holeShape: z28.literal("circle").optional(),
|
|
540
|
+
padShape: z28.literal("rect").optional(),
|
|
541
|
+
shape: z28.literal("circular_hole_with_rect_pad").optional(),
|
|
530
542
|
portHints: portHints.optional()
|
|
531
543
|
}).refine(
|
|
532
544
|
(prop) => {
|
|
@@ -537,14 +549,14 @@ var platedHoleProps = z27.union([
|
|
|
537
549
|
}
|
|
538
550
|
),
|
|
539
551
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
540
|
-
name:
|
|
541
|
-
shape:
|
|
542
|
-
holeShape:
|
|
543
|
-
padShape:
|
|
544
|
-
holeWidth:
|
|
545
|
-
holeHeight:
|
|
546
|
-
rectPadWidth:
|
|
547
|
-
rectPadHeight:
|
|
552
|
+
name: z28.string().optional(),
|
|
553
|
+
shape: z28.literal("pill_hole_with_rect_pad"),
|
|
554
|
+
holeShape: z28.literal("pill"),
|
|
555
|
+
padShape: z28.literal("rect"),
|
|
556
|
+
holeWidth: distance10,
|
|
557
|
+
holeHeight: distance10,
|
|
558
|
+
rectPadWidth: distance10,
|
|
559
|
+
rectPadHeight: distance10,
|
|
548
560
|
portHints: portHints.optional()
|
|
549
561
|
})
|
|
550
562
|
]).refine((a) => {
|
|
@@ -562,21 +574,21 @@ expectTypesMatch(true);
|
|
|
562
574
|
import { resistance } from "circuit-json";
|
|
563
575
|
|
|
564
576
|
// lib/common/connectionsProp.ts
|
|
565
|
-
import { z as
|
|
566
|
-
var connectionTarget2 =
|
|
577
|
+
import { z as z29 } from "zod";
|
|
578
|
+
var connectionTarget2 = z29.string().or(z29.array(z29.string()).readonly()).or(z29.array(z29.string()));
|
|
567
579
|
var createConnectionsProp = (labels) => {
|
|
568
|
-
return
|
|
580
|
+
return z29.record(z29.enum(labels), connectionTarget2);
|
|
569
581
|
};
|
|
570
582
|
|
|
571
583
|
// lib/components/resistor.ts
|
|
572
|
-
import { z as
|
|
584
|
+
import { z as z30 } from "zod";
|
|
573
585
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
574
586
|
var resistorProps = commonComponentProps.extend({
|
|
575
587
|
resistance,
|
|
576
|
-
pullupFor:
|
|
577
|
-
pullupTo:
|
|
578
|
-
pulldownFor:
|
|
579
|
-
pulldownTo:
|
|
588
|
+
pullupFor: z30.string().optional(),
|
|
589
|
+
pullupTo: z30.string().optional(),
|
|
590
|
+
pulldownFor: z30.string().optional(),
|
|
591
|
+
pulldownTo: z30.string().optional(),
|
|
580
592
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
581
593
|
});
|
|
582
594
|
var resistorPins = lrPins;
|
|
@@ -584,54 +596,54 @@ expectTypesMatch(true);
|
|
|
584
596
|
|
|
585
597
|
// lib/components/potentiometer.ts
|
|
586
598
|
import { resistance as resistance2 } from "circuit-json";
|
|
587
|
-
import { z as
|
|
599
|
+
import { z as z31 } from "zod";
|
|
588
600
|
var potentiometerProps = commonComponentProps.extend({
|
|
589
601
|
maxResistance: resistance2,
|
|
590
|
-
pinVariant:
|
|
602
|
+
pinVariant: z31.enum(["two_pin", "three_pin"]).optional()
|
|
591
603
|
});
|
|
592
604
|
expectTypesMatch(true);
|
|
593
605
|
|
|
594
606
|
// lib/components/crystal.ts
|
|
595
607
|
import { frequency, capacitance } from "circuit-json";
|
|
596
|
-
import { z as
|
|
608
|
+
import { z as z32 } from "zod";
|
|
597
609
|
var crystalProps = commonComponentProps.extend({
|
|
598
610
|
frequency,
|
|
599
611
|
loadCapacitance: capacitance,
|
|
600
|
-
pinVariant:
|
|
612
|
+
pinVariant: z32.enum(["two_pin", "four_pin"]).optional()
|
|
601
613
|
});
|
|
602
614
|
var crystalPins = lrPins;
|
|
603
615
|
expectTypesMatch(true);
|
|
604
616
|
|
|
605
617
|
// lib/components/resonator.ts
|
|
606
618
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
607
|
-
import { z as
|
|
619
|
+
import { z as z33 } from "zod";
|
|
608
620
|
var resonatorProps = commonComponentProps.extend({
|
|
609
621
|
frequency: frequency2,
|
|
610
622
|
loadCapacitance: capacitance2,
|
|
611
|
-
pinVariant:
|
|
623
|
+
pinVariant: z33.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
612
624
|
});
|
|
613
625
|
expectTypesMatch(true);
|
|
614
626
|
|
|
615
627
|
// lib/components/stampboard.ts
|
|
616
|
-
import { distance as
|
|
617
|
-
import { z as
|
|
628
|
+
import { distance as distance11 } from "circuit-json";
|
|
629
|
+
import { z as z34 } from "zod";
|
|
618
630
|
var stampboardProps = boardProps.extend({
|
|
619
|
-
leftPinCount:
|
|
620
|
-
rightPinCount:
|
|
621
|
-
topPinCount:
|
|
622
|
-
bottomPinCount:
|
|
623
|
-
leftPins:
|
|
624
|
-
rightPins:
|
|
625
|
-
topPins:
|
|
626
|
-
bottomPins:
|
|
627
|
-
pinPitch:
|
|
628
|
-
innerHoles:
|
|
631
|
+
leftPinCount: z34.number().optional(),
|
|
632
|
+
rightPinCount: z34.number().optional(),
|
|
633
|
+
topPinCount: z34.number().optional(),
|
|
634
|
+
bottomPinCount: z34.number().optional(),
|
|
635
|
+
leftPins: z34.array(z34.string()).optional(),
|
|
636
|
+
rightPins: z34.array(z34.string()).optional(),
|
|
637
|
+
topPins: z34.array(z34.string()).optional(),
|
|
638
|
+
bottomPins: z34.array(z34.string()).optional(),
|
|
639
|
+
pinPitch: distance11.optional(),
|
|
640
|
+
innerHoles: z34.boolean().optional()
|
|
629
641
|
});
|
|
630
642
|
expectTypesMatch(true);
|
|
631
643
|
|
|
632
644
|
// lib/components/capacitor.ts
|
|
633
645
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
634
|
-
import { z as
|
|
646
|
+
import { z as z35 } from "zod";
|
|
635
647
|
var capacitorPinLabels = [
|
|
636
648
|
"pin1",
|
|
637
649
|
"pin2",
|
|
@@ -643,79 +655,79 @@ var capacitorPinLabels = [
|
|
|
643
655
|
var capacitorProps = commonComponentProps.extend({
|
|
644
656
|
capacitance: capacitance3,
|
|
645
657
|
maxVoltageRating: voltage.optional(),
|
|
646
|
-
schShowRatings:
|
|
647
|
-
polarized:
|
|
648
|
-
decouplingFor:
|
|
649
|
-
decouplingTo:
|
|
650
|
-
bypassFor:
|
|
651
|
-
bypassTo:
|
|
652
|
-
maxDecouplingTraceLength:
|
|
658
|
+
schShowRatings: z35.boolean().optional().default(false),
|
|
659
|
+
polarized: z35.boolean().optional().default(false),
|
|
660
|
+
decouplingFor: z35.string().optional(),
|
|
661
|
+
decouplingTo: z35.string().optional(),
|
|
662
|
+
bypassFor: z35.string().optional(),
|
|
663
|
+
bypassTo: z35.string().optional(),
|
|
664
|
+
maxDecouplingTraceLength: z35.number().optional(),
|
|
653
665
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
654
666
|
});
|
|
655
667
|
var capacitorPins = lrPolarPins;
|
|
656
668
|
expectTypesMatch(true);
|
|
657
669
|
|
|
658
670
|
// lib/components/net.ts
|
|
659
|
-
import { z as
|
|
660
|
-
var netProps =
|
|
661
|
-
name:
|
|
671
|
+
import { z as z36 } from "zod";
|
|
672
|
+
var netProps = z36.object({
|
|
673
|
+
name: z36.string()
|
|
662
674
|
});
|
|
663
675
|
expectTypesMatch(true);
|
|
664
676
|
|
|
665
677
|
// lib/components/constrainedlayout.ts
|
|
666
|
-
import { z as
|
|
667
|
-
var constrainedLayoutProps =
|
|
668
|
-
name:
|
|
669
|
-
pcbOnly:
|
|
670
|
-
schOnly:
|
|
678
|
+
import { z as z37 } from "zod";
|
|
679
|
+
var constrainedLayoutProps = z37.object({
|
|
680
|
+
name: z37.string().optional(),
|
|
681
|
+
pcbOnly: z37.boolean().optional(),
|
|
682
|
+
schOnly: z37.boolean().optional()
|
|
671
683
|
});
|
|
672
684
|
expectTypesMatch(true);
|
|
673
685
|
|
|
674
686
|
// lib/common/distance.ts
|
|
675
687
|
import "zod";
|
|
676
|
-
import { distance as
|
|
688
|
+
import { distance as distance12, length as length2 } from "circuit-json";
|
|
677
689
|
|
|
678
690
|
// lib/components/constraint.ts
|
|
679
|
-
import { z as
|
|
680
|
-
var pcbXDistConstraintProps =
|
|
681
|
-
pcb:
|
|
682
|
-
xDist:
|
|
683
|
-
left:
|
|
684
|
-
right:
|
|
685
|
-
edgeToEdge:
|
|
686
|
-
centerToCenter:
|
|
691
|
+
import { z as z39 } from "zod";
|
|
692
|
+
var pcbXDistConstraintProps = z39.object({
|
|
693
|
+
pcb: z39.literal(true).optional(),
|
|
694
|
+
xDist: distance12,
|
|
695
|
+
left: z39.string(),
|
|
696
|
+
right: z39.string(),
|
|
697
|
+
edgeToEdge: z39.literal(true).optional(),
|
|
698
|
+
centerToCenter: z39.literal(true).optional()
|
|
687
699
|
});
|
|
688
700
|
expectTypesMatch(
|
|
689
701
|
true
|
|
690
702
|
);
|
|
691
|
-
var pcbYDistConstraintProps =
|
|
692
|
-
pcb:
|
|
693
|
-
yDist:
|
|
694
|
-
top:
|
|
695
|
-
bottom:
|
|
696
|
-
edgeToEdge:
|
|
697
|
-
centerToCenter:
|
|
703
|
+
var pcbYDistConstraintProps = z39.object({
|
|
704
|
+
pcb: z39.literal(true).optional(),
|
|
705
|
+
yDist: distance12,
|
|
706
|
+
top: z39.string(),
|
|
707
|
+
bottom: z39.string(),
|
|
708
|
+
edgeToEdge: z39.literal(true).optional(),
|
|
709
|
+
centerToCenter: z39.literal(true).optional()
|
|
698
710
|
});
|
|
699
711
|
expectTypesMatch(
|
|
700
712
|
true
|
|
701
713
|
);
|
|
702
|
-
var pcbSameYConstraintProps =
|
|
703
|
-
pcb:
|
|
704
|
-
sameY:
|
|
705
|
-
for:
|
|
714
|
+
var pcbSameYConstraintProps = z39.object({
|
|
715
|
+
pcb: z39.literal(true).optional(),
|
|
716
|
+
sameY: z39.literal(true).optional(),
|
|
717
|
+
for: z39.array(z39.string())
|
|
706
718
|
});
|
|
707
719
|
expectTypesMatch(
|
|
708
720
|
true
|
|
709
721
|
);
|
|
710
|
-
var pcbSameXConstraintProps =
|
|
711
|
-
pcb:
|
|
712
|
-
sameX:
|
|
713
|
-
for:
|
|
722
|
+
var pcbSameXConstraintProps = z39.object({
|
|
723
|
+
pcb: z39.literal(true).optional(),
|
|
724
|
+
sameX: z39.literal(true).optional(),
|
|
725
|
+
for: z39.array(z39.string())
|
|
714
726
|
});
|
|
715
727
|
expectTypesMatch(
|
|
716
728
|
true
|
|
717
729
|
);
|
|
718
|
-
var constraintProps =
|
|
730
|
+
var constraintProps = z39.union([
|
|
719
731
|
pcbXDistConstraintProps,
|
|
720
732
|
pcbYDistConstraintProps,
|
|
721
733
|
pcbSameYConstraintProps,
|
|
@@ -724,79 +736,79 @@ var constraintProps = z38.union([
|
|
|
724
736
|
expectTypesMatch(true);
|
|
725
737
|
|
|
726
738
|
// lib/components/cutout.ts
|
|
727
|
-
import { z as
|
|
739
|
+
import { z as z40 } from "zod";
|
|
728
740
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
729
741
|
layer: true,
|
|
730
742
|
pcbRotation: true
|
|
731
743
|
}).extend({
|
|
732
|
-
name:
|
|
733
|
-
shape:
|
|
734
|
-
width:
|
|
735
|
-
height:
|
|
744
|
+
name: z40.string().optional(),
|
|
745
|
+
shape: z40.literal("rect"),
|
|
746
|
+
width: distance12,
|
|
747
|
+
height: distance12
|
|
736
748
|
});
|
|
737
749
|
expectTypesMatch(true);
|
|
738
750
|
var circleCutoutProps = pcbLayoutProps.omit({
|
|
739
751
|
layer: true,
|
|
740
752
|
pcbRotation: true
|
|
741
753
|
}).extend({
|
|
742
|
-
name:
|
|
743
|
-
shape:
|
|
744
|
-
radius:
|
|
754
|
+
name: z40.string().optional(),
|
|
755
|
+
shape: z40.literal("circle"),
|
|
756
|
+
radius: distance12
|
|
745
757
|
});
|
|
746
758
|
expectTypesMatch(true);
|
|
747
759
|
var polygonCutoutProps = pcbLayoutProps.omit({
|
|
748
760
|
layer: true,
|
|
749
761
|
pcbRotation: true
|
|
750
762
|
}).extend({
|
|
751
|
-
name:
|
|
752
|
-
shape:
|
|
753
|
-
points:
|
|
763
|
+
name: z40.string().optional(),
|
|
764
|
+
shape: z40.literal("polygon"),
|
|
765
|
+
points: z40.array(point)
|
|
754
766
|
});
|
|
755
767
|
expectTypesMatch(true);
|
|
756
|
-
var cutoutProps =
|
|
768
|
+
var cutoutProps = z40.discriminatedUnion("shape", [
|
|
757
769
|
rectCutoutProps,
|
|
758
770
|
circleCutoutProps,
|
|
759
771
|
polygonCutoutProps
|
|
760
772
|
]);
|
|
761
773
|
|
|
762
774
|
// lib/components/smtpad.ts
|
|
763
|
-
import { z as
|
|
775
|
+
import { z as z41 } from "zod";
|
|
764
776
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
765
|
-
shape:
|
|
766
|
-
width:
|
|
767
|
-
height:
|
|
777
|
+
shape: z41.literal("rect"),
|
|
778
|
+
width: distance12,
|
|
779
|
+
height: distance12,
|
|
768
780
|
portHints: portHints.optional()
|
|
769
781
|
});
|
|
770
782
|
expectTypesMatch(true);
|
|
771
783
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
772
|
-
shape:
|
|
773
|
-
width:
|
|
774
|
-
height:
|
|
775
|
-
ccwRotation:
|
|
784
|
+
shape: z41.literal("rotated_rect"),
|
|
785
|
+
width: distance12,
|
|
786
|
+
height: distance12,
|
|
787
|
+
ccwRotation: z41.number(),
|
|
776
788
|
portHints: portHints.optional()
|
|
777
789
|
});
|
|
778
790
|
expectTypesMatch(true);
|
|
779
791
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
780
|
-
shape:
|
|
781
|
-
radius:
|
|
792
|
+
shape: z41.literal("circle"),
|
|
793
|
+
radius: distance12,
|
|
782
794
|
portHints: portHints.optional()
|
|
783
795
|
});
|
|
784
796
|
expectTypesMatch(true);
|
|
785
797
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
786
|
-
shape:
|
|
787
|
-
width:
|
|
788
|
-
height:
|
|
789
|
-
radius:
|
|
798
|
+
shape: z41.literal("pill"),
|
|
799
|
+
width: distance12,
|
|
800
|
+
height: distance12,
|
|
801
|
+
radius: distance12,
|
|
790
802
|
portHints: portHints.optional()
|
|
791
803
|
});
|
|
792
804
|
expectTypesMatch(true);
|
|
793
805
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
794
|
-
shape:
|
|
795
|
-
points:
|
|
806
|
+
shape: z41.literal("polygon"),
|
|
807
|
+
points: z41.array(point),
|
|
796
808
|
portHints: portHints.optional()
|
|
797
809
|
});
|
|
798
810
|
expectTypesMatch(true);
|
|
799
|
-
var smtPadProps =
|
|
811
|
+
var smtPadProps = z41.union([
|
|
800
812
|
circleSmtPadProps,
|
|
801
813
|
rectSmtPadProps,
|
|
802
814
|
rotatedRectSmtPadProps,
|
|
@@ -806,30 +818,30 @@ var smtPadProps = z40.union([
|
|
|
806
818
|
expectTypesMatch(true);
|
|
807
819
|
|
|
808
820
|
// lib/components/solderpaste.ts
|
|
809
|
-
import { z as
|
|
821
|
+
import { z as z42 } from "zod";
|
|
810
822
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
811
|
-
shape:
|
|
812
|
-
width:
|
|
813
|
-
height:
|
|
823
|
+
shape: z42.literal("rect"),
|
|
824
|
+
width: distance12,
|
|
825
|
+
height: distance12
|
|
814
826
|
});
|
|
815
827
|
expectTypesMatch(true);
|
|
816
828
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
817
|
-
shape:
|
|
818
|
-
radius:
|
|
829
|
+
shape: z42.literal("circle"),
|
|
830
|
+
radius: distance12
|
|
819
831
|
});
|
|
820
832
|
expectTypesMatch(true);
|
|
821
|
-
var solderPasteProps =
|
|
833
|
+
var solderPasteProps = z42.union([
|
|
822
834
|
circleSolderPasteProps,
|
|
823
835
|
rectSolderPasteProps
|
|
824
836
|
]);
|
|
825
837
|
expectTypesMatch(true);
|
|
826
838
|
|
|
827
839
|
// lib/components/hole.ts
|
|
828
|
-
import { z as
|
|
840
|
+
import { z as z43 } from "zod";
|
|
829
841
|
var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
830
|
-
name:
|
|
831
|
-
diameter:
|
|
832
|
-
radius:
|
|
842
|
+
name: z43.string().optional(),
|
|
843
|
+
diameter: distance12.optional(),
|
|
844
|
+
radius: distance12.optional()
|
|
833
845
|
}).transform((d) => ({
|
|
834
846
|
...d,
|
|
835
847
|
diameter: d.diameter ?? 2 * d.radius,
|
|
@@ -838,25 +850,25 @@ var holeProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
838
850
|
expectTypesMatch(true);
|
|
839
851
|
|
|
840
852
|
// lib/components/trace.ts
|
|
841
|
-
import { distance as
|
|
842
|
-
import { z as
|
|
843
|
-
var portRef =
|
|
844
|
-
|
|
845
|
-
|
|
853
|
+
import { distance as distance13, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
854
|
+
import { z as z44 } from "zod";
|
|
855
|
+
var portRef = z44.union([
|
|
856
|
+
z44.string(),
|
|
857
|
+
z44.custom(
|
|
846
858
|
(v) => Boolean(v.getPortSelector)
|
|
847
859
|
)
|
|
848
860
|
]);
|
|
849
|
-
var baseTraceProps =
|
|
850
|
-
key:
|
|
851
|
-
thickness:
|
|
852
|
-
schematicRouteHints:
|
|
853
|
-
pcbRouteHints:
|
|
854
|
-
schDisplayLabel:
|
|
855
|
-
maxLength:
|
|
856
|
-
});
|
|
857
|
-
var traceProps =
|
|
861
|
+
var baseTraceProps = z44.object({
|
|
862
|
+
key: z44.string().optional(),
|
|
863
|
+
thickness: distance13.optional(),
|
|
864
|
+
schematicRouteHints: z44.array(point).optional(),
|
|
865
|
+
pcbRouteHints: z44.array(route_hint_point2).optional(),
|
|
866
|
+
schDisplayLabel: z44.string().optional(),
|
|
867
|
+
maxLength: distance13.optional()
|
|
868
|
+
});
|
|
869
|
+
var traceProps = z44.union([
|
|
858
870
|
baseTraceProps.extend({
|
|
859
|
-
path:
|
|
871
|
+
path: z44.array(portRef)
|
|
860
872
|
}),
|
|
861
873
|
baseTraceProps.extend({
|
|
862
874
|
from: portRef,
|
|
@@ -866,15 +878,15 @@ var traceProps = z43.union([
|
|
|
866
878
|
|
|
867
879
|
// lib/components/footprint.ts
|
|
868
880
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
869
|
-
import { z as
|
|
870
|
-
var footprintProps =
|
|
881
|
+
import { z as z45 } from "zod";
|
|
882
|
+
var footprintProps = z45.object({
|
|
871
883
|
originalLayer: layer_ref4.default("top").optional()
|
|
872
884
|
});
|
|
873
885
|
expectTypesMatch(true);
|
|
874
886
|
|
|
875
887
|
// lib/components/battery.ts
|
|
876
|
-
import { z as
|
|
877
|
-
var capacity =
|
|
888
|
+
import { z as z46 } from "zod";
|
|
889
|
+
var capacity = z46.number().or(z46.string().endsWith("mAh")).transform((v) => {
|
|
878
890
|
if (typeof v === "string") {
|
|
879
891
|
const valString = v.replace("mAh", "");
|
|
880
892
|
const num = Number.parseFloat(valString);
|
|
@@ -892,32 +904,32 @@ var batteryPins = lrPolarPins;
|
|
|
892
904
|
expectTypesMatch(true);
|
|
893
905
|
|
|
894
906
|
// lib/components/pin-header.ts
|
|
895
|
-
import { distance as
|
|
896
|
-
import { z as
|
|
907
|
+
import { distance as distance14 } from "circuit-json";
|
|
908
|
+
import { z as z47 } from "zod";
|
|
897
909
|
var pinHeaderProps = commonComponentProps.extend({
|
|
898
|
-
pinCount:
|
|
899
|
-
pitch:
|
|
900
|
-
schFacingDirection:
|
|
901
|
-
gender:
|
|
902
|
-
showSilkscreenPinLabels:
|
|
903
|
-
doubleRow:
|
|
904
|
-
holeDiameter:
|
|
905
|
-
platedDiameter:
|
|
906
|
-
pinLabels:
|
|
907
|
-
facingDirection:
|
|
910
|
+
pinCount: z47.number(),
|
|
911
|
+
pitch: distance14.optional(),
|
|
912
|
+
schFacingDirection: z47.enum(["up", "down", "left", "right"]).optional(),
|
|
913
|
+
gender: z47.enum(["male", "female"]).optional().default("male"),
|
|
914
|
+
showSilkscreenPinLabels: z47.boolean().optional(),
|
|
915
|
+
doubleRow: z47.boolean().optional(),
|
|
916
|
+
holeDiameter: distance14.optional(),
|
|
917
|
+
platedDiameter: distance14.optional(),
|
|
918
|
+
pinLabels: z47.array(z47.string()).optional(),
|
|
919
|
+
facingDirection: z47.enum(["left", "right"]).optional(),
|
|
908
920
|
schPinArrangement: schematicPinArrangement.optional()
|
|
909
921
|
});
|
|
910
922
|
expectTypesMatch(true);
|
|
911
923
|
|
|
912
924
|
// lib/components/netalias.ts
|
|
913
|
-
import { z as
|
|
925
|
+
import { z as z48 } from "zod";
|
|
914
926
|
import { rotation as rotation2 } from "circuit-json";
|
|
915
|
-
var netAliasProps =
|
|
916
|
-
net:
|
|
917
|
-
schX:
|
|
918
|
-
schY:
|
|
927
|
+
var netAliasProps = z48.object({
|
|
928
|
+
net: z48.string().optional(),
|
|
929
|
+
schX: distance12.optional(),
|
|
930
|
+
schY: distance12.optional(),
|
|
919
931
|
schRotation: rotation2.optional(),
|
|
920
|
-
anchorSide:
|
|
932
|
+
anchorSide: z48.enum(["left", "up", "right", "down"]).optional()
|
|
921
933
|
});
|
|
922
934
|
expectTypesMatch(true);
|
|
923
935
|
|
|
@@ -931,9 +943,9 @@ var subcircuitProps = subcircuitGroupProps;
|
|
|
931
943
|
expectTypesMatch(true);
|
|
932
944
|
|
|
933
945
|
// lib/components/transistor.ts
|
|
934
|
-
import { z as
|
|
946
|
+
import { z as z50 } from "zod";
|
|
935
947
|
var transistorProps = commonComponentProps.extend({
|
|
936
|
-
type:
|
|
948
|
+
type: z50.enum(["npn", "pnp", "bjt", "jfet", "mosfet"])
|
|
937
949
|
});
|
|
938
950
|
var transistorPins = [
|
|
939
951
|
"pin1",
|
|
@@ -946,10 +958,10 @@ var transistorPins = [
|
|
|
946
958
|
expectTypesMatch(true);
|
|
947
959
|
|
|
948
960
|
// lib/components/mosfet.ts
|
|
949
|
-
import { z as
|
|
961
|
+
import { z as z51 } from "zod";
|
|
950
962
|
var mosfetProps = commonComponentProps.extend({
|
|
951
|
-
channelType:
|
|
952
|
-
mosfetMode:
|
|
963
|
+
channelType: z51.enum(["n", "p"]),
|
|
964
|
+
mosfetMode: z51.enum(["enhancement", "depletion"])
|
|
953
965
|
});
|
|
954
966
|
var mosfetPins = [
|
|
955
967
|
"pin1",
|
|
@@ -969,8 +981,8 @@ var inductorProps = commonComponentProps.extend({
|
|
|
969
981
|
var inductorPins = lrPins;
|
|
970
982
|
|
|
971
983
|
// lib/components/diode.ts
|
|
972
|
-
import { z as
|
|
973
|
-
var diodeConnectionKeys =
|
|
984
|
+
import { z as z52 } from "zod";
|
|
985
|
+
var diodeConnectionKeys = z52.enum([
|
|
974
986
|
"anode",
|
|
975
987
|
"cathode",
|
|
976
988
|
"pin1",
|
|
@@ -978,17 +990,17 @@ var diodeConnectionKeys = z51.enum([
|
|
|
978
990
|
"pos",
|
|
979
991
|
"neg"
|
|
980
992
|
]);
|
|
981
|
-
var connectionTarget3 =
|
|
982
|
-
var connectionsProp2 =
|
|
983
|
-
var diodeVariant =
|
|
993
|
+
var connectionTarget3 = z52.string().or(z52.array(z52.string()).readonly()).or(z52.array(z52.string()));
|
|
994
|
+
var connectionsProp2 = z52.record(diodeConnectionKeys, connectionTarget3);
|
|
995
|
+
var diodeVariant = z52.enum(["standard", "schottky", "zener", "photo", "tvs"]);
|
|
984
996
|
var diodeProps = commonComponentProps.extend({
|
|
985
997
|
connections: connectionsProp2.optional(),
|
|
986
998
|
variant: diodeVariant.optional().default("standard"),
|
|
987
|
-
standard:
|
|
988
|
-
schottky:
|
|
989
|
-
zener:
|
|
990
|
-
photo:
|
|
991
|
-
tvs:
|
|
999
|
+
standard: z52.boolean().optional(),
|
|
1000
|
+
schottky: z52.boolean().optional(),
|
|
1001
|
+
zener: z52.boolean().optional(),
|
|
1002
|
+
photo: z52.boolean().optional(),
|
|
1003
|
+
tvs: z52.boolean().optional()
|
|
992
1004
|
}).superRefine((data, ctx) => {
|
|
993
1005
|
const enabledFlags = [
|
|
994
1006
|
data.standard,
|
|
@@ -999,11 +1011,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
999
1011
|
].filter(Boolean).length;
|
|
1000
1012
|
if (enabledFlags > 1) {
|
|
1001
1013
|
ctx.addIssue({
|
|
1002
|
-
code:
|
|
1014
|
+
code: z52.ZodIssueCode.custom,
|
|
1003
1015
|
message: "Exactly one diode variant must be enabled",
|
|
1004
1016
|
path: []
|
|
1005
1017
|
});
|
|
1006
|
-
return
|
|
1018
|
+
return z52.INVALID;
|
|
1007
1019
|
}
|
|
1008
1020
|
}).transform((data) => {
|
|
1009
1021
|
const result = {
|
|
@@ -1051,23 +1063,23 @@ var diodePins = lrPolarPins;
|
|
|
1051
1063
|
expectTypesMatch(true);
|
|
1052
1064
|
|
|
1053
1065
|
// lib/components/led.ts
|
|
1054
|
-
import { z as
|
|
1066
|
+
import { z as z53 } from "zod";
|
|
1055
1067
|
var ledProps = commonComponentProps.extend({
|
|
1056
|
-
color:
|
|
1057
|
-
wavelength:
|
|
1058
|
-
schDisplayValue:
|
|
1068
|
+
color: z53.string().optional(),
|
|
1069
|
+
wavelength: z53.string().optional(),
|
|
1070
|
+
schDisplayValue: z53.string().optional()
|
|
1059
1071
|
});
|
|
1060
1072
|
var ledPins = lrPolarPins;
|
|
1061
1073
|
|
|
1062
1074
|
// lib/components/switch.ts
|
|
1063
|
-
import { z as
|
|
1075
|
+
import { z as z54 } from "zod";
|
|
1064
1076
|
var switchProps = commonComponentProps.extend({
|
|
1065
|
-
type:
|
|
1066
|
-
isNormallyClosed:
|
|
1067
|
-
spst:
|
|
1068
|
-
spdt:
|
|
1069
|
-
dpst:
|
|
1070
|
-
dpdt:
|
|
1077
|
+
type: z54.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1078
|
+
isNormallyClosed: z54.boolean().optional().default(false),
|
|
1079
|
+
spst: z54.boolean().optional(),
|
|
1080
|
+
spdt: z54.boolean().optional(),
|
|
1081
|
+
dpst: z54.boolean().optional(),
|
|
1082
|
+
dpdt: z54.boolean().optional()
|
|
1071
1083
|
}).transform((props) => {
|
|
1072
1084
|
const updatedProps = { ...props };
|
|
1073
1085
|
if (updatedProps.dpdt) {
|
|
@@ -1099,70 +1111,77 @@ expectTypesMatch(true);
|
|
|
1099
1111
|
|
|
1100
1112
|
// lib/components/fabrication-note-text.ts
|
|
1101
1113
|
import { length as length3 } from "circuit-json";
|
|
1102
|
-
import { z as
|
|
1114
|
+
import { z as z55 } from "zod";
|
|
1103
1115
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1104
|
-
text:
|
|
1105
|
-
anchorAlignment:
|
|
1106
|
-
font:
|
|
1116
|
+
text: z55.string(),
|
|
1117
|
+
anchorAlignment: z55.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1118
|
+
font: z55.enum(["tscircuit2024"]).optional(),
|
|
1107
1119
|
fontSize: length3.optional(),
|
|
1108
|
-
color:
|
|
1120
|
+
color: z55.string().optional()
|
|
1109
1121
|
});
|
|
1110
1122
|
|
|
1111
1123
|
// lib/components/fabrication-note-path.ts
|
|
1112
1124
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1113
|
-
import { z as
|
|
1125
|
+
import { z as z56 } from "zod";
|
|
1114
1126
|
var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1115
|
-
route:
|
|
1127
|
+
route: z56.array(route_hint_point3),
|
|
1116
1128
|
strokeWidth: length4.optional(),
|
|
1117
|
-
color:
|
|
1129
|
+
color: z56.string().optional()
|
|
1118
1130
|
});
|
|
1119
1131
|
|
|
1120
1132
|
// lib/components/pcb-trace.ts
|
|
1121
|
-
import { distance as
|
|
1122
|
-
import { z as
|
|
1123
|
-
var pcbTraceProps =
|
|
1124
|
-
layer:
|
|
1125
|
-
thickness:
|
|
1126
|
-
route:
|
|
1133
|
+
import { distance as distance15, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1134
|
+
import { z as z57 } from "zod";
|
|
1135
|
+
var pcbTraceProps = z57.object({
|
|
1136
|
+
layer: z57.string().optional(),
|
|
1137
|
+
thickness: distance15.optional(),
|
|
1138
|
+
route: z57.array(route_hint_point4)
|
|
1127
1139
|
});
|
|
1128
1140
|
|
|
1129
1141
|
// lib/components/via.ts
|
|
1130
|
-
import { distance as
|
|
1142
|
+
import { distance as distance16, layer_ref as layer_ref5 } from "circuit-json";
|
|
1131
1143
|
var viaProps = commonLayoutProps.extend({
|
|
1132
1144
|
fromLayer: layer_ref5,
|
|
1133
1145
|
toLayer: layer_ref5,
|
|
1134
|
-
holeDiameter:
|
|
1135
|
-
outerDiameter:
|
|
1146
|
+
holeDiameter: distance16,
|
|
1147
|
+
outerDiameter: distance16
|
|
1136
1148
|
});
|
|
1137
1149
|
|
|
1138
1150
|
// lib/components/testpoint.ts
|
|
1139
|
-
import { distance as
|
|
1140
|
-
import { z as
|
|
1151
|
+
import { distance as distance17 } from "circuit-json";
|
|
1152
|
+
import { z as z58 } from "zod";
|
|
1141
1153
|
var testpointProps = commonComponentProps.extend({
|
|
1142
|
-
footprintVariant:
|
|
1143
|
-
padShape:
|
|
1144
|
-
padDiameter:
|
|
1145
|
-
holeDiameter:
|
|
1146
|
-
width:
|
|
1147
|
-
height:
|
|
1154
|
+
footprintVariant: z58.enum(["pad", "through_hole"]).optional().default("pad"),
|
|
1155
|
+
padShape: z58.enum(["rect", "circle"]).optional().default("circle"),
|
|
1156
|
+
padDiameter: distance17.optional(),
|
|
1157
|
+
holeDiameter: distance17.optional(),
|
|
1158
|
+
width: distance17.optional(),
|
|
1159
|
+
height: distance17.optional()
|
|
1148
1160
|
}).refine(
|
|
1149
1161
|
(props) => props.footprintVariant === "pad" || props.holeDiameter !== void 0,
|
|
1150
1162
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
1151
1163
|
);
|
|
1152
1164
|
expectTypesMatch(true);
|
|
1153
1165
|
|
|
1166
|
+
// lib/components/breakoutpoint.ts
|
|
1167
|
+
import { z as z59 } from "zod";
|
|
1168
|
+
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1169
|
+
connection: z59.string()
|
|
1170
|
+
});
|
|
1171
|
+
expectTypesMatch(true);
|
|
1172
|
+
|
|
1154
1173
|
// lib/components/pcb-keepout.ts
|
|
1155
|
-
import { distance as
|
|
1156
|
-
import { z as
|
|
1157
|
-
var pcbKeepoutProps =
|
|
1174
|
+
import { distance as distance18 } from "circuit-json";
|
|
1175
|
+
import { z as z60 } from "zod";
|
|
1176
|
+
var pcbKeepoutProps = z60.union([
|
|
1158
1177
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1159
|
-
shape:
|
|
1160
|
-
radius:
|
|
1178
|
+
shape: z60.literal("circle"),
|
|
1179
|
+
radius: distance18
|
|
1161
1180
|
}),
|
|
1162
1181
|
pcbLayoutProps.extend({
|
|
1163
|
-
shape:
|
|
1164
|
-
width:
|
|
1165
|
-
height:
|
|
1182
|
+
shape: z60.literal("rect"),
|
|
1183
|
+
width: distance18,
|
|
1184
|
+
height: distance18
|
|
1166
1185
|
})
|
|
1167
1186
|
]);
|
|
1168
1187
|
|
|
@@ -1173,12 +1192,12 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1173
1192
|
});
|
|
1174
1193
|
|
|
1175
1194
|
// lib/components/schematic-box.ts
|
|
1176
|
-
import { distance as
|
|
1177
|
-
import { z as
|
|
1195
|
+
import { distance as distance19, position } from "circuit-json";
|
|
1196
|
+
import { z as z62 } from "zod";
|
|
1178
1197
|
|
|
1179
1198
|
// lib/common/nine_point_anchor.ts
|
|
1180
|
-
import { z as
|
|
1181
|
-
var nine_point_anchor =
|
|
1199
|
+
import { z as z61 } from "zod";
|
|
1200
|
+
var nine_point_anchor = z61.enum([
|
|
1182
1201
|
"top_left",
|
|
1183
1202
|
"top_center",
|
|
1184
1203
|
"top_right",
|
|
@@ -1191,27 +1210,27 @@ var nine_point_anchor = z59.enum([
|
|
|
1191
1210
|
]);
|
|
1192
1211
|
|
|
1193
1212
|
// lib/components/schematic-box.ts
|
|
1194
|
-
var schematicBoxProps =
|
|
1195
|
-
schX:
|
|
1196
|
-
schY:
|
|
1197
|
-
width:
|
|
1198
|
-
height:
|
|
1199
|
-
overlay:
|
|
1200
|
-
padding:
|
|
1201
|
-
paddingLeft:
|
|
1202
|
-
paddingRight:
|
|
1203
|
-
paddingTop:
|
|
1204
|
-
paddingBottom:
|
|
1205
|
-
title:
|
|
1206
|
-
titleAnchorPosition:
|
|
1213
|
+
var schematicBoxProps = z62.object({
|
|
1214
|
+
schX: distance19,
|
|
1215
|
+
schY: distance19,
|
|
1216
|
+
width: distance19.optional(),
|
|
1217
|
+
height: distance19.optional(),
|
|
1218
|
+
overlay: z62.array(z62.string()).optional(),
|
|
1219
|
+
padding: distance19.optional(),
|
|
1220
|
+
paddingLeft: distance19.optional(),
|
|
1221
|
+
paddingRight: distance19.optional(),
|
|
1222
|
+
paddingTop: distance19.optional(),
|
|
1223
|
+
paddingBottom: distance19.optional(),
|
|
1224
|
+
title: z62.string().optional(),
|
|
1225
|
+
titleAnchorPosition: z62.object({
|
|
1207
1226
|
x: position.optional(),
|
|
1208
1227
|
y: position.optional()
|
|
1209
1228
|
}).optional(),
|
|
1210
1229
|
titleAnchorAlignment: nine_point_anchor.default("center"),
|
|
1211
|
-
titleColor:
|
|
1212
|
-
titleFontSize:
|
|
1213
|
-
titleInside:
|
|
1214
|
-
strokeStyle:
|
|
1230
|
+
titleColor: z62.string().optional(),
|
|
1231
|
+
titleFontSize: distance19.optional(),
|
|
1232
|
+
titleInside: z62.boolean().default(false),
|
|
1233
|
+
strokeStyle: z62.enum(["solid", "dashed"]).default("solid")
|
|
1215
1234
|
}).refine(
|
|
1216
1235
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1217
1236
|
{
|
|
@@ -1225,22 +1244,22 @@ var schematicBoxProps = z60.object({
|
|
|
1225
1244
|
);
|
|
1226
1245
|
|
|
1227
1246
|
// lib/components/schematic-line.ts
|
|
1228
|
-
import { distance as
|
|
1229
|
-
import { z as
|
|
1230
|
-
var schematicLineProps =
|
|
1231
|
-
x1:
|
|
1232
|
-
y1:
|
|
1233
|
-
x2:
|
|
1234
|
-
y2:
|
|
1247
|
+
import { distance as distance20 } from "circuit-json";
|
|
1248
|
+
import { z as z63 } from "zod";
|
|
1249
|
+
var schematicLineProps = z63.object({
|
|
1250
|
+
x1: distance20,
|
|
1251
|
+
y1: distance20,
|
|
1252
|
+
x2: distance20,
|
|
1253
|
+
y2: distance20
|
|
1235
1254
|
});
|
|
1236
1255
|
|
|
1237
1256
|
// lib/components/schematic-text.ts
|
|
1238
|
-
import { distance as
|
|
1239
|
-
import { z as
|
|
1257
|
+
import { distance as distance21, rotation as rotation3 } from "circuit-json";
|
|
1258
|
+
import { z as z65 } from "zod";
|
|
1240
1259
|
|
|
1241
1260
|
// lib/common/five_point_anchor.ts
|
|
1242
|
-
import { z as
|
|
1243
|
-
var five_point_anchor =
|
|
1261
|
+
import { z as z64 } from "zod";
|
|
1262
|
+
var five_point_anchor = z64.enum([
|
|
1244
1263
|
"center",
|
|
1245
1264
|
"left",
|
|
1246
1265
|
"right",
|
|
@@ -1249,120 +1268,120 @@ var five_point_anchor = z62.enum([
|
|
|
1249
1268
|
]);
|
|
1250
1269
|
|
|
1251
1270
|
// lib/components/schematic-text.ts
|
|
1252
|
-
var schematicTextProps =
|
|
1253
|
-
schX:
|
|
1254
|
-
schY:
|
|
1255
|
-
text:
|
|
1256
|
-
fontSize:
|
|
1257
|
-
anchor:
|
|
1258
|
-
color:
|
|
1271
|
+
var schematicTextProps = z65.object({
|
|
1272
|
+
schX: distance21,
|
|
1273
|
+
schY: distance21,
|
|
1274
|
+
text: z65.string(),
|
|
1275
|
+
fontSize: z65.number().default(1),
|
|
1276
|
+
anchor: z65.union([five_point_anchor.describe("legacy"), nine_point_anchor]).default("center"),
|
|
1277
|
+
color: z65.string().default("#000000"),
|
|
1259
1278
|
schRotation: rotation3.default(0)
|
|
1260
1279
|
});
|
|
1261
1280
|
|
|
1262
1281
|
// lib/components/schematic-path.ts
|
|
1263
1282
|
import { point as point5 } from "circuit-json";
|
|
1264
|
-
import { z as
|
|
1265
|
-
var schematicPathProps =
|
|
1266
|
-
points:
|
|
1267
|
-
isFilled:
|
|
1268
|
-
fillColor:
|
|
1283
|
+
import { z as z66 } from "zod";
|
|
1284
|
+
var schematicPathProps = z66.object({
|
|
1285
|
+
points: z66.array(point5),
|
|
1286
|
+
isFilled: z66.boolean().optional().default(false),
|
|
1287
|
+
fillColor: z66.enum(["red", "blue"]).optional()
|
|
1269
1288
|
});
|
|
1270
1289
|
|
|
1271
1290
|
// lib/components/silkscreen-text.ts
|
|
1272
1291
|
import { length as length5 } from "circuit-json";
|
|
1273
|
-
import { z as
|
|
1292
|
+
import { z as z67 } from "zod";
|
|
1274
1293
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
1275
|
-
text:
|
|
1294
|
+
text: z67.string(),
|
|
1276
1295
|
anchorAlignment: nine_point_anchor.default("center"),
|
|
1277
|
-
font:
|
|
1296
|
+
font: z67.enum(["tscircuit2024"]).optional(),
|
|
1278
1297
|
fontSize: length5.optional()
|
|
1279
1298
|
});
|
|
1280
1299
|
|
|
1281
1300
|
// lib/components/silkscreen-path.ts
|
|
1282
1301
|
import { length as length6, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
1283
|
-
import { z as
|
|
1302
|
+
import { z as z68 } from "zod";
|
|
1284
1303
|
var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1285
|
-
route:
|
|
1304
|
+
route: z68.array(route_hint_point5),
|
|
1286
1305
|
strokeWidth: length6.optional()
|
|
1287
1306
|
});
|
|
1288
1307
|
|
|
1289
1308
|
// lib/components/silkscreen-line.ts
|
|
1290
|
-
import { distance as
|
|
1309
|
+
import { distance as distance22 } from "circuit-json";
|
|
1291
1310
|
var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
|
|
1292
|
-
strokeWidth:
|
|
1293
|
-
x1:
|
|
1294
|
-
y1:
|
|
1295
|
-
x2:
|
|
1296
|
-
y2:
|
|
1311
|
+
strokeWidth: distance22,
|
|
1312
|
+
x1: distance22,
|
|
1313
|
+
y1: distance22,
|
|
1314
|
+
x2: distance22,
|
|
1315
|
+
y2: distance22
|
|
1297
1316
|
});
|
|
1298
1317
|
|
|
1299
1318
|
// lib/components/silkscreen-rect.ts
|
|
1300
|
-
import { distance as
|
|
1301
|
-
import { z as
|
|
1319
|
+
import { distance as distance23 } from "circuit-json";
|
|
1320
|
+
import { z as z69 } from "zod";
|
|
1302
1321
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1303
|
-
filled:
|
|
1304
|
-
stroke:
|
|
1305
|
-
strokeWidth:
|
|
1306
|
-
width:
|
|
1307
|
-
height:
|
|
1322
|
+
filled: z69.boolean().default(true).optional(),
|
|
1323
|
+
stroke: z69.enum(["dashed", "solid", "none"]).optional(),
|
|
1324
|
+
strokeWidth: distance23.optional(),
|
|
1325
|
+
width: distance23,
|
|
1326
|
+
height: distance23
|
|
1308
1327
|
});
|
|
1309
1328
|
|
|
1310
1329
|
// lib/components/silkscreen-circle.ts
|
|
1311
|
-
import { distance as
|
|
1312
|
-
import { z as
|
|
1330
|
+
import { distance as distance24 } from "circuit-json";
|
|
1331
|
+
import { z as z70 } from "zod";
|
|
1313
1332
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1314
|
-
isFilled:
|
|
1315
|
-
isOutline:
|
|
1316
|
-
strokeWidth:
|
|
1317
|
-
radius:
|
|
1333
|
+
isFilled: z70.boolean().optional(),
|
|
1334
|
+
isOutline: z70.boolean().optional(),
|
|
1335
|
+
strokeWidth: distance24.optional(),
|
|
1336
|
+
radius: distance24
|
|
1318
1337
|
});
|
|
1319
1338
|
|
|
1320
1339
|
// lib/components/trace-hint.ts
|
|
1321
|
-
import { distance as
|
|
1322
|
-
import { z as
|
|
1323
|
-
var routeHintPointProps =
|
|
1324
|
-
x:
|
|
1325
|
-
y:
|
|
1326
|
-
via:
|
|
1340
|
+
import { distance as distance25, layer_ref as layer_ref6, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
1341
|
+
import { z as z71 } from "zod";
|
|
1342
|
+
var routeHintPointProps = z71.object({
|
|
1343
|
+
x: distance25,
|
|
1344
|
+
y: distance25,
|
|
1345
|
+
via: z71.boolean().optional(),
|
|
1327
1346
|
toLayer: layer_ref6.optional()
|
|
1328
1347
|
});
|
|
1329
|
-
var traceHintProps =
|
|
1330
|
-
for:
|
|
1348
|
+
var traceHintProps = z71.object({
|
|
1349
|
+
for: z71.string().optional().describe(
|
|
1331
1350
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
1332
1351
|
),
|
|
1333
|
-
order:
|
|
1352
|
+
order: z71.number().optional(),
|
|
1334
1353
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
1335
|
-
offsets:
|
|
1336
|
-
traceWidth:
|
|
1354
|
+
offsets: z71.array(route_hint_point6).or(z71.array(routeHintPointProps)).optional(),
|
|
1355
|
+
traceWidth: z71.number().optional()
|
|
1337
1356
|
});
|
|
1338
1357
|
|
|
1339
1358
|
// lib/components/port.ts
|
|
1340
|
-
import { z as
|
|
1359
|
+
import { z as z72 } from "zod";
|
|
1341
1360
|
var portProps = commonLayoutProps.extend({
|
|
1342
|
-
name:
|
|
1343
|
-
pinNumber:
|
|
1344
|
-
aliases:
|
|
1361
|
+
name: z72.string(),
|
|
1362
|
+
pinNumber: z72.number().optional(),
|
|
1363
|
+
aliases: z72.array(z72.string()).optional(),
|
|
1345
1364
|
direction
|
|
1346
1365
|
});
|
|
1347
1366
|
|
|
1348
1367
|
// lib/platformConfig.ts
|
|
1349
|
-
import { z as
|
|
1350
|
-
var unvalidatedCircuitJson =
|
|
1351
|
-
var pathToCircuitJsonFn =
|
|
1352
|
-
var platformConfig =
|
|
1368
|
+
import { z as z73 } from "zod";
|
|
1369
|
+
var unvalidatedCircuitJson = z73.array(z73.any()).describe("Circuit JSON");
|
|
1370
|
+
var pathToCircuitJsonFn = z73.function().args(z73.string()).returns(z73.promise(z73.object({ footprintCircuitJson: z73.array(z73.any()) }))).describe("A function that takes a path and returns Circuit JSON");
|
|
1371
|
+
var platformConfig = z73.object({
|
|
1353
1372
|
partsEngine: partsEngine.optional(),
|
|
1354
1373
|
autorouter: autorouterProp.optional(),
|
|
1355
|
-
registryApiUrl:
|
|
1356
|
-
cloudAutorouterUrl:
|
|
1357
|
-
localCacheEngine:
|
|
1358
|
-
pcbDisabled:
|
|
1359
|
-
schematicDisabled:
|
|
1360
|
-
partsEngineDisabled:
|
|
1361
|
-
footprintLibraryMap:
|
|
1362
|
-
|
|
1363
|
-
|
|
1364
|
-
|
|
1365
|
-
|
|
1374
|
+
registryApiUrl: z73.string().optional(),
|
|
1375
|
+
cloudAutorouterUrl: z73.string().optional(),
|
|
1376
|
+
localCacheEngine: z73.any().optional(),
|
|
1377
|
+
pcbDisabled: z73.boolean().optional(),
|
|
1378
|
+
schematicDisabled: z73.boolean().optional(),
|
|
1379
|
+
partsEngineDisabled: z73.boolean().optional(),
|
|
1380
|
+
footprintLibraryMap: z73.record(
|
|
1381
|
+
z73.string(),
|
|
1382
|
+
z73.record(
|
|
1383
|
+
z73.string(),
|
|
1384
|
+
z73.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
1366
1385
|
)
|
|
1367
1386
|
).optional()
|
|
1368
1387
|
});
|
|
@@ -1375,6 +1394,8 @@ export {
|
|
|
1375
1394
|
batteryPins,
|
|
1376
1395
|
batteryProps,
|
|
1377
1396
|
boardProps,
|
|
1397
|
+
breakoutPointProps,
|
|
1398
|
+
breakoutProps,
|
|
1378
1399
|
bugProps,
|
|
1379
1400
|
cadModelBase,
|
|
1380
1401
|
cadModelJscad,
|