@tscircuit/core 0.0.90 → 0.0.92

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/dist/index.d.ts CHANGED
@@ -89,6 +89,7 @@ declare abstract class Renderable implements IRenderable {
89
89
  }
90
90
 
91
91
  interface BaseComponentConfig {
92
+ componentName: string;
92
93
  schematicSymbolName?: BaseSymbolName | null;
93
94
  zodProps: ZodType;
94
95
  sourceFtype?: AnySourceComponent["ftype"] | null;
@@ -105,8 +106,8 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
105
106
  get config(): BaseComponentConfig;
106
107
  props: z.input<ZodProps>;
107
108
  _parsedProps: z.infer<ZodProps>;
108
- componentName: string;
109
- lowercaseComponentName: string;
109
+ get componentName(): string;
110
+ get lowercaseComponentName(): string;
110
111
  externallyAddedAliases: string[];
111
112
  /**
112
113
  * An subcircuit is self-contained. All the selectors inside
@@ -261,6 +262,16 @@ declare const netProps: z.ZodObject<{
261
262
  }>;
262
263
  declare class Net extends PrimitiveComponent<typeof netProps> {
263
264
  source_net_id?: string;
265
+ get config(): {
266
+ componentName: string;
267
+ zodProps: z.ZodObject<{
268
+ name: z.ZodString;
269
+ }, "strip", z.ZodTypeAny, {
270
+ name: string;
271
+ }, {
272
+ name: string;
273
+ }>;
274
+ };
264
275
  getPortSelector(): string;
265
276
  doInitialSourceRender(): void;
266
277
  /**
@@ -471,6 +482,7 @@ declare class Trace extends PrimitiveComponent<typeof traceProps> {
471
482
  } | undefined;
472
483
  }[] | undefined;
473
484
  }>]>;
485
+ componentName: string;
474
486
  };
475
487
  _getTracePortOrNetSelectorListFromProps(): string[];
476
488
  getTracePortPathSelectors(): string[];
@@ -534,6 +546,22 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
534
546
  schematicSymbolPortDef: SchSymbol["ports"][number] | null;
535
547
  matchedComponents: PrimitiveComponent[];
536
548
  facingDirection: "up" | "down" | "left" | "right" | null;
549
+ get config(): {
550
+ componentName: string;
551
+ zodProps: z.ZodObject<{
552
+ name: z.ZodOptional<z.ZodString>;
553
+ pinNumber: z.ZodOptional<z.ZodNumber>;
554
+ aliases: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
555
+ }, "strip", z.ZodTypeAny, {
556
+ name?: string | undefined;
557
+ pinNumber?: number | undefined;
558
+ aliases?: string[] | undefined;
559
+ }, {
560
+ name?: string | undefined;
561
+ pinNumber?: number | undefined;
562
+ aliases?: string[] | undefined;
563
+ }>;
564
+ };
537
565
  constructor(props: z.input<typeof portProps>);
538
566
  _getGlobalPcbPositionBeforeLayout(): {
539
567
  x: number;
@@ -684,6 +712,7 @@ declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends
684
712
  declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps> extends NormalComponent<Props> {
685
713
  get config(): {
686
714
  zodProps: Props;
715
+ componentName: string;
687
716
  };
688
717
  doInitialCreateTraceHintsFromProps(): void;
689
718
  }
@@ -692,6 +721,7 @@ declare class Board extends Group<typeof boardProps> {
692
721
  pcb_board_id: string | null;
693
722
  get isSubcircuit(): boolean;
694
723
  get config(): {
724
+ componentName: string;
695
725
  zodProps: z.ZodObject<{
696
726
  width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
697
727
  height: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -750,6 +780,10 @@ declare class Board extends Group<typeof boardProps> {
750
780
  }
751
781
 
752
782
  declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
783
+ get config(): {
784
+ componentName: string;
785
+ zodProps: zod.ZodObject<{}, "strip", zod.ZodTypeAny, {}, {}>;
786
+ };
753
787
  /**
754
788
  * A footprint is a constrainedlayout, the db elements are adjusted according
755
789
  * to any constraints that are defined.
@@ -762,6 +796,7 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
762
796
  matchedPort: Port | null;
763
797
  isPcbPrimitive: boolean;
764
798
  get config(): {
799
+ componentName: string;
765
800
  zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
766
801
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
767
802
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -867,6 +902,7 @@ type PolarizedPassivePorts = PassivePorts | "anode" | "cathode" | "pos" | "neg";
867
902
 
868
903
  declare class Resistor extends NormalComponent<typeof resistorProps, PassivePorts> {
869
904
  get config(): {
905
+ componentName: string;
870
906
  schematicSymbolName: BaseSymbolName;
871
907
  zodProps: z.ZodObject<z.objectUtil.extendShape<z.objectUtil.extendShape<z.objectUtil.extendShape<{
872
908
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -1288,6 +1324,7 @@ declare class Resistor extends NormalComponent<typeof resistorProps, PassivePort
1288
1324
 
1289
1325
  declare class Led extends NormalComponent<typeof ledProps, PolarizedPassivePorts> {
1290
1326
  get config(): {
1327
+ componentName: string;
1291
1328
  schematicSymbolName: BaseSymbolName;
1292
1329
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
1293
1330
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -1700,6 +1737,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, TwoPinPorts> {
1700
1737
  pin1: Port;
1701
1738
  pin2: Port;
1702
1739
  get config(): {
1740
+ componentName: string;
1703
1741
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
1704
1742
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
1705
1743
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -2101,6 +2139,7 @@ declare class Diode extends NormalComponent<typeof diodeProps, TwoPinPorts> {
2101
2139
  type PortNames = "1" | "2" | "pin1" | "pin2" | "left" | "right" | "anode" | "cathode";
2102
2140
  declare class Capacitor extends NormalComponent<typeof capacitorProps, PortNames> {
2103
2141
  get config(): {
2142
+ componentName: string;
2104
2143
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
2105
2144
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2106
2145
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -2509,6 +2548,186 @@ declare class Capacitor extends NormalComponent<typeof capacitorProps, PortNames
2509
2548
 
2510
2549
  declare class TraceHint extends PrimitiveComponent<typeof traceHintProps> {
2511
2550
  matchedPort: Port | null;
2551
+ get config(): {
2552
+ componentName: string;
2553
+ zodProps: zod.ZodObject<{
2554
+ for: zod.ZodOptional<zod.ZodString>;
2555
+ order: zod.ZodOptional<zod.ZodNumber>;
2556
+ offset: zod.ZodOptional<zod.ZodUnion<[zod.ZodObject<{
2557
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2558
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2559
+ via: zod.ZodOptional<zod.ZodBoolean>;
2560
+ to_layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
2561
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
2562
+ }, "strip", zod.ZodTypeAny, {
2563
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2564
+ }, {
2565
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2566
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2567
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2568
+ }>>;
2569
+ trace_width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2570
+ }, "strip", zod.ZodTypeAny, {
2571
+ x: number;
2572
+ y: number;
2573
+ trace_width?: number | undefined;
2574
+ via?: boolean | undefined;
2575
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2576
+ }, {
2577
+ x: string | number;
2578
+ y: string | number;
2579
+ trace_width?: string | number | undefined;
2580
+ via?: boolean | undefined;
2581
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2582
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2583
+ } | undefined;
2584
+ }>, zod.ZodObject<{
2585
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2586
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2587
+ via: zod.ZodOptional<zod.ZodBoolean>;
2588
+ toLayer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
2589
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
2590
+ }, "strip", zod.ZodTypeAny, {
2591
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2592
+ }, {
2593
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2594
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2595
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2596
+ }>>;
2597
+ }, "strip", zod.ZodTypeAny, {
2598
+ x: number;
2599
+ y: number;
2600
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2601
+ via?: boolean | undefined;
2602
+ }, {
2603
+ x: string | number;
2604
+ y: string | number;
2605
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2606
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2607
+ } | undefined;
2608
+ via?: boolean | undefined;
2609
+ }>]>>;
2610
+ offsets: zod.ZodOptional<zod.ZodUnion<[zod.ZodArray<zod.ZodObject<{
2611
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2612
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2613
+ via: zod.ZodOptional<zod.ZodBoolean>;
2614
+ to_layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
2615
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
2616
+ }, "strip", zod.ZodTypeAny, {
2617
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2618
+ }, {
2619
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2620
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2621
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2622
+ }>>;
2623
+ trace_width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2624
+ }, "strip", zod.ZodTypeAny, {
2625
+ x: number;
2626
+ y: number;
2627
+ trace_width?: number | undefined;
2628
+ via?: boolean | undefined;
2629
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2630
+ }, {
2631
+ x: string | number;
2632
+ y: string | number;
2633
+ trace_width?: string | number | undefined;
2634
+ via?: boolean | undefined;
2635
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2636
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2637
+ } | undefined;
2638
+ }>, "many">, zod.ZodArray<zod.ZodObject<{
2639
+ x: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2640
+ y: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
2641
+ via: zod.ZodOptional<zod.ZodBoolean>;
2642
+ toLayer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
2643
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
2644
+ }, "strip", zod.ZodTypeAny, {
2645
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2646
+ }, {
2647
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2648
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2649
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2650
+ }>>;
2651
+ }, "strip", zod.ZodTypeAny, {
2652
+ x: number;
2653
+ y: number;
2654
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2655
+ via?: boolean | undefined;
2656
+ }, {
2657
+ x: string | number;
2658
+ y: string | number;
2659
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2660
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2661
+ } | undefined;
2662
+ via?: boolean | undefined;
2663
+ }>, "many">]>>;
2664
+ traceWidth: zod.ZodOptional<zod.ZodNumber>;
2665
+ }, "strip", zod.ZodTypeAny, {
2666
+ for?: string | undefined;
2667
+ order?: number | undefined;
2668
+ offset?: {
2669
+ x: number;
2670
+ y: number;
2671
+ trace_width?: number | undefined;
2672
+ via?: boolean | undefined;
2673
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2674
+ } | {
2675
+ x: number;
2676
+ y: number;
2677
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2678
+ via?: boolean | undefined;
2679
+ } | undefined;
2680
+ offsets?: {
2681
+ x: number;
2682
+ y: number;
2683
+ trace_width?: number | undefined;
2684
+ via?: boolean | undefined;
2685
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2686
+ }[] | {
2687
+ x: number;
2688
+ y: number;
2689
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
2690
+ via?: boolean | undefined;
2691
+ }[] | undefined;
2692
+ traceWidth?: number | undefined;
2693
+ }, {
2694
+ for?: string | undefined;
2695
+ order?: number | undefined;
2696
+ offset?: {
2697
+ x: string | number;
2698
+ y: string | number;
2699
+ trace_width?: string | number | undefined;
2700
+ via?: boolean | undefined;
2701
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2702
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2703
+ } | undefined;
2704
+ } | {
2705
+ x: string | number;
2706
+ y: string | number;
2707
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2708
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2709
+ } | undefined;
2710
+ via?: boolean | undefined;
2711
+ } | undefined;
2712
+ offsets?: {
2713
+ x: string | number;
2714
+ y: string | number;
2715
+ trace_width?: string | number | undefined;
2716
+ via?: boolean | undefined;
2717
+ to_layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2718
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2719
+ } | undefined;
2720
+ }[] | {
2721
+ x: string | number;
2722
+ y: string | number;
2723
+ toLayer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
2724
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
2725
+ } | undefined;
2726
+ via?: boolean | undefined;
2727
+ }[] | undefined;
2728
+ traceWidth?: number | undefined;
2729
+ }>;
2730
+ };
2512
2731
  doInitialPortMatching(): void;
2513
2732
  getPcbRouteHints(): Array<RouteHintPoint>;
2514
2733
  doInitialPcbTraceHintRender(): void;
@@ -2529,6 +2748,7 @@ interface SchematicBoxDimensions {
2529
2748
  declare class Chip<PinLabels extends string = never> extends NormalComponent<typeof chipProps, PinLabels> {
2530
2749
  schematicDimensions: SchematicBoxDimensions | null;
2531
2750
  get config(): {
2751
+ componentName: string;
2532
2752
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
2533
2753
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
2534
2754
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3137,6 +3357,7 @@ declare class Chip<PinLabels extends string = never> extends NormalComponent<typ
3137
3357
  declare class Jumper<PinLabels extends string = never> extends NormalComponent<typeof jumperProps, PinLabels> {
3138
3358
  schematicDimensions: SchematicBoxDimensions | null;
3139
3359
  get config(): {
3360
+ componentName: string;
3140
3361
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<zod.objectUtil.extendShape<zod.objectUtil.extendShape<{
3141
3362
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3142
3363
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3748,6 +3969,7 @@ declare class Jumper<PinLabels extends string = never> extends NormalComponent<t
3748
3969
  declare class SilkscreenPath extends PrimitiveComponent<typeof silkscreenPathProps> {
3749
3970
  pcb_silkscreen_path_id: string | null;
3750
3971
  get config(): {
3972
+ componentName: string;
3751
3973
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<Omit<{
3752
3974
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3753
3975
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3826,6 +4048,7 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3826
4048
  matchedPort: Port | null;
3827
4049
  isPcbPrimitive: boolean;
3828
4050
  get config(): {
4051
+ componentName: string;
3829
4052
  zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
3830
4053
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3831
4054
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -3935,8 +4158,8 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3935
4158
  declare const edgeSpecifiers: readonly ["leftedge", "rightedge", "topedge", "bottomedge", "center"];
3936
4159
  type EdgeSpecifier = (typeof edgeSpecifiers)[number];
3937
4160
  declare class Constraint extends PrimitiveComponent<typeof constraintProps> {
3938
- componentName: string;
3939
4161
  get config(): {
4162
+ componentName: string;
3940
4163
  zodProps: z.ZodUnion<[z.ZodObject<{
3941
4164
  pcb: z.ZodOptional<z.ZodLiteral<true>>;
3942
4165
  xDist: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
@@ -4020,6 +4243,7 @@ declare class Hole extends PrimitiveComponent<typeof holeProps> {
4020
4243
  pcb_hole_id: string | null;
4021
4244
  isPcbPrimitive: boolean;
4022
4245
  get config(): {
4246
+ componentName: string;
4023
4247
  zodProps: zod.ZodEffects<zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4024
4248
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4025
4249
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -4098,6 +4322,48 @@ declare class Hole extends PrimitiveComponent<typeof holeProps> {
4098
4322
 
4099
4323
  declare class SilkscreenText extends PrimitiveComponent<typeof silkscreenTextProps> {
4100
4324
  isPcbPrimitive: boolean;
4325
+ get config(): {
4326
+ componentName: string;
4327
+ zodProps: zod.ZodObject<zod.objectUtil.extendShape<{
4328
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4329
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4330
+ pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4331
+ layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
4332
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
4333
+ }, "strip", zod.ZodTypeAny, {
4334
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4335
+ }, {
4336
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4337
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4338
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4339
+ }>>;
4340
+ }, {
4341
+ text: zod.ZodString;
4342
+ anchorAlignment: zod.ZodDefault<zod.ZodEnum<["center", "top_left", "top_right", "bottom_left", "bottom_right"]>>;
4343
+ font: zod.ZodOptional<zod.ZodEnum<["tscircuit2024"]>>;
4344
+ fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4345
+ }>, "strip", zod.ZodTypeAny, {
4346
+ text: string;
4347
+ anchorAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right";
4348
+ pcbX?: number | undefined;
4349
+ pcbY?: number | undefined;
4350
+ pcbRotation?: number | undefined;
4351
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
4352
+ font?: "tscircuit2024" | undefined;
4353
+ fontSize?: number | undefined;
4354
+ }, {
4355
+ text: string;
4356
+ pcbX?: string | number | undefined;
4357
+ pcbY?: string | number | undefined;
4358
+ pcbRotation?: string | number | undefined;
4359
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4360
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4361
+ } | undefined;
4362
+ anchorAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | undefined;
4363
+ font?: "tscircuit2024" | undefined;
4364
+ fontSize?: string | number | undefined;
4365
+ }>;
4366
+ };
4101
4367
  doInitialPcbPrimitiveRender(): void;
4102
4368
  getPcbSize(): {
4103
4369
  width: number;
@@ -4109,6 +4375,7 @@ declare class Keepout extends PrimitiveComponent<typeof pcbKeepoutProps> {
4109
4375
  pcb_keepout_id: string | null;
4110
4376
  isPcbPrimitive: boolean;
4111
4377
  get config(): {
4378
+ componentName: string;
4112
4379
  zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4113
4380
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4114
4381
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
@@ -4180,12 +4447,58 @@ declare class Keepout extends PrimitiveComponent<typeof pcbKeepoutProps> {
4180
4447
  }
4181
4448
 
4182
4449
  declare class FabricationNoteText extends PrimitiveComponent<typeof fabricationNoteTextProps> {
4450
+ get config(): {
4451
+ componentName: string;
4452
+ zodProps: zod.ZodObject<zod.objectUtil.extendShape<{
4453
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4454
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4455
+ pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4456
+ layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
4457
+ name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
4458
+ }, "strip", zod.ZodTypeAny, {
4459
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4460
+ }, {
4461
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4462
+ }>]>, "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6", "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4463
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4464
+ }>>;
4465
+ }, {
4466
+ text: zod.ZodString;
4467
+ anchorAlignment: zod.ZodDefault<zod.ZodEnum<["center", "top_left", "top_right", "bottom_left", "bottom_right"]>>;
4468
+ font: zod.ZodOptional<zod.ZodEnum<["tscircuit2024"]>>;
4469
+ fontSize: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4470
+ color: zod.ZodOptional<zod.ZodString>;
4471
+ }>, "strip", zod.ZodTypeAny, {
4472
+ text: string;
4473
+ anchorAlignment: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right";
4474
+ pcbX?: number | undefined;
4475
+ pcbY?: number | undefined;
4476
+ pcbRotation?: number | undefined;
4477
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
4478
+ color?: string | undefined;
4479
+ font?: "tscircuit2024" | undefined;
4480
+ fontSize?: number | undefined;
4481
+ }, {
4482
+ text: string;
4483
+ pcbX?: string | number | undefined;
4484
+ pcbY?: string | number | undefined;
4485
+ pcbRotation?: string | number | undefined;
4486
+ layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
4487
+ name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
4488
+ } | undefined;
4489
+ color?: string | undefined;
4490
+ anchorAlignment?: "center" | "top_left" | "top_right" | "bottom_left" | "bottom_right" | undefined;
4491
+ font?: "tscircuit2024" | undefined;
4492
+ fontSize?: string | number | undefined;
4493
+ }>;
4494
+ };
4183
4495
  doInitialPcbPrimitiveRender(): void;
4184
4496
  }
4185
4497
 
4186
4498
  declare class FabricationNotePath extends PrimitiveComponent<typeof fabricationNotePathProps> {
4187
4499
  fabrication_note_path_id: string | null;
4188
4500
  get config(): {
4501
+ componentName: string;
4189
4502
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<Omit<{
4190
4503
  pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
4191
4504
  pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
package/dist/index.js CHANGED
@@ -34,6 +34,9 @@ __export(components_exports, {
34
34
  TraceHint: () => TraceHint
35
35
  });
36
36
 
37
+ // lib/components/primitive-components/Footprint.ts
38
+ import { footprintProps } from "@tscircuit/props";
39
+
37
40
  // lib/components/base-components/PrimitiveComponent.ts
38
41
  import { z } from "zod";
39
42
  import { symbols } from "schematic-symbols";
@@ -177,13 +180,18 @@ var PrimitiveComponent = class extends Renderable {
177
180
  childrenPendingRemoval;
178
181
  get config() {
179
182
  return {
183
+ componentName: "",
180
184
  zodProps: z.object({}).passthrough()
181
185
  };
182
186
  }
183
187
  props;
184
188
  _parsedProps;
185
- componentName = "";
186
- lowercaseComponentName = "";
189
+ get componentName() {
190
+ return this.config.componentName;
191
+ }
192
+ get lowercaseComponentName() {
193
+ return this.componentName.toLowerCase();
194
+ }
187
195
  externallyAddedAliases;
188
196
  /**
189
197
  * An subcircuit is self-contained. All the selectors inside
@@ -220,10 +228,6 @@ var PrimitiveComponent = class extends Renderable {
220
228
  this._parsedProps = this.config.zodProps.parse(
221
229
  props ?? {}
222
230
  );
223
- if (!this.componentName) {
224
- this.componentName = this.constructor.name;
225
- }
226
- this.lowercaseComponentName = this.componentName.toLowerCase();
227
231
  }
228
232
  setProps(props) {
229
233
  const newProps = this.config.zodProps.parse({
@@ -573,6 +577,12 @@ import * as kiwi from "@lume/kiwi";
573
577
  import Debug from "debug";
574
578
  var debug = Debug("tscircuit:core:footprint");
575
579
  var Footprint = class extends PrimitiveComponent {
580
+ get config() {
581
+ return {
582
+ componentName: "Footprint",
583
+ zodProps: footprintProps
584
+ };
585
+ }
576
586
  /**
577
587
  * A footprint is a constrainedlayout, the db elements are adjusted according
578
588
  * to any constraints that are defined.
@@ -801,6 +811,12 @@ var Port = class extends PrimitiveComponent {
801
811
  schematicSymbolPortDef = null;
802
812
  matchedComponents;
803
813
  facingDirection = null;
814
+ get config() {
815
+ return {
816
+ componentName: "Port",
817
+ zodProps: portProps
818
+ };
819
+ }
804
820
  constructor(props) {
805
821
  if (!props.name && props.pinNumber) props.name = `pin${props.pinNumber}`;
806
822
  if (!props.name) {
@@ -1164,6 +1180,7 @@ var SmtPad = class extends PrimitiveComponent {
1164
1180
  isPcbPrimitive = true;
1165
1181
  get config() {
1166
1182
  return {
1183
+ componentName: "SmtPad",
1167
1184
  zodProps: smtPadProps
1168
1185
  };
1169
1186
  }
@@ -1294,6 +1311,7 @@ var SilkscreenPath = class extends PrimitiveComponent {
1294
1311
  pcb_silkscreen_path_id = null;
1295
1312
  get config() {
1296
1313
  return {
1314
+ componentName: "SilkscreenPath",
1297
1315
  zodProps: silkscreenPathProps
1298
1316
  };
1299
1317
  }
@@ -1335,6 +1353,7 @@ var PlatedHole = class extends PrimitiveComponent {
1335
1353
  isPcbPrimitive = true;
1336
1354
  get config() {
1337
1355
  return {
1356
+ componentName: "PlatedHole",
1338
1357
  zodProps: platedHoleProps
1339
1358
  };
1340
1359
  }
@@ -1429,6 +1448,7 @@ var Keepout = class extends PrimitiveComponent {
1429
1448
  isPcbPrimitive = true;
1430
1449
  get config() {
1431
1450
  return {
1451
+ componentName: "Keepout",
1432
1452
  zodProps: pcbKeepoutProps
1433
1453
  };
1434
1454
  }
@@ -1561,6 +1581,12 @@ var netProps = z3.object({
1561
1581
  });
1562
1582
  var Net = class extends PrimitiveComponent {
1563
1583
  source_net_id;
1584
+ get config() {
1585
+ return {
1586
+ componentName: "Net",
1587
+ zodProps: netProps
1588
+ };
1589
+ }
1564
1590
  getPortSelector() {
1565
1591
  return `net.${this.props.name}`;
1566
1592
  }
@@ -2106,10 +2132,16 @@ import "transformation-matrix";
2106
2132
  import "zod";
2107
2133
 
2108
2134
  // lib/components/primitive-components/TraceHint.ts
2109
- import "@tscircuit/props";
2135
+ import { traceHintProps } from "@tscircuit/props";
2110
2136
  import { applyToPoint as applyToPoint5 } from "transformation-matrix";
2111
2137
  var TraceHint = class extends PrimitiveComponent {
2112
2138
  matchedPort = null;
2139
+ get config() {
2140
+ return {
2141
+ componentName: "TraceHint",
2142
+ zodProps: traceHintProps
2143
+ };
2144
+ }
2113
2145
  doInitialPortMatching() {
2114
2146
  const { db } = this.root;
2115
2147
  const { _parsedProps: props, parent } = this;
@@ -2163,7 +2195,8 @@ var TraceHint = class extends PrimitiveComponent {
2163
2195
  var Group = class extends NormalComponent {
2164
2196
  get config() {
2165
2197
  return {
2166
- zodProps: groupProps
2198
+ zodProps: groupProps,
2199
+ componentName: "Group"
2167
2200
  };
2168
2201
  }
2169
2202
  doInitialCreateTraceHintsFromProps() {
@@ -2192,6 +2225,7 @@ var Board = class extends Group {
2192
2225
  }
2193
2226
  get config() {
2194
2227
  return {
2228
+ componentName: "Board",
2195
2229
  zodProps: boardProps
2196
2230
  };
2197
2231
  }
@@ -2435,7 +2469,8 @@ var Trace = class extends PrimitiveComponent {
2435
2469
  }
2436
2470
  get config() {
2437
2471
  return {
2438
- zodProps: traceProps
2472
+ zodProps: traceProps,
2473
+ componentName: "Trace"
2439
2474
  };
2440
2475
  }
2441
2476
  _getTracePortOrNetSelectorListFromProps() {
@@ -2869,6 +2904,7 @@ searched component ${targetComponent.getString()}, which has ports: ${targetComp
2869
2904
  var Resistor = class extends NormalComponent {
2870
2905
  get config() {
2871
2906
  return {
2907
+ componentName: "Resistor",
2872
2908
  schematicSymbolName: "boxresistor",
2873
2909
  zodProps: resistorProps,
2874
2910
  sourceFtype: "simple_resistor"
@@ -2915,6 +2951,7 @@ import { ledProps } from "@tscircuit/props";
2915
2951
  var Led = class extends NormalComponent {
2916
2952
  get config() {
2917
2953
  return {
2954
+ componentName: "Led",
2918
2955
  schematicSymbolName: "led",
2919
2956
  zodProps: ledProps,
2920
2957
  sourceFtype: "simple_diode"
@@ -2947,6 +2984,7 @@ var Diode = class extends NormalComponent {
2947
2984
  get config() {
2948
2985
  return {
2949
2986
  // schematicSymbolName: "diode" as BaseSymbolName,
2987
+ componentName: "Diode",
2950
2988
  zodProps: diodeProps,
2951
2989
  sourceFtype: "simple_diode"
2952
2990
  };
@@ -2962,6 +3000,7 @@ import { ledProps as ledProps2 } from "@tscircuit/props";
2962
3000
  var Capacitor = class extends NormalComponent {
2963
3001
  get config() {
2964
3002
  return {
3003
+ componentName: "Capacitor",
2965
3004
  // schematicSymbolName: BASE_SYMBOLS.capacitor,
2966
3005
  zodProps: ledProps2,
2967
3006
  sourceFtype: FTYPE.simple_capacitor
@@ -3299,6 +3338,7 @@ var Chip = class extends NormalComponent {
3299
3338
  schematicDimensions = null;
3300
3339
  get config() {
3301
3340
  return {
3341
+ componentName: "Chip",
3302
3342
  zodProps: chipProps
3303
3343
  };
3304
3344
  }
@@ -3368,6 +3408,7 @@ var Jumper = class extends NormalComponent {
3368
3408
  schematicDimensions = null;
3369
3409
  get config() {
3370
3410
  return {
3411
+ componentName: "Jumper",
3371
3412
  zodProps: jumperProps
3372
3413
  };
3373
3414
  }
@@ -3446,9 +3487,9 @@ var edgeSpecifiers = [
3446
3487
  "center"
3447
3488
  ];
3448
3489
  var Constraint2 = class extends PrimitiveComponent {
3449
- componentName = "Constraint";
3450
3490
  get config() {
3451
3491
  return {
3492
+ componentName: "Constraint",
3452
3493
  zodProps: constraintProps
3453
3494
  };
3454
3495
  }
@@ -3505,6 +3546,7 @@ var Hole = class extends PrimitiveComponent {
3505
3546
  isPcbPrimitive = true;
3506
3547
  get config() {
3507
3548
  return {
3549
+ componentName: "Hole",
3508
3550
  zodProps: holeProps
3509
3551
  };
3510
3552
  }
@@ -3551,9 +3593,15 @@ var Hole = class extends PrimitiveComponent {
3551
3593
  };
3552
3594
 
3553
3595
  // lib/components/primitive-components/SilkscreenText.ts
3554
- import "@tscircuit/props";
3596
+ import { silkscreenTextProps } from "@tscircuit/props";
3555
3597
  var SilkscreenText = class extends PrimitiveComponent {
3556
3598
  isPcbPrimitive = true;
3599
+ get config() {
3600
+ return {
3601
+ componentName: "SilkscreenText",
3602
+ zodProps: silkscreenTextProps
3603
+ };
3604
+ }
3557
3605
  doInitialPcbPrimitiveRender() {
3558
3606
  const { db } = this.root;
3559
3607
  const { _parsedProps: props } = this;
@@ -3584,8 +3632,14 @@ var SilkscreenText = class extends PrimitiveComponent {
3584
3632
  };
3585
3633
 
3586
3634
  // lib/components/primitive-components/FabricationNoteText.ts
3587
- import "@tscircuit/props";
3635
+ import { fabricationNoteTextProps } from "@tscircuit/props";
3588
3636
  var FabricationNoteText = class extends PrimitiveComponent {
3637
+ get config() {
3638
+ return {
3639
+ componentName: "FabricationNoteText",
3640
+ zodProps: fabricationNoteTextProps
3641
+ };
3642
+ }
3589
3643
  doInitialPcbPrimitiveRender() {
3590
3644
  const { db } = this.root;
3591
3645
  const { _parsedProps: props } = this;
@@ -3613,6 +3667,7 @@ var FabricationNotePath = class extends PrimitiveComponent {
3613
3667
  fabrication_note_path_id = null;
3614
3668
  get config() {
3615
3669
  return {
3670
+ componentName: "FabricationNotePath",
3616
3671
  zodProps: fabricationNotePathProps
3617
3672
  };
3618
3673
  }
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.90",
4
+ "version": "0.0.92",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",