@tscircuit/props 0.0.331 → 0.0.333

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
package/README.md CHANGED
@@ -165,7 +165,8 @@ export interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
165
165
  /** Number of layers for the PCB */
166
166
  layers?: 2 | 4;
167
167
  borderRadius?: Distance;
168
- boardOrigin?: z.infer<typeof ninePointAnchor>;
168
+ boardAnchorPosition?: Point;
169
+ boardAnchorAlignment?: z.infer<typeof ninePointAnchor>;
169
170
  }
170
171
  ```
171
172
 
@@ -1070,15 +1071,6 @@ export interface VoltageSourceProps<PinLabel extends string = string>
1070
1071
  ### PlatformConfig
1071
1072
 
1072
1073
  ```ts
1073
- export interface FootprintLibraryResult {
1074
- footprintCircuitJson: any[];
1075
- cadModel?: CadModelProp;
1076
- }
1077
-
1078
- export interface FootprintFileParserEntry {
1079
- loadFromUrl: (url: string) => Promise<FootprintLibraryResult>;
1080
- }
1081
-
1082
1074
  export interface PlatformConfig {
1083
1075
  partsEngine?: PartsEngine;
1084
1076
 
package/dist/index.d.ts CHANGED
@@ -10654,7 +10654,8 @@ interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
10654
10654
  /** Number of layers for the PCB */
10655
10655
  layers?: 2 | 4;
10656
10656
  borderRadius?: Distance;
10657
- boardOrigin?: z.infer<typeof ninePointAnchor>;
10657
+ boardAnchorPosition?: Point;
10658
+ boardAnchorAlignment?: z.infer<typeof ninePointAnchor>;
10658
10659
  }
