@tscircuit/core 0.0.29 → 0.0.31

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
@@ -6,12 +6,14 @@ import { ReactElement } from 'react';
6
6
  import { Matrix } from 'transformation-matrix';
7
7
  import { SchSymbol, BaseSymbolName } from 'schematic-symbols';
8
8
  import * as Props from '@tscircuit/props';
9
- import { traceProps, groupProps, boardProps, footprintProps, smtPadProps, resistorProps, ledProps, capacitorProps, traceHintProps, chipProps, jumperProps, silkscreenPathProps, platedHoleProps } from '@tscircuit/props';
9
+ import { traceProps, groupProps, boardProps, footprintProps, smtPadProps, resistorProps, ledProps, capacitorProps, traceHintProps, chipProps, jumperProps, silkscreenPathProps, platedHoleProps, constraintProps } from '@tscircuit/props';
10
10
 
11
11
  declare class Circuit {
12
- rootComponent: PrimitiveComponent | null;
12
+ firstChild: PrimitiveComponent | null;
13
13
  children: PrimitiveComponent[];
14
14
  db: SoupUtilObjects;
15
+ root: Circuit | null;
16
+ isRoot: boolean;
15
17
  _hasRenderedAtleastOnce: boolean;
16
18
  constructor();
17
19
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
@@ -27,16 +29,19 @@ declare class Circuit {
27
29
  previewName: string;
28
30
  tscircuitApiKey?: string;
29
31
  }): Promise<void>;
30
- computeGlobalSchematicTransform(): Matrix;
31
- computeGlobalPcbTransform(): Matrix;
32
+ computeSchematicGlobalTransform(): Matrix;
33
+ _computePcbGlobalTransformBeforeLayout(): Matrix;
32
34
  selectAll(selector: string): PrimitiveComponent[];
33
35
  selectOne(selector: string, opts?: {
34
36
  type?: "component" | "port";
35
37
  }): PrimitiveComponent | null;
36
38
  }
39
+ /**
40
+ * @deprecated
41
+ */
37
42
  declare const Project: typeof Circuit;
38
43
 
39
- declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "CreateNetsFromProps", "CreateTracesFromProps", "SourceRender", "SourceParentAttachment", "PortDiscovery", "PortMatching", "SourceTraceRender", "SchematicComponentRender", "SchematicLayout", "SchematicPortRender", "SchematicTraceRender", "PcbComponentRender", "PcbPortRender", "PcbPrimitiveRender", "PcbParentAttachment", "PcbLayout", "PcbTraceRender", "PcbRouteNetIslands", "PcbComponentSizeCalculation", "CadModelRender"];
44
+ declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "SourceRender", "SourceParentAttachment", "PortDiscovery", "PortMatching", "SourceTraceRender", "SchematicComponentRender", "SchematicLayout", "SchematicPortRender", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbParentAttachment", "PcbLayout", "PcbTraceRender", "PcbRouteNetIslands", "PcbComponentSizeCalculation", "CadModelRender"];
40
45
  type RenderPhase = (typeof orderedRenderPhases)[number];
41
46
  type RenderPhaseFn<K extends RenderPhase = RenderPhase> = `doInitial${K}` | `update${K}` | `remove${K}`;
