circuit-json 0.0.86 → 0.0.88
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.mts +536 -39
- package/dist/index.mjs +250 -222
- package/dist/index.mjs.map +1 -1
- package/package.json +2 -2
package/dist/index.mjs
CHANGED
|
@@ -316,7 +316,8 @@ var any_source_component = z18.union([
|
|
|
316
316
|
source_simple_bug,
|
|
317
317
|
source_led,
|
|
318
318
|
source_simple_power_source,
|
|
319
|
-
source_simple_battery
|
|
319
|
+
source_simple_battery,
|
|
320
|
+
source_simple_inductor
|
|
320
321
|
]);
|
|
321
322
|
|
|
322
323
|
// src/source/source_port.ts
|
|
@@ -511,8 +512,29 @@ var schematic_error = z31.object({
|
|
|
511
512
|
message: z31.string()
|
|
512
513
|
}).describe("Defines a schematic error on the schematic");
|
|
513
514
|
|
|
514
|
-
// src/
|
|
515
|
+
// src/schematic/schematic_debug_object.ts
|
|
515
516
|
import { z as z32 } from "zod";
|
|
517
|
+
var schematic_debug_object_base = z32.object({
|
|
518
|
+
type: z32.literal("schematic_debug_object"),
|
|
519
|
+
label: z32.string().optional()
|
|
520
|
+
});
|
|
521
|
+
var schematic_debug_rect = schematic_debug_object_base.extend({
|
|
522
|
+
shape: z32.literal("rect"),
|
|
523
|
+
center: point,
|
|
524
|
+
size
|
|
525
|
+
});
|
|
526
|
+
var schematic_debug_line = schematic_debug_object_base.extend({
|
|
527
|
+
shape: z32.literal("line"),
|
|
528
|
+
start: point,
|
|
529
|
+
end: point
|
|
530
|
+
});
|
|
531
|
+
var schematic_debug_object = z32.discriminatedUnion("shape", [
|
|
532
|
+
schematic_debug_rect,
|
|
533
|
+
schematic_debug_line
|
|
534
|
+
]);
|
|
535
|
+
|
|
536
|
+
// src/pcb/properties/layer_ref.ts
|
|
537
|
+
import { z as z33 } from "zod";
|
|
516
538
|
var all_layers = [
|
|
517
539
|
"top",
|
|
518
540
|
"bottom",
|
|
@@ -523,9 +545,9 @@ var all_layers = [
|
|
|
523
545
|
"inner5",
|
|
524
546
|
"inner6"
|
|
525
547
|
];
|
|
526
|
-
var layer_string =
|
|
548
|
+
var layer_string = z33.enum(all_layers);
|
|
527
549
|
var layer_ref = layer_string.or(
|
|
528
|
-
|
|
550
|
+
z33.object({
|
|
529
551
|
name: layer_string
|
|
530
552
|
})
|
|
531
553
|
).transform((layer) => {
|
|
@@ -534,40 +556,40 @@ var layer_ref = layer_string.or(
|
|
|
534
556
|
}
|
|
535
557
|
return layer.name;
|
|
536
558
|
});
|
|
537
|
-
var visible_layer =
|
|
559
|
+
var visible_layer = z33.enum(["top", "bottom"]);
|
|
538
560
|
|
|
539
561
|
// src/pcb/properties/pcb_route_hints.ts
|
|
540
|
-
import { z as
|
|
541
|
-
var pcb_route_hint =
|
|
562
|
+
import { z as z34 } from "zod";
|
|
563
|
+
var pcb_route_hint = z34.object({
|
|
542
564
|
x: distance,
|
|
543
565
|
y: distance,
|
|
544
|
-
via:
|
|
566
|
+
via: z34.boolean().optional(),
|
|
545
567
|
via_to_layer: layer_ref.optional()
|
|
546
568
|
});
|
|
547
|
-
var pcb_route_hints =
|
|
569
|
+
var pcb_route_hints = z34.array(pcb_route_hint);
|
|
548
570
|
|
|
549
571
|
// src/pcb/properties/route_hint_point.ts
|
|
550
|
-
import { z as
|
|
551
|
-
var route_hint_point =
|
|
572
|
+
import { z as z35 } from "zod";
|
|
573
|
+
var route_hint_point = z35.object({
|
|
552
574
|
x: distance,
|
|
553
575
|
y: distance,
|
|
554
|
-
via:
|
|
576
|
+
via: z35.boolean().optional(),
|
|
555
577
|
to_layer: layer_ref.optional(),
|
|
556
578
|
trace_width: distance.optional()
|
|
557
579
|
});
|
|
558
580
|
|
|
559
581
|
// src/pcb/pcb_component.ts
|
|
560
|
-
import { z as
|
|
582
|
+
import { z as z36 } from "zod";
|
|
561
583
|
|
|
562
584
|
// src/utils/expect-types-match.ts
|
|
563
585
|
var expectTypesMatch = (shouldBe) => {
|
|
564
586
|
};
|
|
565
587
|
|
|
566
588
|
// src/pcb/pcb_component.ts
|
|
567
|
-
var pcb_component =
|
|
568
|
-
type:
|
|
589
|
+
var pcb_component = z36.object({
|
|
590
|
+
type: z36.literal("pcb_component"),
|
|
569
591
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
570
|
-
source_component_id:
|
|
592
|
+
source_component_id: z36.string(),
|
|
571
593
|
center: point,
|
|
572
594
|
layer: layer_ref,
|
|
573
595
|
rotation,
|
|
@@ -577,12 +599,12 @@ var pcb_component = z35.object({
|
|
|
577
599
|
expectTypesMatch(true);
|
|
578
600
|
|
|
579
601
|
// src/pcb/pcb_hole.ts
|
|
580
|
-
import { z as
|
|
581
|
-
var pcb_hole_circle_or_square =
|
|
582
|
-
type:
|
|
602
|
+
import { z as z37 } from "zod";
|
|
603
|
+
var pcb_hole_circle_or_square = z37.object({
|
|
604
|
+
type: z37.literal("pcb_hole"),
|
|
583
605
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
584
|
-
hole_shape:
|
|
585
|
-
hole_diameter:
|
|
606
|
+
hole_shape: z37.enum(["circle", "square"]),
|
|
607
|
+
hole_diameter: z37.number(),
|
|
586
608
|
x: distance,
|
|
587
609
|
y: distance
|
|
588
610
|
});
|
|
@@ -590,12 +612,12 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
|
|
|
590
612
|
"Defines a circular or square hole on the PCB"
|
|
591
613
|
);
|
|
592
614
|
expectTypesMatch(true);
|
|
593
|
-
var pcb_hole_oval =
|
|
594
|
-
type:
|
|
615
|
+
var pcb_hole_oval = z37.object({
|
|
616
|
+
type: z37.literal("pcb_hole"),
|
|
595
617
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
596
|
-
hole_shape:
|
|
597
|
-
hole_width:
|
|
598
|
-
hole_height:
|
|
618
|
+
hole_shape: z37.literal("oval"),
|
|
619
|
+
hole_width: z37.number(),
|
|
620
|
+
hole_height: z37.number(),
|
|
599
621
|
x: distance,
|
|
600
622
|
y: distance
|
|
601
623
|
});
|
|
@@ -606,36 +628,36 @@ expectTypesMatch(true);
|
|
|
606
628
|
var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
|
|
607
629
|
|
|
608
630
|
// src/pcb/pcb_plated_hole.ts
|
|
609
|
-
import { z as
|
|
610
|
-
var pcb_plated_hole_circle =
|
|
611
|
-
type:
|
|
612
|
-
shape:
|
|
613
|
-
outer_diameter:
|
|
614
|
-
hole_diameter:
|
|
631
|
+
import { z as z38 } from "zod";
|
|
632
|
+
var pcb_plated_hole_circle = z38.object({
|
|
633
|
+
type: z38.literal("pcb_plated_hole"),
|
|
634
|
+
shape: z38.literal("circle"),
|
|
635
|
+
outer_diameter: z38.number(),
|
|
636
|
+
hole_diameter: z38.number(),
|
|
615
637
|
x: distance,
|
|
616
638
|
y: distance,
|
|
617
|
-
layers:
|
|
618
|
-
port_hints:
|
|
619
|
-
pcb_component_id:
|
|
620
|
-
pcb_port_id:
|
|
639
|
+
layers: z38.array(layer_ref),
|
|
640
|
+
port_hints: z38.array(z38.string()).optional(),
|
|
641
|
+
pcb_component_id: z38.string().optional(),
|
|
642
|
+
pcb_port_id: z38.string().optional(),
|
|
621
643
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
622
644
|
});
|
|
623
|
-
var pcb_plated_hole_oval =
|
|
624
|
-
type:
|
|
625
|
-
shape:
|
|
626
|
-
outer_width:
|
|
627
|
-
outer_height:
|
|
628
|
-
hole_width:
|
|
629
|
-
hole_height:
|
|
645
|
+
var pcb_plated_hole_oval = z38.object({
|
|
646
|
+
type: z38.literal("pcb_plated_hole"),
|
|
647
|
+
shape: z38.enum(["oval", "pill"]),
|
|
648
|
+
outer_width: z38.number(),
|
|
649
|
+
outer_height: z38.number(),
|
|
650
|
+
hole_width: z38.number(),
|
|
651
|
+
hole_height: z38.number(),
|
|
630
652
|
x: distance,
|
|
631
653
|
y: distance,
|
|
632
|
-
layers:
|
|
633
|
-
port_hints:
|
|
634
|
-
pcb_component_id:
|
|
635
|
-
pcb_port_id:
|
|
654
|
+
layers: z38.array(layer_ref),
|
|
655
|
+
port_hints: z38.array(z38.string()).optional(),
|
|
656
|
+
pcb_component_id: z38.string().optional(),
|
|
657
|
+
pcb_port_id: z38.string().optional(),
|
|
636
658
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
637
659
|
});
|
|
638
|
-
var pcb_plated_hole =
|
|
660
|
+
var pcb_plated_hole = z38.union([
|
|
639
661
|
pcb_plated_hole_circle,
|
|
640
662
|
pcb_plated_hole_oval
|
|
641
663
|
]);
|
|
@@ -645,140 +667,140 @@ expectTypesMatch(
|
|
|
645
667
|
expectTypesMatch(true);
|
|
646
668
|
|
|
647
669
|
// src/pcb/pcb_port.ts
|
|
648
|
-
import { z as
|
|
649
|
-
var pcb_port =
|
|
650
|
-
type:
|
|
670
|
+
import { z as z39 } from "zod";
|
|
671
|
+
var pcb_port = z39.object({
|
|
672
|
+
type: z39.literal("pcb_port"),
|
|
651
673
|
pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
|
|
652
|
-
source_port_id:
|
|
653
|
-
pcb_component_id:
|
|
674
|
+
source_port_id: z39.string(),
|
|
675
|
+
pcb_component_id: z39.string(),
|
|
654
676
|
x: distance,
|
|
655
677
|
y: distance,
|
|
656
|
-
layers:
|
|
678
|
+
layers: z39.array(layer_ref)
|
|
657
679
|
}).describe("Defines a port on the PCB");
|
|
658
680
|
expectTypesMatch(true);
|
|
659
681
|
|
|
660
682
|
// src/pcb/pcb_smtpad.ts
|
|
661
|
-
import { z as
|
|
662
|
-
var pcb_smtpad_circle =
|
|
663
|
-
type:
|
|
664
|
-
shape:
|
|
683
|
+
import { z as z40 } from "zod";
|
|
684
|
+
var pcb_smtpad_circle = z40.object({
|
|
685
|
+
type: z40.literal("pcb_smtpad"),
|
|
686
|
+
shape: z40.literal("circle"),
|
|
665
687
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
666
688
|
x: distance,
|
|
667
689
|
y: distance,
|
|
668
|
-
radius:
|
|
690
|
+
radius: z40.number(),
|
|
669
691
|
layer: layer_ref,
|
|
670
|
-
port_hints:
|
|
671
|
-
pcb_component_id:
|
|
672
|
-
pcb_port_id:
|
|
692
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
693
|
+
pcb_component_id: z40.string().optional(),
|
|
694
|
+
pcb_port_id: z40.string().optional()
|
|
673
695
|
});
|
|
674
|
-
var pcb_smtpad_rect =
|
|
675
|
-
type:
|
|
676
|
-
shape:
|
|
696
|
+
var pcb_smtpad_rect = z40.object({
|
|
697
|
+
type: z40.literal("pcb_smtpad"),
|
|
698
|
+
shape: z40.literal("rect"),
|
|
677
699
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
678
700
|
x: distance,
|
|
679
701
|
y: distance,
|
|
680
|
-
width:
|
|
681
|
-
height:
|
|
702
|
+
width: z40.number(),
|
|
703
|
+
height: z40.number(),
|
|
682
704
|
layer: layer_ref,
|
|
683
|
-
port_hints:
|
|
684
|
-
pcb_component_id:
|
|
685
|
-
pcb_port_id:
|
|
705
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
706
|
+
pcb_component_id: z40.string().optional(),
|
|
707
|
+
pcb_port_id: z40.string().optional()
|
|
686
708
|
});
|
|
687
|
-
var pcb_smtpad =
|
|
709
|
+
var pcb_smtpad = z40.union([pcb_smtpad_circle, pcb_smtpad_rect]).describe("Defines an SMT pad on the PCB");
|
|
688
710
|
expectTypesMatch(true);
|
|
689
711
|
expectTypesMatch(true);
|
|
690
712
|
|
|
691
713
|
// src/pcb/pcb_solder_paste.ts
|
|
692
|
-
import { z as
|
|
693
|
-
var pcb_solder_paste_circle =
|
|
694
|
-
type:
|
|
695
|
-
shape:
|
|
714
|
+
import { z as z41 } from "zod";
|
|
715
|
+
var pcb_solder_paste_circle = z41.object({
|
|
716
|
+
type: z41.literal("pcb_solder_paste"),
|
|
717
|
+
shape: z41.literal("circle"),
|
|
696
718
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
697
719
|
x: distance,
|
|
698
720
|
y: distance,
|
|
699
|
-
radius:
|
|
721
|
+
radius: z41.number(),
|
|
700
722
|
layer: layer_ref,
|
|
701
|
-
pcb_component_id:
|
|
702
|
-
pcb_smtpad_id:
|
|
723
|
+
pcb_component_id: z41.string().optional(),
|
|
724
|
+
pcb_smtpad_id: z41.string().optional()
|
|
703
725
|
});
|
|
704
|
-
var pcb_solder_paste_rect =
|
|
705
|
-
type:
|
|
706
|
-
shape:
|
|
726
|
+
var pcb_solder_paste_rect = z41.object({
|
|
727
|
+
type: z41.literal("pcb_solder_paste"),
|
|
728
|
+
shape: z41.literal("rect"),
|
|
707
729
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
708
730
|
x: distance,
|
|
709
731
|
y: distance,
|
|
710
|
-
width:
|
|
711
|
-
height:
|
|
732
|
+
width: z41.number(),
|
|
733
|
+
height: z41.number(),
|
|
712
734
|
layer: layer_ref,
|
|
713
|
-
pcb_component_id:
|
|
714
|
-
pcb_smtpad_id:
|
|
735
|
+
pcb_component_id: z41.string().optional(),
|
|
736
|
+
pcb_smtpad_id: z41.string().optional()
|
|
715
737
|
});
|
|
716
|
-
var pcb_solder_paste =
|
|
738
|
+
var pcb_solder_paste = z41.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
|
|
717
739
|
expectTypesMatch(true);
|
|
718
740
|
expectTypesMatch(true);
|
|
719
741
|
|
|
720
742
|
// src/pcb/pcb_text.ts
|
|
721
|
-
import { z as
|
|
722
|
-
var pcb_text =
|
|
723
|
-
type:
|
|
743
|
+
import { z as z42 } from "zod";
|
|
744
|
+
var pcb_text = z42.object({
|
|
745
|
+
type: z42.literal("pcb_text"),
|
|
724
746
|
pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
|
|
725
|
-
text:
|
|
747
|
+
text: z42.string(),
|
|
726
748
|
center: point,
|
|
727
749
|
layer: layer_ref,
|
|
728
750
|
width: length,
|
|
729
751
|
height: length,
|
|
730
|
-
lines:
|
|
731
|
-
align:
|
|
752
|
+
lines: z42.number(),
|
|
753
|
+
align: z42.enum(["bottom-left"])
|
|
732
754
|
}).describe("Defines text on the PCB");
|
|
733
755
|
expectTypesMatch(true);
|
|
734
756
|
|
|
735
757
|
// src/pcb/pcb_trace.ts
|
|
736
|
-
import { z as
|
|
737
|
-
var pcb_trace_route_point_wire =
|
|
738
|
-
route_type:
|
|
758
|
+
import { z as z43 } from "zod";
|
|
759
|
+
var pcb_trace_route_point_wire = z43.object({
|
|
760
|
+
route_type: z43.literal("wire"),
|
|
739
761
|
x: distance,
|
|
740
762
|
y: distance,
|
|
741
763
|
width: distance,
|
|
742
|
-
start_pcb_port_id:
|
|
743
|
-
end_pcb_port_id:
|
|
764
|
+
start_pcb_port_id: z43.string().optional(),
|
|
765
|
+
end_pcb_port_id: z43.string().optional(),
|
|
744
766
|
layer: layer_ref
|
|
745
767
|
});
|
|
746
|
-
var pcb_trace_route_point_via =
|
|
747
|
-
route_type:
|
|
768
|
+
var pcb_trace_route_point_via = z43.object({
|
|
769
|
+
route_type: z43.literal("via"),
|
|
748
770
|
x: distance,
|
|
749
771
|
y: distance,
|
|
750
|
-
from_layer:
|
|
751
|
-
to_layer:
|
|
772
|
+
from_layer: z43.string(),
|
|
773
|
+
to_layer: z43.string()
|
|
752
774
|
});
|
|
753
|
-
var pcb_trace_route_point =
|
|
775
|
+
var pcb_trace_route_point = z43.union([
|
|
754
776
|
pcb_trace_route_point_wire,
|
|
755
777
|
pcb_trace_route_point_via
|
|
756
778
|
]);
|
|
757
|
-
var pcb_trace =
|
|
758
|
-
type:
|
|
759
|
-
source_trace_id:
|
|
760
|
-
pcb_component_id:
|
|
779
|
+
var pcb_trace = z43.object({
|
|
780
|
+
type: z43.literal("pcb_trace"),
|
|
781
|
+
source_trace_id: z43.string().optional(),
|
|
782
|
+
pcb_component_id: z43.string().optional(),
|
|
761
783
|
pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
|
|
762
|
-
route_thickness_mode:
|
|
763
|
-
route_order_index:
|
|
764
|
-
should_round_corners:
|
|
765
|
-
route:
|
|
766
|
-
|
|
767
|
-
|
|
768
|
-
route_type:
|
|
784
|
+
route_thickness_mode: z43.enum(["constant", "interpolated"]).default("constant").optional(),
|
|
785
|
+
route_order_index: z43.number().optional(),
|
|
786
|
+
should_round_corners: z43.boolean().optional(),
|
|
787
|
+
route: z43.array(
|
|
788
|
+
z43.union([
|
|
789
|
+
z43.object({
|
|
790
|
+
route_type: z43.literal("wire"),
|
|
769
791
|
x: distance,
|
|
770
792
|
y: distance,
|
|
771
793
|
width: distance,
|
|
772
|
-
start_pcb_port_id:
|
|
773
|
-
end_pcb_port_id:
|
|
794
|
+
start_pcb_port_id: z43.string().optional(),
|
|
795
|
+
end_pcb_port_id: z43.string().optional(),
|
|
774
796
|
layer: layer_ref
|
|
775
797
|
}),
|
|
776
|
-
|
|
777
|
-
route_type:
|
|
798
|
+
z43.object({
|
|
799
|
+
route_type: z43.literal("via"),
|
|
778
800
|
x: distance,
|
|
779
801
|
y: distance,
|
|
780
|
-
from_layer:
|
|
781
|
-
to_layer:
|
|
802
|
+
from_layer: z43.string(),
|
|
803
|
+
to_layer: z43.string()
|
|
782
804
|
})
|
|
783
805
|
])
|
|
784
806
|
)
|
|
@@ -787,34 +809,34 @@ expectTypesMatch(true);
|
|
|
787
809
|
expectTypesMatch(true);
|
|
788
810
|
|
|
789
811
|
// src/pcb/pcb_trace_error.ts
|
|
790
|
-
import { z as
|
|
791
|
-
var pcb_trace_error =
|
|
792
|
-
type:
|
|
812
|
+
import { z as z44 } from "zod";
|
|
813
|
+
var pcb_trace_error = z44.object({
|
|
814
|
+
type: z44.literal("pcb_trace_error"),
|
|
793
815
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
794
|
-
error_type:
|
|
795
|
-
message:
|
|
816
|
+
error_type: z44.literal("pcb_trace_error"),
|
|
817
|
+
message: z44.string(),
|
|
796
818
|
center: point.optional(),
|
|
797
|
-
pcb_trace_id:
|
|
798
|
-
source_trace_id:
|
|
799
|
-
pcb_component_ids:
|
|
800
|
-
pcb_port_ids:
|
|
819
|
+
pcb_trace_id: z44.string(),
|
|
820
|
+
source_trace_id: z44.string(),
|
|
821
|
+
pcb_component_ids: z44.array(z44.string()),
|
|
822
|
+
pcb_port_ids: z44.array(z44.string())
|
|
801
823
|
}).describe("Defines a trace error on the PCB");
|
|
802
824
|
expectTypesMatch(true);
|
|
803
825
|
|
|
804
826
|
// src/pcb/pcb_port_not_matched_error.ts
|
|
805
|
-
import { z as
|
|
806
|
-
var pcb_port_not_matched_error =
|
|
807
|
-
type:
|
|
827
|
+
import { z as z45 } from "zod";
|
|
828
|
+
var pcb_port_not_matched_error = z45.object({
|
|
829
|
+
type: z45.literal("pcb_port_not_matched_error"),
|
|
808
830
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
809
|
-
message:
|
|
810
|
-
pcb_component_ids:
|
|
831
|
+
message: z45.string(),
|
|
832
|
+
pcb_component_ids: z45.array(z45.string())
|
|
811
833
|
}).describe("Defines a trace error on the PCB where a port is not matched");
|
|
812
834
|
expectTypesMatch(true);
|
|
813
835
|
|
|
814
836
|
// src/pcb/pcb_via.ts
|
|
815
|
-
import { z as
|
|
816
|
-
var pcb_via =
|
|
817
|
-
type:
|
|
837
|
+
import { z as z46 } from "zod";
|
|
838
|
+
var pcb_via = z46.object({
|
|
839
|
+
type: z46.literal("pcb_via"),
|
|
818
840
|
pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
|
|
819
841
|
x: distance,
|
|
820
842
|
y: distance,
|
|
@@ -824,51 +846,51 @@ var pcb_via = z45.object({
|
|
|
824
846
|
from_layer: layer_ref.optional(),
|
|
825
847
|
/** @deprecated */
|
|
826
848
|
to_layer: layer_ref.optional(),
|
|
827
|
-
layers:
|
|
828
|
-
pcb_trace_id:
|
|
849
|
+
layers: z46.array(layer_ref),
|
|
850
|
+
pcb_trace_id: z46.string().optional()
|
|
829
851
|
}).describe("Defines a via on the PCB");
|
|
830
852
|
expectTypesMatch(true);
|
|
831
853
|
|
|
832
854
|
// src/pcb/pcb_board.ts
|
|
833
|
-
import { z as
|
|
834
|
-
var pcb_board =
|
|
835
|
-
type:
|
|
855
|
+
import { z as z47 } from "zod";
|
|
856
|
+
var pcb_board = z47.object({
|
|
857
|
+
type: z47.literal("pcb_board"),
|
|
836
858
|
pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
|
|
837
859
|
width: length,
|
|
838
860
|
height: length,
|
|
839
861
|
center: point,
|
|
840
862
|
thickness: length.optional().default(1.4),
|
|
841
|
-
num_layers:
|
|
842
|
-
outline:
|
|
863
|
+
num_layers: z47.number().optional().default(4),
|
|
864
|
+
outline: z47.array(point).optional()
|
|
843
865
|
}).describe("Defines the board outline of the PCB");
|
|
844
866
|
expectTypesMatch(true);
|
|
845
867
|
|
|
846
868
|
// src/pcb/pcb_placement_error.ts
|
|
847
|
-
import { z as
|
|
848
|
-
var pcb_placement_error =
|
|
849
|
-
type:
|
|
869
|
+
import { z as z48 } from "zod";
|
|
870
|
+
var pcb_placement_error = z48.object({
|
|
871
|
+
type: z48.literal("pcb_placement_error"),
|
|
850
872
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
851
|
-
message:
|
|
873
|
+
message: z48.string()
|
|
852
874
|
}).describe("Defines a placement error on the PCB");
|
|
853
875
|
expectTypesMatch(true);
|
|
854
876
|
|
|
855
877
|
// src/pcb/pcb_trace_hint.ts
|
|
856
|
-
import { z as
|
|
857
|
-
var pcb_trace_hint =
|
|
858
|
-
type:
|
|
878
|
+
import { z as z49 } from "zod";
|
|
879
|
+
var pcb_trace_hint = z49.object({
|
|
880
|
+
type: z49.literal("pcb_trace_hint"),
|
|
859
881
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
860
|
-
pcb_port_id:
|
|
861
|
-
pcb_component_id:
|
|
862
|
-
route:
|
|
882
|
+
pcb_port_id: z49.string(),
|
|
883
|
+
pcb_component_id: z49.string(),
|
|
884
|
+
route: z49.array(route_hint_point)
|
|
863
885
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
864
886
|
expectTypesMatch(true);
|
|
865
887
|
|
|
866
888
|
// src/pcb/pcb_silkscreen_line.ts
|
|
867
|
-
import { z as
|
|
868
|
-
var pcb_silkscreen_line =
|
|
869
|
-
type:
|
|
889
|
+
import { z as z50 } from "zod";
|
|
890
|
+
var pcb_silkscreen_line = z50.object({
|
|
891
|
+
type: z50.literal("pcb_silkscreen_line"),
|
|
870
892
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
871
|
-
pcb_component_id:
|
|
893
|
+
pcb_component_id: z50.string(),
|
|
872
894
|
stroke_width: distance.default("0.1mm"),
|
|
873
895
|
x1: distance,
|
|
874
896
|
y1: distance,
|
|
@@ -879,39 +901,39 @@ var pcb_silkscreen_line = z49.object({
|
|
|
879
901
|
expectTypesMatch(true);
|
|
880
902
|
|
|
881
903
|
// src/pcb/pcb_silkscreen_path.ts
|
|
882
|
-
import { z as
|
|
883
|
-
var pcb_silkscreen_path =
|
|
884
|
-
type:
|
|
904
|
+
import { z as z51 } from "zod";
|
|
905
|
+
var pcb_silkscreen_path = z51.object({
|
|
906
|
+
type: z51.literal("pcb_silkscreen_path"),
|
|
885
907
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
886
|
-
pcb_component_id:
|
|
908
|
+
pcb_component_id: z51.string(),
|
|
887
909
|
layer: visible_layer,
|
|
888
|
-
route:
|
|
910
|
+
route: z51.array(point),
|
|
889
911
|
stroke_width: length
|
|
890
912
|
}).describe("Defines a silkscreen path on the PCB");
|
|
891
913
|
expectTypesMatch(true);
|
|
892
914
|
|
|
893
915
|
// src/pcb/pcb_silkscreen_text.ts
|
|
894
|
-
import { z as
|
|
895
|
-
var pcb_silkscreen_text =
|
|
896
|
-
type:
|
|
916
|
+
import { z as z52 } from "zod";
|
|
917
|
+
var pcb_silkscreen_text = z52.object({
|
|
918
|
+
type: z52.literal("pcb_silkscreen_text"),
|
|
897
919
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
898
|
-
font:
|
|
920
|
+
font: z52.literal("tscircuit2024").default("tscircuit2024"),
|
|
899
921
|
font_size: distance.default("0.2mm"),
|
|
900
|
-
pcb_component_id:
|
|
901
|
-
text:
|
|
922
|
+
pcb_component_id: z52.string(),
|
|
923
|
+
text: z52.string(),
|
|
902
924
|
layer: layer_ref,
|
|
903
|
-
is_mirrored:
|
|
925
|
+
is_mirrored: z52.boolean().default(false).optional(),
|
|
904
926
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
905
|
-
anchor_alignment:
|
|
927
|
+
anchor_alignment: z52.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
|
|
906
928
|
}).describe("Defines silkscreen text on the PCB");
|
|
907
929
|
expectTypesMatch(true);
|
|
908
930
|
|
|
909
931
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
910
|
-
import { z as
|
|
911
|
-
var pcb_silkscreen_rect =
|
|
912
|
-
type:
|
|
932
|
+
import { z as z53 } from "zod";
|
|
933
|
+
var pcb_silkscreen_rect = z53.object({
|
|
934
|
+
type: z53.literal("pcb_silkscreen_rect"),
|
|
913
935
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
914
|
-
pcb_component_id:
|
|
936
|
+
pcb_component_id: z53.string(),
|
|
915
937
|
center: point,
|
|
916
938
|
width: length,
|
|
917
939
|
height: length,
|
|
@@ -920,13 +942,13 @@ var pcb_silkscreen_rect = z52.object({
|
|
|
920
942
|
expectTypesMatch(true);
|
|
921
943
|
|
|
922
944
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
923
|
-
import { z as
|
|
924
|
-
var pcb_silkscreen_circle =
|
|
925
|
-
type:
|
|
945
|
+
import { z as z54 } from "zod";
|
|
946
|
+
var pcb_silkscreen_circle = z54.object({
|
|
947
|
+
type: z54.literal("pcb_silkscreen_circle"),
|
|
926
948
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
927
949
|
"pcb_silkscreen_circle"
|
|
928
950
|
),
|
|
929
|
-
pcb_component_id:
|
|
951
|
+
pcb_component_id: z54.string(),
|
|
930
952
|
center: point,
|
|
931
953
|
radius: length,
|
|
932
954
|
layer: visible_layer
|
|
@@ -934,11 +956,11 @@ var pcb_silkscreen_circle = z53.object({
|
|
|
934
956
|
expectTypesMatch(true);
|
|
935
957
|
|
|
936
958
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
937
|
-
import { z as
|
|
938
|
-
var pcb_silkscreen_oval =
|
|
939
|
-
type:
|
|
959
|
+
import { z as z55 } from "zod";
|
|
960
|
+
var pcb_silkscreen_oval = z55.object({
|
|
961
|
+
type: z55.literal("pcb_silkscreen_oval"),
|
|
940
962
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
941
|
-
pcb_component_id:
|
|
963
|
+
pcb_component_id: z55.string(),
|
|
942
964
|
center: point,
|
|
943
965
|
radius_x: distance,
|
|
944
966
|
radius_y: distance,
|
|
@@ -947,91 +969,91 @@ var pcb_silkscreen_oval = z54.object({
|
|
|
947
969
|
expectTypesMatch(true);
|
|
948
970
|
|
|
949
971
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
950
|
-
import { z as
|
|
951
|
-
var pcb_fabrication_note_text =
|
|
952
|
-
type:
|
|
972
|
+
import { z as z56 } from "zod";
|
|
973
|
+
var pcb_fabrication_note_text = z56.object({
|
|
974
|
+
type: z56.literal("pcb_fabrication_note_text"),
|
|
953
975
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
954
976
|
"pcb_fabrication_note_text"
|
|
955
977
|
),
|
|
956
|
-
font:
|
|
978
|
+
font: z56.literal("tscircuit2024").default("tscircuit2024"),
|
|
957
979
|
font_size: distance.default("1mm"),
|
|
958
|
-
pcb_component_id:
|
|
959
|
-
text:
|
|
980
|
+
pcb_component_id: z56.string(),
|
|
981
|
+
text: z56.string(),
|
|
960
982
|
layer: visible_layer,
|
|
961
983
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
962
|
-
anchor_alignment:
|
|
963
|
-
color:
|
|
984
|
+
anchor_alignment: z56.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
985
|
+
color: z56.string().optional()
|
|
964
986
|
}).describe(
|
|
965
987
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
966
988
|
);
|
|
967
989
|
expectTypesMatch(true);
|
|
968
990
|
|
|
969
991
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
970
|
-
import { z as
|
|
971
|
-
var pcb_fabrication_note_path =
|
|
972
|
-
type:
|
|
992
|
+
import { z as z57 } from "zod";
|
|
993
|
+
var pcb_fabrication_note_path = z57.object({
|
|
994
|
+
type: z57.literal("pcb_fabrication_note_path"),
|
|
973
995
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
974
996
|
"pcb_fabrication_note_path"
|
|
975
997
|
),
|
|
976
|
-
pcb_component_id:
|
|
998
|
+
pcb_component_id: z57.string(),
|
|
977
999
|
layer: layer_ref,
|
|
978
|
-
route:
|
|
1000
|
+
route: z57.array(point),
|
|
979
1001
|
stroke_width: length,
|
|
980
|
-
color:
|
|
1002
|
+
color: z57.string().optional()
|
|
981
1003
|
}).describe(
|
|
982
1004
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
983
1005
|
);
|
|
984
1006
|
expectTypesMatch(true);
|
|
985
1007
|
|
|
986
1008
|
// src/pcb/pcb_keepout.ts
|
|
987
|
-
import { z as
|
|
988
|
-
var pcb_keepout =
|
|
989
|
-
type:
|
|
990
|
-
shape:
|
|
1009
|
+
import { z as z58 } from "zod";
|
|
1010
|
+
var pcb_keepout = z58.object({
|
|
1011
|
+
type: z58.literal("pcb_keepout"),
|
|
1012
|
+
shape: z58.literal("rect"),
|
|
991
1013
|
center: point,
|
|
992
1014
|
width: distance,
|
|
993
1015
|
height: distance,
|
|
994
|
-
pcb_keepout_id:
|
|
995
|
-
layers:
|
|
1016
|
+
pcb_keepout_id: z58.string(),
|
|
1017
|
+
layers: z58.array(z58.string()),
|
|
996
1018
|
// Specify layers where the keepout applies
|
|
997
|
-
description:
|
|
1019
|
+
description: z58.string().optional()
|
|
998
1020
|
// Optional description of the keepout
|
|
999
1021
|
}).or(
|
|
1000
|
-
|
|
1001
|
-
type:
|
|
1002
|
-
shape:
|
|
1022
|
+
z58.object({
|
|
1023
|
+
type: z58.literal("pcb_keepout"),
|
|
1024
|
+
shape: z58.literal("circle"),
|
|
1003
1025
|
center: point,
|
|
1004
1026
|
radius: distance,
|
|
1005
|
-
pcb_keepout_id:
|
|
1006
|
-
layers:
|
|
1027
|
+
pcb_keepout_id: z58.string(),
|
|
1028
|
+
layers: z58.array(z58.string()),
|
|
1007
1029
|
// Specify layers where the keepout applies
|
|
1008
|
-
description:
|
|
1030
|
+
description: z58.string().optional()
|
|
1009
1031
|
// Optional description of the keepout
|
|
1010
1032
|
})
|
|
1011
1033
|
);
|
|
1012
1034
|
|
|
1013
1035
|
// src/cad/cad_component.ts
|
|
1014
|
-
import { z as
|
|
1015
|
-
var cad_component =
|
|
1016
|
-
type:
|
|
1017
|
-
cad_component_id:
|
|
1018
|
-
pcb_component_id:
|
|
1019
|
-
source_component_id:
|
|
1036
|
+
import { z as z59 } from "zod";
|
|
1037
|
+
var cad_component = z59.object({
|
|
1038
|
+
type: z59.literal("cad_component"),
|
|
1039
|
+
cad_component_id: z59.string(),
|
|
1040
|
+
pcb_component_id: z59.string(),
|
|
1041
|
+
source_component_id: z59.string(),
|
|
1020
1042
|
position: point3,
|
|
1021
1043
|
rotation: point3.optional(),
|
|
1022
1044
|
size: point3.optional(),
|
|
1023
1045
|
layer: layer_ref.optional(),
|
|
1024
1046
|
// These are all ways to generate/load the 3d model
|
|
1025
|
-
footprinter_string:
|
|
1026
|
-
model_obj_url:
|
|
1027
|
-
model_stl_url:
|
|
1028
|
-
model_3mf_url:
|
|
1029
|
-
model_jscad:
|
|
1047
|
+
footprinter_string: z59.string().optional(),
|
|
1048
|
+
model_obj_url: z59.string().optional(),
|
|
1049
|
+
model_stl_url: z59.string().optional(),
|
|
1050
|
+
model_3mf_url: z59.string().optional(),
|
|
1051
|
+
model_jscad: z59.any().optional()
|
|
1030
1052
|
}).describe("Defines a component on the PCB");
|
|
1031
1053
|
|
|
1032
1054
|
// src/any_circuit_element.ts
|
|
1033
|
-
import { z as
|
|
1034
|
-
var any_circuit_element =
|
|
1055
|
+
import { z as z60 } from "zod";
|
|
1056
|
+
var any_circuit_element = z60.union([
|
|
1035
1057
|
source_trace,
|
|
1036
1058
|
source_port,
|
|
1037
1059
|
any_source_component,
|
|
@@ -1077,6 +1099,7 @@ var any_circuit_element = z59.union([
|
|
|
1077
1099
|
schematic_path,
|
|
1078
1100
|
schematic_error,
|
|
1079
1101
|
schematic_net_label,
|
|
1102
|
+
schematic_debug_object,
|
|
1080
1103
|
cad_component
|
|
1081
1104
|
]);
|
|
1082
1105
|
var any_soup_element = any_circuit_element;
|
|
@@ -1134,6 +1157,10 @@ export {
|
|
|
1134
1157
|
route_hint_point,
|
|
1135
1158
|
schematic_box,
|
|
1136
1159
|
schematic_component,
|
|
1160
|
+
schematic_debug_line,
|
|
1161
|
+
schematic_debug_object,
|
|
1162
|
+
schematic_debug_object_base,
|
|
1163
|
+
schematic_debug_rect,
|
|
1137
1164
|
schematic_error,
|
|
1138
1165
|
schematic_line,
|
|
1139
1166
|
schematic_net_label,
|
|
@@ -1154,6 +1181,7 @@ export {
|
|
|
1154
1181
|
source_simple_chip,
|
|
1155
1182
|
source_simple_diode,
|
|
1156
1183
|
source_simple_ground,
|
|
1184
|
+
source_simple_inductor,
|
|
1157
1185
|
source_simple_power_source,
|
|
1158
1186
|
source_simple_resistor,
|
|
1159
1187
|
source_trace,
|