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