42
47
  type RenderPhaseStates = Record<RenderPhase, {
@@ -91,7 +96,6 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
91
96
  children: PrimitiveComponent[];
92
97
  childrenPendingRemoval: PrimitiveComponent[];
93
98
  get config(): BaseComponentConfig;
94
- project: Circuit | null;
95
99
  props: z.input<ZodProps>;
96
100
  _parsedProps: z.infer<ZodProps>;
97
101
  componentName: string;
@@ -103,14 +107,24 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
103
107
  * subcircuits and their selectors will not interact with each other (even if the
104
108
  * components share the same names) unless you explicitly break out some ports
105
109
  */
106
- get isSubcircuit(): boolean;
110
+ get isSubcircuit(): any;
111
+ /**
112
+ * A primitive container is a component that contains one or more ports and
113
+ * primitive components that are designed to interact.
114
+ *
115
+ * For example a resistor contains ports and smtpads that interact, so the
116
+ * resistor is a primitive container. Inside a primitive container, the ports
117
+ * and pads are likely to reference each other and look for eachother during
118
+ * the port matching phase.
119
+ *
120
+ */
121
+ isPrimitiveContainer: boolean;
107
122
  source_group_id: string | null;
108
123
  source_component_id: string | null;
109
124
  schematic_component_id: string | null;
110
125
  pcb_component_id: string | null;
111
126
  cad_component_id: string | null;
112
127
  constructor(props: z.input<ZodProps>);
113
- setProject(project: Circuit): void;
114
128
  setProps(props: Partial<z.input<ZodProps>>): void;
115
129
  /**
116
130
  * Computes a transformation matrix from the props of this component for PCB
@@ -122,9 +136,38 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
122
136
  * components, including this component's translation and rotation.
123
137
  *
124
138
  * This is used to compute this component's position as well as all children
125
- * components positions
139
+ * components positions before layout is applied
140
+ */
141
+ _computePcbGlobalTransformBeforeLayout(): Matrix;
142
+ getPrimitiveContainer(): PrimitiveComponent | null;
143
+ /**
144
+ * Compute the bounds of this component the circuit json elements associated
145
+ * with it.
126
146
  */
127
- computePcbGlobalTransform(): Matrix;
147
+ _getCircuitJsonBounds(): {
148
+ center: {
149
+ x: number;
150
+ y: number;
151
+ };
152
+ bounds: {
153
+ left: number;
154
+ top: number;
155
+ right: number;
156
+ bottom: number;
157
+ };
158
+ width: number;
159
+ height: number;
160
+ };
161
+ /**
162
+ * Set the position of this component from the layout solver. This method
163
+ * should operate using CircuitJson associated with this component, like
164
+ * _getCircuitJsonBounds it can be called multiple times as different
165
+ * parents apply layout to their children.
166
+ */
167
+ _setPositionFromLayout(newCenter: {
168
+ x: number;
169
+ y: number;
170
+ }): void;
128
171
  /**
129
172
  * Computes a transformation matrix from the props of this component for
130
173
  * schematic components
@@ -144,14 +187,15 @@ declare abstract class PrimitiveComponent<ZodProps extends ZodType = any> extend
144
187
  x: number;
145
188
  y: number;
146
189
  } | null;
147
- getGlobalPcbPosition(): {
190
+ _getGlobalPcbPositionBeforeLayout(): {
148
191
  x: number;
149
192
  y: number;
150
193
  };
151
- getGlobalSchematicPosition(): {
194
+ _getGlobalSchematicPositionBeforeLayout(): {
152
195
  x: number;
153
196
  y: number;
154
197
  };
198
+ get root(): Circuit | null;
155
199
  onAddToParent(parent: PrimitiveComponent): void;
156
200
  /**
157
201
  * Called whenever the props change
@@ -464,11 +508,11 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
464
508
  matchedComponents: PrimitiveComponent[];
465
509
  facingDirection: "up" | "down" | "left" | "right" | null;
466
510
  constructor(props: z.input<typeof portProps>);
467
- getGlobalPcbPosition(): {
511
+ _getGlobalPcbPositionBeforeLayout(): {
468
512
  x: number;
469
513
  y: number;
470
514
  };
471
- getGlobalSchematicPosition(): {
515
+ _getGlobalSchematicPositionBeforeLayout(): {
472
516
  x: number;
473
517
  y: number;
474
518
  };
@@ -488,11 +532,6 @@ declare class Port extends PrimitiveComponent<typeof portProps> {
488
532
  _getDirectlyConnectedTraces(): Trace[];
489
533
  doInitialSourceRender(): void;
490
534
  doInitialSourceParentAttachment(): void;
491
- /**
492
- * For PcbPorts, we use the parent attachment phase to determine where to place
493
- * the pcb_port (prior to this phase, the smtpad/platedhole isn't guaranteed
494
- * to exist)
495
- */
496
535
  doInitialPcbPortRender(): void;
497
536
  doInitialSchematicPortRender(): void;
498
537
  }
