@tscircuit/props 0.0.110 → 0.0.112

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.js CHANGED
@@ -2,13 +2,13 @@
2
2
  import {
3
3
  distance as distance12,
4
4
  inductance,
5
- layer_ref as layer_ref3,
5
+ layer_ref as layer_ref4,
6
6
  length as length3,
7
- point as point2,
8
- route_hint_point as route_hint_point2,
7
+ point as point5,
8
+ route_hint_point as route_hint_point4,
9
9
  voltage
10
10
  } from "circuit-json";
11
- import { z as z31 } from "zod";
11
+ import { z as z40 } from "zod";
12
12
 
13
13
  // lib/typecheck.ts
14
14
  var expectTypesMatch = (shouldBe) => {
@@ -574,6 +574,103 @@ var pushButtonProps = commonComponentProps.extend({});
574
574
  var subcircuitProps = subcircuitGroupProps;
575
575
  expectTypesMatch(true);
576
576
 
577
+ // lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
578
+ import { z as z31 } from "zod";
579
+ var base_manual_edit_event = z31.object({
580
+ edit_event_id: z31.string(),
581
+ in_progress: z31.boolean().optional(),
582
+ created_at: z31.number()
583
+ });
584
+ expectTypesMatch(
585
+ true
586
+ );
587
+
588
+ // lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
589
+ import { z as z32 } from "zod";
590
+ var edit_pcb_component_location_event = base_manual_edit_event.extend({
591
+ pcb_edit_event_type: z32.literal("edit_component_location").describe("deprecated"),
592
+ edit_event_type: z32.literal("edit_pcb_component_location"),
593
+ pcb_component_id: z32.string(),
594
+ original_center: z32.object({ x: z32.number(), y: z32.number() }),
595
+ new_center: z32.object({ x: z32.number(), y: z32.number() })
596
+ });
597
+ var edit_component_location_event = edit_pcb_component_location_event;
598
+ expectTypesMatch(true);
599
+
600
+ // lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
601
+ import { z as z33 } from "zod";
602
+ import "circuit-json";
603
+ var edit_trace_hint_event = base_manual_edit_event.extend({
604
+ pcb_edit_event_type: z33.literal("edit_trace_hint"),
605
+ pcb_port_id: z33.string(),
606
+ pcb_trace_hint_id: z33.string().optional(),
607
+ route: z33.array(
608
+ z33.object({ x: z33.number(), y: z33.number(), via: z33.boolean().optional() })
609
+ )
610
+ });
611
+ expectTypesMatch(
612
+ true
613
+ );
614
+
615
+ // lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
616
+ import { z as z34 } from "zod";
617
+ var edit_schematic_component_location_event = base_manual_edit_event.extend({
618
+ edit_event_type: z34.literal("edit_schematic_component_location"),
619
+ schematic_component_id: z34.string(),
620
+ original_center: z34.object({ x: z34.number(), y: z34.number() }),
621
+ new_center: z34.object({ x: z34.number(), y: z34.number() })
622
+ });
623
+ expectTypesMatch(true);
624
+
625
+ // lib/manual-edits/manual_edit_file.ts
626
+ import { z as z39 } from "zod";
627
+
628
+ // lib/manual-edits/manual_pcb_placement.ts
629
+ import { z as z35 } from "zod";
630
+ import { point as point2 } from "circuit-json";
631
+ var manual_pcb_placement = z35.object({
632
+ selector: z35.string(),
633
+ relative_to: z35.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
634
+ center: point2
635
+ });
636
+ expectTypesMatch(true);
637
+
638
+ // lib/manual-edits/manual_edit_event.ts
639
+ import { z as z36 } from "zod";
640
+ var manual_edit_event = z36.union([
641
+ edit_component_location_event,
642
+ edit_trace_hint_event
643
+ ]);
644
+ expectTypesMatch(true);
645
+
646
+ // lib/manual-edits/manual_trace_hint.ts
647
+ import { z as z37 } from "zod";
648
+ import { route_hint_point as route_hint_point3 } from "circuit-json";
649
+ var manual_trace_hint = z37.object({
650
+ pcb_port_selector: z37.string(),
651
+ offsets: z37.array(route_hint_point3)
652
+ });
653
+ expectTypesMatch(true);
654
+
655
+ // lib/manual-edits/manual_schematic_placement.ts
656
+ import { z as z38 } from "zod";
657
+ import { point as point4 } from "circuit-json";
658
+ var manual_schematic_placement = z38.object({
659
+ selector: z38.string(),
660
+ relative_to: z38.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
661
+ center: point4
662
+ });
663
+ expectTypesMatch(
664
+ true
665
+ );
666
+
667
+ // lib/manual-edits/manual_edit_file.ts
668
+ var manual_edit_file = z39.object({
669
+ pcb_placements: z39.array(manual_pcb_placement).optional(),
670
+ manual_trace_hints: z39.array(manual_trace_hint).optional(),
671
+ schematic_placements: z39.array(manual_schematic_placement).optional()
672
+ });
673
+
577
674
  // lib/index.ts
578
675
  var inductorProps = commonComponentProps.extend({
579
676
  inductance
@@ -582,72 +679,72 @@ var inductorPins = lrPins;
582
679
  var diodeProps = commonComponentProps.extend({});
583
680
  var diodePins = lrPolarPins;
584
681
  var ledProps = commonComponentProps.extend({
585
- color: z31.string().optional()
682
+ color: z40.string().optional()
586
683
  });
587
684
  var ledPins = lrPolarPins;
588
685
  var switchProps = commonComponentProps.extend({
589
- ftype: z31.literal("switch"),
590
- switchType: z31.enum(["spst"]).default("spst"),
591
- isNormallyClosed: z31.boolean().default(false)
686
+ ftype: z40.literal("switch"),
687
+ switchType: z40.enum(["spst"]).default("spst"),
688
+ isNormallyClosed: z40.boolean().default(false)
592
689
  });
593
- var distanceOrMultiplier2 = distance12.or(z31.enum(["2x", "3x", "4x"]));
690
+ var distanceOrMultiplier2 = distance12.or(z40.enum(["2x", "3x", "4x"]));
594
691
  var viaProps = commonLayoutProps.extend({
595
- fromLayer: layer_ref3,
596
- toLayer: layer_ref3,
692
+ fromLayer: layer_ref4,
693
+ toLayer: layer_ref4,
597
694
  holeDiameter: distance12,
598
695
  outerDiameter: distance12
599
696
  });
600
- var pcbKeepoutProps = z31.union([
697
+ var pcbKeepoutProps = z40.union([
601
698
  pcbLayoutProps.omit({ pcbRotation: true }).extend({
602
- shape: z31.literal("circle"),
699
+ shape: z40.literal("circle"),
603
700
  radius: distance12
604
701
  }),
605
702
  pcbLayoutProps.extend({
606
- shape: z31.literal("rect"),
703
+ shape: z40.literal("rect"),
607
704
  width: distance12,
608
705
  height: distance12
609
706
  })
610
707
  ]);
611
- var schematicBoxProps = z31.object({
708
+ var schematicBoxProps = z40.object({
612
709
  schX: distance12,
613
710
  schY: distance12,
614
711
  width: distance12,
615
712
  height: distance12
616
713
  });
617
- var schematicTextProps = z31.object({
714
+ var schematicTextProps = z40.object({
618
715
  schX: distance12,
619
716
  schY: distance12,
620
- text: z31.string()
717
+ text: z40.string()
621
718
  });
622
- var schematicLineProps = z31.object({
719
+ var schematicLineProps = z40.object({
623
720
  x1: distance12,
624
721
  y1: distance12,
625
722
  x2: distance12,
626
723
  y2: distance12
627
724
  });
628
- var schematicPathProps = z31.object({
629
- points: z31.array(point2),
630
- isFilled: z31.boolean().optional().default(false),
631
- fillColor: z31.enum(["red", "blue"]).optional()
725
+ var schematicPathProps = z40.object({
726
+ points: z40.array(point5),
727
+ isFilled: z40.boolean().optional().default(false),
728
+ fillColor: z40.enum(["red", "blue"]).optional()
632
729
  });
633
730
  var componentProps = commonComponentProps;
634
731
  var powerSourceProps = commonComponentProps.extend({
635
732
  voltage
636
733
  });
637
734
  var portProps = commonLayoutProps.extend({
638
- name: z31.string(),
639
- pinNumber: z31.number().optional(),
640
- aliases: z31.array(z31.string()).optional(),
735
+ name: z40.string(),
736
+ pinNumber: z40.number().optional(),
737
+ aliases: z40.array(z40.string()).optional(),
641
738
  direction
642
739
  });
643
740
  var silkscreenTextProps = pcbLayoutProps.extend({
644
- text: z31.string(),
645
- anchorAlignment: z31.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
646
- font: z31.enum(["tscircuit2024"]).optional(),
741
+ text: z40.string(),
742
+ anchorAlignment: z40.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
743
+ font: z40.enum(["tscircuit2024"]).optional(),
647
744
  fontSize: length3.optional()
648
745
  });
649
746
  var silkscreenPathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
650
- route: z31.array(route_hint_point2),
747
+ route: z40.array(route_hint_point4),
651
748
  strokeWidth: length3.optional()
652
749
  });
653
750
  var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
@@ -658,54 +755,55 @@ var silkscreenLineProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotat
658
755
  y2: distance12
659
756
  });
660
757
  var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
661
- isFilled: z31.boolean().optional(),
662
- isOutline: z31.boolean().optional(),
758
+ isFilled: z40.boolean().optional(),
759
+ isOutline: z40.boolean().optional(),
663
760
  strokeWidth: distance12.optional(),
664
761
  width: distance12,
665
762
  height: distance12
666
763
  });
667
764
  var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
668
- isFilled: z31.boolean().optional(),
669
- isOutline: z31.boolean().optional(),
765
+ isFilled: z40.boolean().optional(),
766
+ isOutline: z40.boolean().optional(),
670
767
  strokeWidth: distance12.optional(),
671
768
  radius: distance12
672
769
  });
673
- var routeHintPointProps = z31.object({
770
+ var routeHintPointProps = z40.object({
674
771
  x: distance12,
675
772
  y: distance12,
676
- via: z31.boolean().optional(),
677
- toLayer: layer_ref3.optional()
773
+ via: z40.boolean().optional(),
774
+ toLayer: layer_ref4.optional()
678
775
  });
679
- var traceHintProps = z31.object({
680
- for: z31.string().optional().describe(
776
+ var traceHintProps = z40.object({
777
+ for: z40.string().optional().describe(
681
778
  "Selector for the port you're targeting, not required if you're inside a trace"
682
779
  ),
683
- order: z31.number().optional(),
684
- offset: route_hint_point2.or(routeHintPointProps).optional(),
685
- offsets: z31.array(route_hint_point2).or(z31.array(routeHintPointProps)).optional(),
686
- traceWidth: z31.number().optional()
780
+ order: z40.number().optional(),
781
+ offset: route_hint_point4.or(routeHintPointProps).optional(),
782
+ offsets: z40.array(route_hint_point4).or(z40.array(routeHintPointProps)).optional(),
783
+ traceWidth: z40.number().optional()
687
784
  });
688
- var pcbTraceProps = z31.object({
689
- layer: z31.string().optional(),
785
+ var pcbTraceProps = z40.object({
786
+ layer: z40.string().optional(),
690
787
  thickness: distance12.optional(),
691
- route: z31.array(route_hint_point2)
788
+ route: z40.array(route_hint_point4)
692
789
  });
693
790
  var fabricationNoteTextProps = pcbLayoutProps.extend({
694
- text: z31.string(),
695
- anchorAlignment: z31.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
696
- font: z31.enum(["tscircuit2024"]).optional(),
791
+ text: z40.string(),
792
+ anchorAlignment: z40.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
793
+ font: z40.enum(["tscircuit2024"]).optional(),
697
794
  fontSize: length3.optional(),
698
- color: z31.string().optional()
795
+ color: z40.string().optional()
699
796
  });
700
797
  var fabricationNotePathProps = pcbLayoutProps.omit({ pcbX: true, pcbY: true, pcbRotation: true }).extend({
701
- route: z31.array(route_hint_point2),
798
+ route: z40.array(route_hint_point4),
702
799
  strokeWidth: length3.optional(),
703
- color: z31.string().optional()
800
+ color: z40.string().optional()
704
801
  });
705
802
  export {
706
803
  autorouterConfig,
707
804
  autorouterProp,
708
805
  baseGroupProps,
806
+ base_manual_edit_event,
709
807
  batteryPins,
710
808
  batteryProps,
711
809
  boardProps,
@@ -732,6 +830,10 @@ export {
732
830
  direction,
733
831
  directionAlongEdge,
734
832
  distanceOrMultiplier2 as distanceOrMultiplier,
833
+ edit_component_location_event,
834
+ edit_pcb_component_location_event,
835
+ edit_schematic_component_location_event,
836
+ edit_trace_hint_event,
735
837
  explicitPinSideDefinition,
736
838
  fabricationNotePathProps,
737
839
  fabricationNoteTextProps,
@@ -746,6 +848,10 @@ export {
746
848
  ledProps,
747
849
  lrPins,
748
850
  lrPolarPins,
851
+ manual_edit_file,
852
+ manual_pcb_placement,
853
+ manual_schematic_placement,
854
+ manual_trace_hint,
749
855
  netAliasProps,
750
856
  netProps,
751
857
  pcbKeepoutProps,