10659
10660
  declare const boardProps: z.ZodObject<{
10660
10661
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -11334,7 +11335,17 @@ declare const boardProps: z.ZodObject<{
11334
11335
  material: z.ZodDefault<z.ZodEnum<["fr4", "fr1"]>>;
11335
11336
  layers: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<4>]>>;
11336
11337
  borderRadius: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
11337
- boardOrigin: z.ZodOptional<z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
11338
+ boardAnchorPosition: z.ZodOptional<z.ZodObject<{
11339
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
11340
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
11341
+ }, "strip", z.ZodTypeAny, {
11342
+ x: number;
11343
+ y: number;
11344
+ }, {
11345
+ x: string | number;
11346
+ y: string | number;
11347
+ }>>;
11348
+ boardAnchorAlignment: z.ZodOptional<z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
11338
11349
  }, "strip", z.ZodTypeAny, {
11339
11350
  material: "fr4" | "fr1";
11340
11351
  layers: 2 | 4;
@@ -11615,7 +11626,11 @@ declare const boardProps: z.ZodObject<{
11615
11626
  outlineOffsetX?: number | undefined;
11616
11627
  outlineOffsetY?: number | undefined;
11617
11628
  borderRadius?: number | undefined;
11618
- boardOrigin?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
11629
+ boardAnchorPosition?: {
11630
+ x: number;
11631
+ y: number;
11632
+ } | undefined;
11633
+ boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
11619
11634
  }, {
11620
11635
  symbol?: SymbolProp | undefined;
11621
11636
  key?: any;
@@ -11900,7 +11915,11 @@ declare const boardProps: z.ZodObject<{
11900
11915
  material?: "fr4" | "fr1" | undefined;
11901
11916
  layers?: 2 | 4 | undefined;
11902
11917
  borderRadius?: string | number | undefined;
11903
- boardOrigin?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
11918
+ boardAnchorPosition?: {
11919
+ x: string | number;
11920
+ y: string | number;
11921
+ } | undefined;
11922
+ boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
11904
11923
  }>;
11905
11924
 
11906
11925
  interface BreakoutProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
@@ -22362,6 +22381,8 @@ interface PillPlatedHoleProps extends Omit<PcbLayoutProps, "layer"> {
22362
22381
  outerHeight: number | string;
22363
22382
  holeWidth: number | string;
22364
22383
  holeHeight: number | string;
22384
+ holeOffsetX?: number | string;
22385
+ holeOffsetY?: number | string;
22365
22386
  /** @deprecated use holeWidth */
22366
22387
  innerWidth?: number | string;
22367
22388
  /** @deprecated use holeHeight */
@@ -22575,6 +22596,8 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22575
22596
  innerWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22576
22597
  innerHeight: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22577
22598
  portHints: z.ZodOptional<z.ZodArray<z.ZodUnion<[z.ZodString, z.ZodNumber]>, "many">>;
22599
+ holeOffsetX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22600
+ holeOffsetY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22578
22601
  }, "strip", z.ZodTypeAny, {
22579
22602
  shape: "pill";
22580
22603
  outerWidth: number;
@@ -22599,6 +22622,8 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22599
22622
  innerWidth?: number | undefined;
22600
22623
  innerHeight?: number | undefined;
22601
22624
  rectPad?: boolean | undefined;
22625
+ holeOffsetX?: number | undefined;
22626
+ holeOffsetY?: number | undefined;
22602
22627
  }, {
22603
22628
  shape: "pill";
22604
22629
  outerWidth: string | number;
@@ -22623,6 +22648,8 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22623
22648
  innerWidth?: string | number | undefined;
22624
22649
  innerHeight?: string | number | undefined;
22625
22650
  rectPad?: boolean | undefined;
22651
+ holeOffsetX?: string | number | undefined;
22652
+ holeOffsetY?: string | number | undefined;
22626
22653
  }>, z.ZodObject<Omit<{
22627
22654
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22628
22655
  pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -22677,11 +22704,11 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22677
22704
  name?: string | undefined;
22678
22705
  connectsTo?: string | string[] | undefined;
22679
22706
  portHints?: (string | number)[] | undefined;
22707
+ holeOffsetX?: number | undefined;
22708
+ holeOffsetY?: number | undefined;
22680
22709
  rectBorderRadius?: number | undefined;
22681
22710
  holeShape?: "circle" | undefined;
22682
22711
  padShape?: "rect" | undefined;
22683
- holeOffsetX?: number | undefined;
22684
- holeOffsetY?: number | undefined;
22685
22712
  }, {
22686
22713
  shape: "circular_hole_with_rect_pad";
22687
22714
  holeDiameter: string | number;
@@ -22701,11 +22728,11 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22701
22728
  name?: string | undefined;
22702
22729
  connectsTo?: string | string[] | undefined;
22703
22730
  portHints?: (string | number)[] | undefined;
22731
+ holeOffsetX?: string | number | undefined;
22732
+ holeOffsetY?: string | number | undefined;
22704
22733
  rectBorderRadius?: string | number | undefined;
22705
22734
  holeShape?: "circle" | undefined;
22706
22735
  padShape?: "rect" | undefined;
22707
- holeOffsetX?: string | number | undefined;
22708
- holeOffsetY?: string | number | undefined;
22709
22736
  }>, z.ZodObject<Omit<{
22710
22737
  pcbX: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
22711
22738
  pcbY: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -22854,6 +22881,8 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22854
22881
  innerWidth?: number | undefined;
22855
22882
  innerHeight?: number | undefined;
22856
22883
  rectPad?: boolean | undefined;
22884
+ holeOffsetX?: number | undefined;
22885
+ holeOffsetY?: number | undefined;
22857
22886
  } | {
22858
22887
  shape: "circular_hole_with_rect_pad";
22859
22888
  holeDiameter: number;
@@ -22873,11 +22902,11 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22873
22902
  name?: string | undefined;
22874
22903
  connectsTo?: string | string[] | undefined;
22875
22904
  portHints?: (string | number)[] | undefined;
22905
+ holeOffsetX?: number | undefined;
22906
+ holeOffsetY?: number | undefined;
22876
22907
  rectBorderRadius?: number | undefined;
22877
22908
  holeShape?: "circle" | undefined;
22878
22909
  padShape?: "rect" | undefined;
22879
- holeOffsetX?: number | undefined;
22880
- holeOffsetY?: number | undefined;
22881
22910
  } | {
22882
22911
  shape: "pill_hole_with_rect_pad";
22883
22912
  holeWidth: number;
@@ -22967,6 +22996,8 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22967
22996
  innerWidth?: string | number | undefined;
22968
22997
  innerHeight?: string | number | undefined;
22969
22998
  rectPad?: boolean | undefined;
22999
+ holeOffsetX?: string | number | undefined;
23000
+ holeOffsetY?: string | number | undefined;
22970
23001
  } | {
22971
23002
  shape: "circular_hole_with_rect_pad";
22972
23003
  holeDiameter: string | number;
@@ -22986,11 +23017,11 @@ declare const platedHoleProps: z.ZodEffects<z.ZodDiscriminatedUnion<"shape", [z.
22986
23017
  name?: string | undefined;
22987
23018
  connectsTo?: string | string[] | undefined;
22988
23019
  portHints?: (string | number)[] | undefined;
23020
+ holeOffsetX?: string | number | undefined;
23021
+ holeOffsetY?: string | number | undefined;
22989
23022
  rectBorderRadius?: string | number | undefined;
22990
23023
  holeShape?: "circle" | undefined;
22991
23024
  padShape?: "rect" | undefined;
22992
- holeOffsetX?: string | number | undefined;
22993
- holeOffsetY?: string | number | undefined;
22994
23025
  } | {
22995
23026
  shape: "pill_hole_with_rect_pad";
22996
23027
  holeWidth: string | number;
@@ -27687,7 +27718,17 @@ declare const stampboardProps: z.ZodObject<{
27687
27718
  material: z.ZodDefault<z.ZodEnum<["fr4", "fr1"]>>;
27688
27719
  layers: z.ZodDefault<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<4>]>>;
27689
27720
  borderRadius: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
27690
- boardOrigin: z.ZodOptional<z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
27721
+ boardAnchorPosition: z.ZodOptional<z.ZodObject<{
27722
+ x: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
27723
+ y: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
27724
+ }, "strip", z.ZodTypeAny, {
27725
+ x: number;
27726
+ y: number;
27727
+ }, {
27728
+ x: string | number;
27729
+ y: string | number;
27730
+ }>>;
27731
+ boardAnchorAlignment: z.ZodOptional<z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>>;
27691
27732
  } & {
27692
27733
  leftPinCount: z.ZodOptional<z.ZodNumber>;
27693
27734
  rightPinCount: z.ZodOptional<z.ZodNumber>;
@@ -27983,7 +28024,11 @@ declare const stampboardProps: z.ZodObject<{
27983
28024
  outlineOffsetX?: number | undefined;
27984
28025
  outlineOffsetY?: number | undefined;
27985
28026
  borderRadius?: number | undefined;
27986
- boardOrigin?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
28027
+ boardAnchorPosition?: {
28028
+ x: number;
28029
+ y: number;
28030
+ } | undefined;
28031
+ boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
27987
28032
  leftPins?: string[] | undefined;
27988
28033
  rightPins?: string[] | undefined;
27989
28034
  topPins?: string[] | undefined;
@@ -28278,7 +28323,11 @@ declare const stampboardProps: z.ZodObject<{
28278
28323
  material?: "fr4" | "fr1" | undefined;
28279
28324
  layers?: 2 | 4 | undefined;
28280
28325
  borderRadius?: string | number | undefined;
28281
- boardOrigin?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
28326
+ boardAnchorPosition?: {
28327
+ x: string | number;
28328
+ y: string | number;
28329
+ } | undefined;
28330
+ boardAnchorAlignment?: "top_left" | "top_center" | "top_right" | "center_left" | "center" | "center_right" | "bottom_left" | "bottom_center" | "bottom_right" | undefined;
28282
28331
  leftPins?: string[] | undefined;
28283
28332
  rightPins?: string[] | undefined;
28284
28333
  topPins?: string[] | undefined;
package/dist/index.js CHANGED
@@ -274,12 +274,6 @@ var ninePointAnchor = z13.enum([
274
274
  "bottom_right"
275
275
  ]);
276
276
 
277
- // lib/components/board.ts
278
- import { z as z28 } from "zod";
279
-
280
- // lib/components/group.ts
281
- import { length as length2, distance as distance6 } from "circuit-json";
282
-
283
277
  // lib/common/point.ts
284
278
  import { distance as distance5 } from "circuit-json";
285
279
  import { z as z14 } from "zod";
@@ -288,7 +282,11 @@ var point = z14.object({
288
282
  y: distance5
289
283
  });
290
284
 
285
+ // lib/components/board.ts
286
+ import { z as z28 } from "zod";
287
+
291
288
  // lib/components/group.ts
289
+ import { length as length2, distance as distance6 } from "circuit-json";
292
290
  import { z as z27 } from "zod";
293
291
 
294
292
  // lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
@@ -627,7 +625,8 @@ var boardProps = subcircuitGroupProps.extend({
627
625
  material: z28.enum(["fr4", "fr1"]).default("fr4"),
628
626
  layers: z28.union([z28.literal(2), z28.literal(4)]).default(2),
629
627
  borderRadius: distance.optional(),
630
- boardOrigin: ninePointAnchor.optional()
628
+ boardAnchorPosition: point.optional(),
629
+ boardAnchorAlignment: ninePointAnchor.optional()
631
630
  });
632
631
  expectTypesMatch(true);
633
632
 
@@ -789,7 +788,9 @@ var platedHoleProps = z35.discriminatedUnion("shape", [
789
788
  holeHeight: distanceHiddenUndefined,
790
789
  innerWidth: distance11.optional().describe("DEPRECATED use holeWidth"),
791
790
  innerHeight: distance11.optional().describe("DEPRECATED use holeHeight"),
792
- portHints: portHints.optional()
791
+ portHints: portHints.optional(),
792
+ holeOffsetX: distance11.optional(),
793
+ holeOffsetY: distance11.optional()
793
794
  }),
794
795
  pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
795
796
  name: z35.string().optional(),