@@ -524,6 +563,7 @@ type PortMap<T extends string> = {
524
563
  */
525
564
  declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends string = never> extends PrimitiveComponent<ZodProps> {
526
565
  reactSubtrees: Array<ReactSubtree>;
566
+ isPrimitiveContainer: boolean;
527
567
  constructor(props: z.input<ZodProps>);
528
568
  /**
529
569
  * Override this method for better control over the auto-discovery of ports.
@@ -558,7 +598,9 @@ declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends
558
598
  */
559
599
  doInitialPcbComponentSizeCalculation(): void;
560
600
  _renderReactSubtree(element: ReactElement): ReactSubtree;
601
+ doInitialInitializePortsFromChildren(): void;
561
602
  doInitialReactSubtreesRender(): void;
603
+ _hasExistingPortExactly(port1: Port): boolean;
562
604
  add(componentOrElm: PrimitiveComponent | ReactElement): void;
563
605
  getPortsFromFootprint(): Port[];
564
606
  getPortsFromSchematicSymbol(): Port[];
@@ -631,10 +673,15 @@ declare class Board extends Group<typeof boardProps> {
631
673
  };
632
674
  doInitialPcbComponentRender(): void;
633
675
  removePcbComponentRender(): void;
634
- computePcbGlobalTransform(): Matrix;
676
+ _computePcbGlobalTransformBeforeLayout(): Matrix;
635
677
  }
636
678
 
637
679
  declare class Footprint extends PrimitiveComponent<typeof footprintProps> {
680
+ /**
681
+ * A footprint is a constrainedlayout, the db elements are adjusted according
682
+ * to any constraints that are defined.
683
+ */
684
+ doInitialPcbFootprintLayout(): void;
638
685
  }
639
686
 
640
687
  declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
@@ -643,8 +690,8 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
643
690
  isPcbPrimitive: boolean;
644
691
  get config(): {
645
692
  zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
646
- pcbX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
647
- pcbY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
693
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
694
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
648
695
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
649
696
  layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
650
697
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -657,27 +704,27 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
657
704
  }>>;
658
705
  }, "pcbRotation">, {
659
706
  shape: zod.ZodLiteral<"circle">;
660
- radius: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
707
+ radius: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
661
708
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
662
709
  }>, "strip", zod.ZodTypeAny, {
663
- pcbX: number;
664
- pcbY: number;
665
710
  shape: "circle";
711
+ radius: number;
712
+ pcbX?: number | undefined;
713
+ pcbY?: number | undefined;
666
714
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
667
- radius?: number | undefined;
668
715
  portHints?: (string | number)[] | undefined;
669
716
  }, {
670
- pcbX: string | number;
671
- pcbY: string | number;
672
717
  shape: "circle";
718
+ radius: string | number;
719
+ pcbX?: string | number | undefined;
720
+ pcbY?: string | number | undefined;
673
721
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
674
722
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
675
723
  } | undefined;
676
- radius?: string | number | undefined;
677
724
  portHints?: (string | number)[] | undefined;
678
725
  }>, zod.ZodObject<zod.objectUtil.extendShape<Omit<{
679
- pcbX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
680
- pcbY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
726
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
727
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
681
728
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
682
729
  layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
683
730
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -690,27 +737,27 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
690
737
  }>>;
691
738
  }, "pcbRotation">, {
692
739
  shape: zod.ZodLiteral<"rect">;
693
- width: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
694
- height: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
740
+ width: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
741
+ height: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
695
742
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
696
743
  }>, "strip", zod.ZodTypeAny, {
697
- pcbX: number;
698
- pcbY: number;
699
744
  shape: "rect";
745
+ width: number;
746
+ height: number;
747
+ pcbX?: number | undefined;
748
+ pcbY?: number | undefined;
700
749
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | undefined;
701
750
  portHints?: (string | number)[] | undefined;
702
- width?: number | undefined;
703
- height?: number | undefined;
704
751
  }, {
705
- pcbX: string | number;
706
- pcbY: string | number;
707
752
  shape: "rect";
753
+ width: string | number;
754
+ height: string | number;
755
+ pcbX?: string | number | undefined;
756
+ pcbY?: string | number | undefined;
708
757
  layer?: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6" | {
709
758
  name: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
710
759
  } | undefined;
711
760
  portHints?: (string | number)[] | undefined;
712
- width?: string | number | undefined;
713
- height?: string | number | undefined;
714
761
  }>]>;
715
762
  };
716
763
  getPcbSize(): {
@@ -719,6 +766,24 @@ declare class SmtPad extends PrimitiveComponent<typeof smtPadProps> {
719
766
  };
720
767
  doInitialPortMatching(): void;
721
768
  doInitialPcbPrimitiveRender(): void;
769
+ _getCircuitJsonBounds(): {
770
+ center: {
771
+ x: number;
772
+ y: number;
773
+ };
774
+ bounds: {
775
+ left: number;
776
+ top: number;
777
+ right: number;
778
+ bottom: number;
779
+ };
780
+ width: number;
781
+ height: number;
782
+ };
783
+ _setPositionFromLayout(newCenter: {
784
+ x: number;
785
+ y: number;
786
+ }): void;
722
787
  }
723
788
 
724
789
  type Ftype = AnySourceComponent["ftype"];
@@ -3192,8 +3257,8 @@ declare class SilkscreenPath extends PrimitiveComponent<typeof silkscreenPathPro
3192
3257
  pcb_silkscreen_path_id: string | null;
3193
3258
  get config(): {
3194
3259
  zodProps: zod.ZodObject<zod.objectUtil.extendShape<Omit<{
3195
- pcbX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3196
- pcbY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3260
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3261
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3197
3262
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3198
3263
  layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
3199
3264
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -3270,8 +3335,8 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3270
3335
  isPcbPrimitive: boolean;
3271
3336
  get config(): {
3272
3337
  zodProps: zod.ZodUnion<[zod.ZodObject<zod.objectUtil.extendShape<Omit<{
3273
- pcbX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3274
- pcbY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3338
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3339
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3275
3340
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3276
3341
  layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
3277
3342
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -3288,22 +3353,22 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3288
3353
  outerDiameter: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3289
3354
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
3290
3355
  }>, "strip", zod.ZodTypeAny, {
3291
- pcbX: number;
3292
- pcbY: number;
3293
3356
  shape: "circle";
3294
3357
  holeDiameter: number;
3295
3358
  outerDiameter: number;
3359
+ pcbX?: number | undefined;
3360
+ pcbY?: number | undefined;
3296
3361
  portHints?: (string | number)[] | undefined;
3297
3362
  }, {
3298
- pcbX: string | number;
3299
- pcbY: string | number;
3300
3363
  shape: "circle";
3301
3364
  holeDiameter: string | number;
3302
3365
  outerDiameter: string | number;
3366
+ pcbX?: string | number | undefined;
3367
+ pcbY?: string | number | undefined;
3303
3368
  portHints?: (string | number)[] | undefined;
3304
3369
  }>, zod.ZodObject<zod.objectUtil.extendShape<Omit<{
3305
- pcbX: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3306
- pcbY: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3370
+ pcbX: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3371
+ pcbY: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3307
3372
  pcbRotation: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>>;
3308
3373
  layer: zod.ZodOptional<zod.ZodEffects<zod.ZodUnion<[zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>, zod.ZodObject<{
3309
3374
  name: zod.ZodEnum<["top", "bottom", "inner1", "inner2", "inner3", "inner4", "inner5", "inner6"]>;
@@ -3322,22 +3387,22 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3322
3387
  innerHeight: zod.ZodEffects<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, number, string | number>;
3323
3388
  portHints: zod.ZodOptional<zod.ZodArray<zod.ZodUnion<[zod.ZodString, zod.ZodNumber]>, "many">>;
3324
3389
  }>, "strip", zod.ZodTypeAny, {
3325
- pcbX: number;
3326
- pcbY: number;
3327
3390
  shape: "oval";
3328
3391
  outerWidth: number;
3329
3392
  outerHeight: number;
3330
3393
  innerWidth: number;
3331
3394
  innerHeight: number;
3395
+ pcbX?: number | undefined;
3396
+ pcbY?: number | undefined;
3332
3397
  portHints?: (string | number)[] | undefined;
3333
3398
  }, {
3334
- pcbX: string | number;
3335
- pcbY: string | number;
3336
3399
  shape: "oval";
3337
3400
  outerWidth: string | number;
3338
3401
  outerHeight: string | number;
3339
3402
  innerWidth: string | number;
3340
3403
  innerHeight: string | number;
3404
+ pcbX?: string | number | undefined;
3405
+ pcbY?: string | number | undefined;
3341
3406
  portHints?: (string | number)[] | undefined;
3342
3407
  }>]>;
3343
3408
  };
@@ -3349,6 +3414,91 @@ declare class PlatedHole extends PrimitiveComponent<typeof platedHoleProps> {
3349
3414
  doInitialPcbPrimitiveRender(): void;
3350
3415
  }
3351
3416
 
3417
+ declare class Constraint extends PrimitiveComponent<typeof constraintProps> {
3418
+ get config(): {
3419
+ zodProps: z.ZodUnion<[z.ZodObject<{
3420
+ pcb: z.ZodOptional<z.ZodLiteral<true>>;
3421
+ type: z.ZodOptional<z.ZodLiteral<"xdist">>;
3422
+ xdist: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
3423
+ left: z.ZodString;
3424
+ right: z.ZodString;
3425
+ edgeToEdge: z.ZodOptional<z.ZodLiteral<true>>;
3426
+ centerToCenter: z.ZodOptional<z.ZodLiteral<true>>;
3427
+ fromLeftEdge: z.ZodOptional<z.ZodLiteral<true>>;
3428
+ fromLeftCenter: z.ZodOptional<z.ZodLiteral<true>>;
3429
+ toRightEdge: z.ZodOptional<z.ZodLiteral<true>>;
3430
+ toRightCenter: z.ZodOptional<z.ZodLiteral<true>>;
3431
+ }, "strip", z.ZodTypeAny, {
3432
+ left: string;
3433
+ right: string;
3434
+ xdist: number;
3435
+ type?: "xdist" | undefined;
3436
+ pcb?: true | undefined;
3437
+ edgeToEdge?: true | undefined;
3438
+ centerToCenter?: true | undefined;
3439
+ fromLeftEdge?: true | undefined;
3440
+ fromLeftCenter?: true | undefined;
3441
+ toRightEdge?: true | undefined;
3442
+ toRightCenter?: true | undefined;
3443
+ }, {
3444
+ left: string;
3445
+ right: string;
3446
+ xdist: string | number;
3447
+ type?: "xdist" | undefined;
3448
+ pcb?: true | undefined;
3449
+ edgeToEdge?: true | undefined;
3450
+ centerToCenter?: true | undefined;
3451
+ fromLeftEdge?: true | undefined;
3452
+ fromLeftCenter?: true | undefined;
3453
+ toRightEdge?: true | undefined;
3454
+ toRightCenter?: true | undefined;
3455
+ }>, z.ZodObject<{
3456
+ pcb: z.ZodOptional<z.ZodLiteral<true>>;
3457
+ type: z.ZodOptional<z.ZodLiteral<"ydist">>;
3458
+ ydist: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
3459
+ top: z.ZodString;
3460
+ bottom: z.ZodString;
3461
+ edgeToEdge: z.ZodOptional<z.ZodLiteral<true>>;
3462
+ centerToCenter: z.ZodOptional<z.ZodLiteral<true>>;
3463
+ fromTopEdge: z.ZodOptional<z.ZodLiteral<true>>;
3464
+ fromTopCenter: z.ZodOptional<z.ZodLiteral<true>>;
3465
+ toBottomEdge: z.ZodOptional<z.ZodLiteral<true>>;
3466
+ toBottomCenter: z.ZodOptional<z.ZodLiteral<true>>;
3467
+ }, "strip", z.ZodTypeAny, {
3468
+ top: string;
3469
+ bottom: string;
3470
+ ydist: number;
3471
+ type?: "ydist" | undefined;
3472
+ pcb?: true | undefined;
3473
+ edgeToEdge?: true | undefined;
3474
+ centerToCenter?: true | undefined;
3475
+ fromTopEdge?: true | undefined;
3476
+ fromTopCenter?: true | undefined;
3477
+ toBottomEdge?: true | undefined;
3478
+ toBottomCenter?: true | undefined;
3479
+ }, {
3480
+ top: string;
3481
+ bottom: string;
3482
+ ydist: string | number;
3483
+ type?: "ydist" | undefined;
3484
+ pcb?: true | undefined;
3485
+ edgeToEdge?: true | undefined;
3486
+ centerToCenter?: true | undefined;
3487
+ fromTopEdge?: true | undefined;
3488
+ fromTopCenter?: true | undefined;
3489
+ toBottomEdge?: true | undefined;
3490
+ toBottomCenter?: true | undefined;
3491
+ }>]>;
3492
+ };
3493
+ constructor(props: z.input<typeof constraintProps>);
3494
+ _getAllReferencedComponents(): {
3495
+ componentsWithSelectors: Array<{
3496
+ component: PrimitiveComponent<any>;
3497
+ selector: string;
3498
+ }>;
3499
+ };
3500
+ }
3501
+
3352
3502
  declare global {
3353
3503
  namespace JSX {
3354
3504
  interface IntrinsicElements {
@@ -3387,9 +3537,11 @@ declare global {
3387
3537
  pcbtrace: Props.PcbTraceProps;
3388
3538
  fabricationnotetext: Props.FabricationNoteTextProps;
3389
3539
  fabricationnotepath: Props.FabricationNotePathProps;
3540
+ constraint: Props.ConstraintProps;
3541
+ constrainedlayout: Props.ConstrainedLayoutProps;
3390
3542
  jscad: any;
3391
3543
  }
3392
3544
  }
3393
3545
  }
3394
3546
 
3395
- export { Board, Capacitor, Chip, Circuit, Footprint, Group, type IRenderable, Jumper, Led, Net, NormalComponent, PlatedHole, Port, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenPath, SmtPad, Trace, TraceHint };
3547
+ export { Board, Capacitor, Chip, Circuit, Constraint, Footprint, Group, type IRenderable, Jumper, Led, Net, NormalComponent, PlatedHole, Port, PrimitiveComponent, Project, Renderable, Resistor, SilkscreenPath, SmtPad, Trace, TraceHint };