@tscircuit/props 0.0.255 → 0.0.257

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
@@ -219,6 +219,10 @@ export interface ChipPropsSU<PinLabel extends string = string>
219
219
  * Whether to show pin aliases in the schematic
220
220
  */
221
221
  showPinAliases?: boolean;
222
+ /**
223
+ * Labels for PCB pins
224
+ */
225
+ pcbPinLabels?: Record<string, string>;
222
226
  schPinArrangement?: SchematicPortArrangement;
223
227
  /** @deprecated Use schPinArrangement instead. */
224
228
  schPortArrangement?: SchematicPortArrangement;
@@ -447,6 +451,10 @@ export interface JumperProps extends CommonComponentProps {
447
451
  schHeight?: number | string;
448
452
  schDirection?: "left" | "right";
449
453
  schPortArrangement?: SchematicPortArrangement;
454
+ /**
455
+ * Labels for PCB pins
456
+ */
457
+ pcbPinLabels?: Record<string, string>;
450
458
  /**
451
459
  * Number of pins on the jumper (2 or 3)
452
460
  */
@@ -548,6 +556,11 @@ export interface PinHeaderProps extends CommonComponentProps {
548
556
  */
549
557
  showSilkscreenPinLabels?: boolean;
550
558
 
559
+ /**
560
+ * Labels for PCB pins
561
+ */
562
+ pcbPinLabels?: Record<string, string>;
563
+
551
564
  /**
552
565
  * Whether the header has two rows of pins
553
566
  */
@@ -674,6 +687,7 @@ export interface SchematicCellProps {
674
687
  rowSpan?: number;
675
688
  colSpan?: number;
676
689
  width?: number | string;
690
+ text?: string;
677
691
  }
678
692
  ```
679
693
 
package/dist/index.d.ts CHANGED
@@ -8094,6 +8094,10 @@ interface ChipPropsSU<PinLabel extends string = string> extends CommonComponentP
8094
8094
  * Whether to show pin aliases in the schematic
8095
8095
  */
8096
8096
  showPinAliases?: boolean;
8097
+ /**
8098
+ * Labels for PCB pins
8099
+ */
8100
+ pcbPinLabels?: Record<string, string>;
8097
8101
  schPinArrangement?: SchematicPortArrangement;
8098
8102
  /** @deprecated Use schPinArrangement instead. */
8099
8103
  schPortArrangement?: SchematicPortArrangement;
@@ -8410,6 +8414,7 @@ declare const chipProps: z.ZodObject<{
8410
8414
  manufacturerPartNumber: z.ZodOptional<z.ZodString>;
8411
8415
  pinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>;
8412
8416
  showPinAliases: z.ZodOptional<z.ZodBoolean>;
8417
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
8413
8418
  internallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
8414
8419
  externallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
8415
8420
  schPinArrangement: z.ZodOptional<z.ZodObject<{
@@ -8729,6 +8734,7 @@ declare const chipProps: z.ZodObject<{
8729
8734
  manufacturerPartNumber?: string | undefined;
8730
8735
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
8731
8736
  showPinAliases?: boolean | undefined;
8737
+ pcbPinLabels?: Record<string, string> | undefined;
8732
8738
  internallyConnectedPins?: string[][] | undefined;
8733
8739
  externallyConnectedPins?: string[][] | undefined;
8734
8740
  schPinArrangement?: {
@@ -8876,6 +8882,7 @@ declare const chipProps: z.ZodObject<{
8876
8882
  manufacturerPartNumber?: string | undefined;
8877
8883
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
8878
8884
  showPinAliases?: boolean | undefined;
8885
+ pcbPinLabels?: Record<string, string> | undefined;
8879
8886
  internallyConnectedPins?: string[][] | undefined;
8880
8887
  externallyConnectedPins?: string[][] | undefined;
8881
8888
  schPinArrangement?: {
@@ -9213,6 +9220,7 @@ declare const bugProps: z.ZodObject<{
9213
9220
  manufacturerPartNumber: z.ZodOptional<z.ZodString>;
9214
9221
  pinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>;
9215
9222
  showPinAliases: z.ZodOptional<z.ZodBoolean>;
9223
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
9216
9224
  internallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
9217
9225
  externallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
9218
9226
  schPinArrangement: z.ZodOptional<z.ZodObject<{
@@ -9532,6 +9540,7 @@ declare const bugProps: z.ZodObject<{
9532
9540
  manufacturerPartNumber?: string | undefined;
9533
9541
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
9534
9542
  showPinAliases?: boolean | undefined;
9543
+ pcbPinLabels?: Record<string, string> | undefined;
9535
9544
  internallyConnectedPins?: string[][] | undefined;
9536
9545
  externallyConnectedPins?: string[][] | undefined;
9537
9546
  schPinArrangement?: {
@@ -9679,6 +9688,7 @@ declare const bugProps: z.ZodObject<{
9679
9688
  manufacturerPartNumber?: string | undefined;
9680
9689
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
9681
9690
  showPinAliases?: boolean | undefined;
9691
+ pcbPinLabels?: Record<string, string> | undefined;
9682
9692
  internallyConnectedPins?: string[][] | undefined;
9683
9693
  externallyConnectedPins?: string[][] | undefined;
9684
9694
  schPinArrangement?: {
@@ -9762,6 +9772,10 @@ interface JumperProps extends CommonComponentProps {
9762
9772
  schHeight?: number | string;
9763
9773
  schDirection?: "left" | "right";
9764
9774
  schPortArrangement?: SchematicPortArrangement;
9775
+ /**
9776
+ * Labels for PCB pins
9777
+ */
9778
+ pcbPinLabels?: Record<string, string>;
9765
9779
  /**
9766
9780
  * Number of pins on the jumper (2 or 3)
9767
9781
  */
@@ -10169,6 +10183,7 @@ declare const jumperProps: z.ZodObject<{
10169
10183
  topPinCount?: number | undefined;
10170
10184
  bottomPinCount?: number | undefined;
10171
10185
  }>>;
10186
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10172
10187
  pinCount: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
10173
10188
  internallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
10174
10189
  connections: z.ZodOptional<z.ZodPipeline<z.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, z.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>>;
@@ -10245,6 +10260,7 @@ declare const jumperProps: z.ZodObject<{
10245
10260
  schHeight?: number | undefined;
10246
10261
  manufacturerPartNumber?: string | undefined;
10247
10262
  pinLabels?: Record<string | number, string | string[]> | undefined;
10263
+ pcbPinLabels?: Record<string, string> | undefined;
10248
10264
  internallyConnectedPins?: string[][] | undefined;
10249
10265
  schPortArrangement?: {
10250
10266
  leftSize?: number | undefined;
@@ -10361,6 +10377,7 @@ declare const jumperProps: z.ZodObject<{
10361
10377
  schHeight?: string | number | undefined;
10362
10378
  manufacturerPartNumber?: string | undefined;
10363
10379
  pinLabels?: Record<string | number, string | string[]> | undefined;
10380
+ pcbPinLabels?: Record<string, string> | undefined;
10364
10381
  internallyConnectedPins?: string[][] | undefined;
10365
10382
  schPortArrangement?: {
10366
10383
  leftSize?: number | undefined;
@@ -10807,6 +10824,7 @@ declare const solderjumperProps: z.ZodObject<{
10807
10824
  topPinCount?: number | undefined;
10808
10825
  bottomPinCount?: number | undefined;
10809
10826
  }>>;
10827
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
10810
10828
  pinCount: z.ZodOptional<z.ZodUnion<[z.ZodLiteral<2>, z.ZodLiteral<3>]>>;
10811
10829
  internallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
10812
10830
  connections: z.ZodOptional<z.ZodPipeline<z.ZodType<Partial<Record<string, string | string[] | readonly string[]>>, z.ZodTypeDef, Partial<Record<string, string | string[] | readonly string[]>>>, z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>>;
@@ -10886,6 +10904,7 @@ declare const solderjumperProps: z.ZodObject<{
10886
10904
  schHeight?: number | undefined;
10887
10905
  manufacturerPartNumber?: string | undefined;
10888
10906
  pinLabels?: Record<string | number, string | string[]> | undefined;
10907
+ pcbPinLabels?: Record<string, string> | undefined;
10889
10908
  internallyConnectedPins?: string[][] | undefined;
10890
10909
  schPortArrangement?: {
10891
10910
  leftSize?: number | undefined;
@@ -11004,6 +11023,7 @@ declare const solderjumperProps: z.ZodObject<{
11004
11023
  schHeight?: string | number | undefined;
11005
11024
  manufacturerPartNumber?: string | undefined;
11006
11025
  pinLabels?: Record<string | number, string | string[]> | undefined;
11026
+ pcbPinLabels?: Record<string, string> | undefined;
11007
11027
  internallyConnectedPins?: string[][] | undefined;
11008
11028
  schPortArrangement?: {
11009
11029
  leftSize?: number | undefined;
@@ -16740,6 +16760,7 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16740
16760
  getPortSelector: () => string;
16741
16761
  })[];
16742
16762
  key?: string | undefined;
16763
+ maxLength?: number | undefined;
16743
16764
  thickness?: number | undefined;
16744
16765
  schematicRouteHints?: {
16745
16766
  x: number;
@@ -16753,12 +16774,12 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16753
16774
  trace_width?: number | undefined;
16754
16775
  }[] | undefined;
16755
16776
  schDisplayLabel?: string | undefined;
16756
- maxLength?: number | undefined;
16757
16777
  }, {
16758
16778
  path: (string | {
16759
16779
  getPortSelector: () => string;
16760
16780
  })[];
16761
16781
  key?: string | undefined;
16782
+ maxLength?: string | number | undefined;
16762
16783
  thickness?: string | number | undefined;
16763
16784
  schematicRouteHints?: {
16764
16785
  x: string | number;
@@ -16774,7 +16795,6 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16774
16795
  trace_width?: string | number | undefined;
16775
16796
  }[] | undefined;
16776
16797
  schDisplayLabel?: string | undefined;
16777
- maxLength?: string | number | undefined;
16778
16798
  }>, z.ZodObject<{
16779
16799
  key: z.ZodOptional<z.ZodString>;
16780
16800
  thickness: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -16838,6 +16858,7 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16838
16858
  getPortSelector: () => string;
16839
16859
  };
16840
16860
  key?: string | undefined;
16861
+ maxLength?: number | undefined;
16841
16862
  thickness?: number | undefined;
16842
16863
  schematicRouteHints?: {
16843
16864
  x: number;
@@ -16851,7 +16872,6 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16851
16872
  trace_width?: number | undefined;
16852
16873
  }[] | undefined;
16853
16874
  schDisplayLabel?: string | undefined;
16854
- maxLength?: number | undefined;
16855
16875
  }, {
16856
16876
  from: string | {
16857
16877
  getPortSelector: () => string;
@@ -16860,6 +16880,7 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16860
16880
  getPortSelector: () => string;
16861
16881
  };
16862
16882
  key?: string | undefined;
16883
+ maxLength?: string | number | undefined;
16863
16884
  thickness?: string | number | undefined;
16864
16885
  schematicRouteHints?: {
16865
16886
  x: string | number;
@@ -16875,7 +16896,6 @@ declare const traceProps: z.ZodUnion<[z.ZodObject<{
16875
16896
  trace_width?: string | number | undefined;
16876
16897
  }[] | undefined;
16877
16898
  schDisplayLabel?: string | undefined;
16878
- maxLength?: string | number | undefined;
16879
16899
  }>]>;
16880
16900
  type TraceProps = z.input<typeof traceProps>;
16881
16901
 
@@ -17345,6 +17365,10 @@ interface PinHeaderProps extends CommonComponentProps {
17345
17365
  * Whether to show pin labels in silkscreen
17346
17366
  */
17347
17367
  showSilkscreenPinLabels?: boolean;
17368
+ /**
17369
+ * Labels for PCB pins
17370
+ */
17371
+ pcbPinLabels?: Record<string, string>;
17348
17372
  /**
17349
17373
  * Whether the header has two rows of pins
17350
17374
  */
@@ -17654,6 +17678,7 @@ declare const pinHeaderProps: z.ZodObject<{
17654
17678
  schFacingDirection: z.ZodOptional<z.ZodEnum<["up", "down", "left", "right"]>>;
17655
17679
  gender: z.ZodDefault<z.ZodOptional<z.ZodEnum<["male", "female"]>>>;
17656
17680
  showSilkscreenPinLabels: z.ZodOptional<z.ZodBoolean>;
17681
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
17657
17682
  doubleRow: z.ZodOptional<z.ZodBoolean>;
17658
17683
  holeDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
17659
17684
  platedDiameter: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
@@ -17865,6 +17890,7 @@ declare const pinHeaderProps: z.ZodObject<{
17865
17890
  schWidth?: number | undefined;
17866
17891
  schHeight?: number | undefined;
17867
17892
  pinLabels?: string[] | undefined;
17893
+ pcbPinLabels?: Record<string, string> | undefined;
17868
17894
  schPinArrangement?: {
17869
17895
  leftSize?: number | undefined;
17870
17896
  topSize?: number | undefined;
@@ -17986,6 +18012,7 @@ declare const pinHeaderProps: z.ZodObject<{
17986
18012
  schHeight?: string | number | undefined;
17987
18013
  gender?: "male" | "female" | undefined;
17988
18014
  pinLabels?: string[] | undefined;
18015
+ pcbPinLabels?: Record<string, string> | undefined;
17989
18016
  schPinArrangement?: {
17990
18017
  leftSize?: number | undefined;
17991
18018
  topSize?: number | undefined;
@@ -18366,6 +18393,7 @@ declare const pushButtonProps: z.ZodObject<{
18366
18393
  manufacturerPartNumber: z.ZodOptional<z.ZodString>;
18367
18394
  pinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodUnion<[z.ZodString, z.ZodReadonly<z.ZodArray<z.ZodString, "many">>]>, z.ZodArray<z.ZodString, "many">]>>>;
18368
18395
  showPinAliases: z.ZodOptional<z.ZodBoolean>;
18396
+ pcbPinLabels: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodString>>;
18369
18397
  internallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
18370
18398
  externallyConnectedPins: z.ZodOptional<z.ZodArray<z.ZodArray<z.ZodString, "many">, "many">>;
18371
18399
  schPinArrangement: z.ZodOptional<z.ZodObject<{
@@ -18685,6 +18713,7 @@ declare const pushButtonProps: z.ZodObject<{
18685
18713
  manufacturerPartNumber?: string | undefined;
18686
18714
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
18687
18715
  showPinAliases?: boolean | undefined;
18716
+ pcbPinLabels?: Record<string, string> | undefined;
18688
18717
  internallyConnectedPins?: string[][] | undefined;
18689
18718
  externallyConnectedPins?: string[][] | undefined;
18690
18719
  schPinArrangement?: {
@@ -18832,6 +18861,7 @@ declare const pushButtonProps: z.ZodObject<{
18832
18861
  manufacturerPartNumber?: string | undefined;
18833
18862
  pinLabels?: Record<string, string | readonly string[] | string[]> | undefined;
18834
18863
  showPinAliases?: boolean | undefined;
18864
+ pcbPinLabels?: Record<string, string> | undefined;
18835
18865
  internallyConnectedPins?: string[][] | undefined;
18836
18866
  externallyConnectedPins?: string[][] | undefined;
18837
18867
  schPinArrangement?: {
@@ -24240,9 +24270,11 @@ declare const schematicCellProps: z.ZodObject<{
24240
24270
  rowSpan: z.ZodOptional<z.ZodNumber>;
24241
24271
  colSpan: z.ZodOptional<z.ZodNumber>;
24242
24272
  width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
24273
+ text: z.ZodOptional<z.ZodString>;
24243
24274
  }, "strip", z.ZodTypeAny, {
24244
24275
  children?: string | undefined;
24245
24276
  width?: number | undefined;
24277
+ text?: string | undefined;
24246
24278
  fontSize?: number | undefined;
24247
24279
  horizontalAlign?: "left" | "right" | "center" | undefined;
24248
24280
  verticalAlign?: "top" | "bottom" | "middle" | undefined;
@@ -24251,6 +24283,7 @@ declare const schematicCellProps: z.ZodObject<{
24251
24283
  }, {
24252
24284
  children?: string | undefined;
24253
24285
  width?: string | number | undefined;
24286
+ text?: string | undefined;
24254
24287
  fontSize?: string | number | undefined;
24255
24288
  horizontalAlign?: "left" | "right" | "center" | undefined;
24256
24289
  verticalAlign?: "top" | "bottom" | "middle" | undefined;
@@ -24265,6 +24298,7 @@ interface SchematicCellProps {
24265
24298
  rowSpan?: number;
24266
24299
  colSpan?: number;
24267
24300
  width?: number | string;
24301
+ text?: string;
24268
24302
  }
24269
24303
 
24270
24304
  declare const silkscreenTextProps: z.ZodObject<{
package/dist/index.js CHANGED
@@ -476,6 +476,7 @@ var chipProps = commonComponentProps.extend({
476
476
  manufacturerPartNumber: z25.string().optional(),
477
477
  pinLabels: pinLabelsProp.optional(),
478
478
  showPinAliases: z25.boolean().optional(),
479
+ pcbPinLabels: z25.record(z25.string(), z25.string()).optional(),
479
480
  internallyConnectedPins: z25.array(z25.array(z25.string())).optional(),
480
481
  externallyConnectedPins: z25.array(z25.array(z25.string())).optional(),
481
482
  schPinArrangement: schematicPortArrangement.optional(),
@@ -512,6 +513,7 @@ var jumperProps = commonComponentProps.extend({
512
513
  schHeight: distance8.optional(),
513
514
  schDirection: z27.enum(["left", "right"]).optional(),
514
515
  schPortArrangement: schematicPortArrangement.optional(),
516
+ pcbPinLabels: z27.record(z27.string(), z27.string()).optional(),
515
517
  pinCount: z27.union([z27.literal(2), z27.literal(3)]).optional(),
516
518
  internallyConnectedPins: z27.array(z27.array(z27.string())).optional(),
517
519
  connections: z27.custom().pipe(z27.record(z27.string(), connectionTarget2)).optional()
@@ -978,6 +980,7 @@ var pinHeaderProps = commonComponentProps.extend({
978
980
  schFacingDirection: z49.enum(["up", "down", "left", "right"]).optional(),
979
981
  gender: z49.enum(["male", "female"]).optional().default("male"),
980
982
  showSilkscreenPinLabels: z49.boolean().optional(),
983
+ pcbPinLabels: z49.record(z49.string(), z49.string()).optional(),
981
984
  doubleRow: z49.boolean().optional(),
982
985
  holeDiameter: distance14.optional(),
983
986
  platedDiameter: distance14.optional(),
@@ -1408,7 +1411,8 @@ var schematicCellProps = z74.object({
1408
1411
  fontSize: distance24.optional(),
1409
1412
  rowSpan: z74.number().optional(),
1410
1413
  colSpan: z74.number().optional(),
1411
- width: distance24.optional()
1414
+ width: distance24.optional(),
1415
+ text: z74.string().optional()
1412
1416
  });
1413
1417
  expectTypesMatch(true);
1414
1418
 
package/dist/index.js.map CHANGED
@@ -1 +1 @@
1
- {"version":3,"sources":["../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/cadModel.ts","../lib/common/point3.ts","../lib/common/footprintProp.ts","../lib/common/schematicOrientation.ts","../lib/common/schematicPinDefinitions.ts","../lib/common/schematicPinStyle.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/group.ts","../lib/manual-edits/manual-edit-events/base_manual_edit_event.ts","../lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts","../lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts","../lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts","../lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts","../lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts","../lib/manual-edits/manual_edit_event.ts","../lib/manual-edits/manual_edits_file.ts","../lib/manual-edits/manual_pcb_placement.ts","../lib/manual-edits/manual_trace_hint.ts","../lib/manual-edits/manual_schematic_placement.ts","../lib/components/breakout.ts","../lib/components/chip.ts","../lib/components/jumper.ts","../lib/common/connectionsProp.ts","../lib/components/solderjumper.ts","../lib/components/connector.ts","../lib/components/fuse.ts","../lib/components/platedhole.ts","../lib/components/resistor.ts","../lib/components/potentiometer.ts","../lib/components/crystal.ts","../lib/components/resonator.ts","../lib/components/stampboard.ts","../lib/components/capacitor.ts","../lib/components/net.ts","../lib/components/constrainedlayout.ts","../lib/common/distance.ts","../lib/components/constraint.ts","../lib/components/cutout.ts","../lib/components/smtpad.ts","../lib/components/solderpaste.ts","../lib/components/hole.ts","../lib/components/trace.ts","../lib/components/footprint.ts","../lib/components/battery.ts","../lib/components/pin-header.ts","../lib/components/netalias.ts","../lib/components/netlabel.ts","../lib/components/push-button.ts","../lib/components/subcircuit.ts","../lib/components/transistor.ts","../lib/components/mosfet.ts","../lib/components/inductor.ts","../lib/components/diode.ts","../lib/components/led.ts","../lib/components/switch.ts","../lib/components/fabrication-note-text.ts","../lib/components/fabrication-note-path.ts","../lib/components/pcb-trace.ts","../lib/components/via.ts","../lib/components/testpoint.ts","../lib/components/breakoutpoint.ts","../lib/components/pcb-keepout.ts","../lib/components/power-source.ts","../lib/components/schematic-box.ts","../lib/common/ninePointAnchor.ts","../lib/components/schematic-line.ts","../lib/components/schematic-text.ts","../lib/common/fivePointAnchor.ts","../lib/components/schematic-path.ts","../lib/components/schematic-table.ts","../lib/components/schematic-row.ts","../lib/components/schematic-cell.ts","../lib/components/silkscreen-text.ts","../lib/components/silkscreen-path.ts","../lib/components/silkscreen-line.ts","../lib/components/silkscreen-rect.ts","../lib/components/silkscreen-circle.ts","../lib/components/trace-hint.ts","../lib/components/port.ts","../lib/platformConfig.ts"],"sourcesContent":["import type { TypeEqual } from \"ts-expect\"\n\ntype IsNever<T> = [T] extends [never] ? true : false\n\ntype GetMismatchedProps<T1, T2> = {\n [K in keyof T1 & keyof T2]: T1[K] extends T2[K]\n ? T2[K] extends T1[K]\n ? never\n : K\n : K\n}[keyof T1 & keyof T2]\n\nexport const expectTypesMatch = <\n const T1,\n const T2,\n T3 = Exclude<keyof T1, keyof T2>,\n T4 = Exclude<keyof T2, keyof T1>,\n T5 = GetMismatchedProps<T1, T2>,\n>(\n shouldBe: IsNever<T3> extends true\n ? IsNever<T4> extends true\n ? IsNever<T5> extends true\n ? TypeEqual<T1, T2>\n : `property ${T5 extends string ? T5 : \"\"} has mismatched types`\n : `extra props ${T4 extends string ? T4 : \"\"}`\n : `missing props ${T3 extends string ? T3 : \"\"}`,\n): void => {}\n\n// ------ TESTS -------\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: number\n b: number\n }\n>(\"extra props b\")\n\nexpectTypesMatch<\n {\n a: number\n b: number\n },\n {\n a: number\n }\n>(\"missing props b\")\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: number\n }\n>(true)\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: string\n }\n>(\"property a has mismatched types\")\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import {\n type LayerRefInput,\n distance,\n layer_ref,\n rotation,\n supplier_name,\n} from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { type CadModelProp, cadModelProp } from \"./cadModel\"\nimport { type FootprintProp, footprintProp } from \"./footprintProp\"\n\nexport interface PcbLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n layer?: LayerRefInput\n}\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: FootprintProp\n}\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\ntype InferredPcbLayoutProps = z.input<typeof pcbLayoutProps>\nexpectTypesMatch<PcbLayoutProps, InferredPcbLayoutProps>(true)\n\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport type SupplierPartNumbers = { [k in SupplierName]?: string[] }\nexport interface SupplierProps {\n supplierPartNumbers?: SupplierPartNumbers\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps<PinLabel extends string = string>\n extends CommonLayoutProps {\n key?: any\n name: string\n pinAttributes?: Record<PinLabel, Record<string, any>>\n supplierPartNumbers?: SupplierPartNumbers\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n doNotPlace?: boolean\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n key: z.any().optional(),\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n doNotPlace: z.boolean().optional(),\n pinAttributes: z\n .record(z.string(), z.record(z.string(), z.any()))\n .optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp =\n | null\n | string\n | CadModelStl\n | CadModelObj\n | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.null(),\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import type { LayerRef } from \"circuit-json\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type FootprintProp = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<FootprintProp>((v) => true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport const schematicOrientation = z\n .enum([\n \"vertical\",\n \"horizontal\",\n \"pos_top\",\n \"pos_bottom\",\n \"pos_left\",\n \"pos_right\",\n \"neg_top\",\n \"neg_bottom\",\n \"neg_left\",\n \"neg_right\",\n ])\n .describe(\n \"horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)\",\n )\n\nexport type SchematicOrientation =\n | \"vertical\"\n | \"horizontal\"\n | \"pos_top\"\n | \"pos_bottom\"\n | \"pos_left\"\n | \"pos_right\"\n | \"neg_top\"\n | \"neg_bottom\"\n | \"neg_left\"\n | \"neg_right\"\n\nexpectTypesMatch<SchematicOrientation, z.infer<typeof schematicOrientation>>(\n true,\n)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use SchematicPortArrangementWithPinCounts instead.\n */\nexport interface SchematicPortArrangementWithSizes {\n leftSize?: number\n topSize?: number\n rightSize?: number\n bottomSize?: number\n}\n\n/**\n * Specifies the number of pins on each side of the schematic box component.\n */\nexport interface SchematicPortArrangementWithPinCounts {\n leftPinCount?: number\n topPinCount?: number\n rightPinCount?: number\n bottomPinCount?: number\n}\n\nexport interface PinSideDefinition {\n pins: Array<number | string>\n direction:\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n}\n\nexport interface SchematicPortArrangementWithSides {\n leftSide?: PinSideDefinition\n topSide?: PinSideDefinition\n rightSide?: PinSideDefinition\n bottomSide?: PinSideDefinition\n}\n\nexport interface SchematicPortArrangement\n extends SchematicPortArrangementWithSizes,\n SchematicPortArrangementWithSides,\n SchematicPortArrangementWithPinCounts {}\n\nexport type SchematicPinArrangement = SchematicPortArrangement\nexport type SchematicPinArrangementWithSizes = SchematicPortArrangementWithSizes\nexport type SchematicPinArrangementWithSides = SchematicPortArrangementWithSides\nexport type SchematicPinArrangementWithPinCounts =\n SchematicPortArrangementWithPinCounts\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.union([z.number(), z.string()])),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\n/**\n * @deprecated Use schematicPinArrangement instead.\n */\nexport const schematicPortArrangement = z.object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z.number().optional().describe(\"@deprecated, use bottomPinCount\"),\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n})\n\nexport const schematicPinArrangement = schematicPortArrangement\n\nexpectTypesMatch<\n SchematicPortArrangement,\n z.input<typeof schematicPortArrangement>\n>(true)\n","import { distance } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n marginTop?: number | string\n marginRight?: number | string\n marginBottom?: number | string\n marginLeft?: number | string\n\n /** @deprecated use marginLeft */\n leftMargin?: number | string\n /** @deprecated use marginRight */\n rightMargin?: number | string\n /** @deprecated use marginTop */\n topMargin?: number | string\n /** @deprecated use marginBottom */\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n marginLeft: distance.optional(),\n marginRight: distance.optional(),\n marginTop: distance.optional(),\n marginBottom: distance.optional(),\n\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { distance } from \"circuit-json\"\nimport { type Point, point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { subcircuitGroupProps, type SubcircuitGroupProps } from \"./group\"\n\nexport interface BoardProps extends Omit<SubcircuitGroupProps, \"subcircuit\"> {\n width?: number | string\n height?: number | string\n outline?: Point[]\n outlineOffsetX?: number | string\n outlineOffsetY?: number | string\n material?: \"fr4\" | \"fr1\"\n}\n\nexport const boardProps = subcircuitGroupProps.extend({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n outlineOffsetX: distance.optional(),\n outlineOffsetY: distance.optional(),\n material: z.enum([\"fr4\", \"fr1\"]).default(\"fr4\"),\n})\n\ntype InferredBoardProps = z.input<typeof boardProps>\nexpectTypesMatch<BoardProps, InferredBoardProps>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { layer_ref, length } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport {\n type CommonLayoutProps,\n commonLayoutProps,\n type SupplierPartNumbers,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport type { AnySourceComponent, PcbTrace } from \"circuit-json\"\nimport {\n manual_edits_file,\n type ManualEditsFile,\n type ManualEditsFileInput,\n} from \"lib/manual-edits\"\n\nexport const layoutConfig = z.object({\n layoutMode: z.enum([\"grid\", \"flex\", \"match-adapt\", \"none\"]).optional(),\n position: z.enum([\"absolute\", \"relative\"]).optional(),\n\n grid: z.boolean().optional(),\n gridCols: z.number().or(z.string()).optional(),\n gridRows: z.number().or(z.string()).optional(),\n gridTemplateRows: z.string().optional(),\n gridTemplateColumns: z.string().optional(),\n gridTemplate: z.string().optional(),\n gridGap: z.number().or(z.string()).optional(),\n\n flex: z.boolean().or(z.string()).optional(),\n flexDirection: z.enum([\"row\", \"column\"]).optional(),\n alignItems: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n justifyContent: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n flexRow: z.boolean().optional(),\n flexColumn: z.boolean().optional(),\n gap: z.number().or(z.string()).optional(),\n\n padding: length.optional(),\n paddingLeft: length.optional(),\n paddingRight: length.optional(),\n paddingTop: length.optional(),\n paddingBottom: length.optional(),\n paddingX: length.optional(),\n paddingY: length.optional(),\n\n width: length.optional(),\n height: length.optional(),\n\n matchAdapt: z.boolean().optional(),\n matchAdaptTemplate: z.any().optional(),\n})\n\nexport interface LayoutConfig {\n layoutMode?: \"grid\" | \"flex\" | \"match-adapt\" | \"none\"\n position?: \"absolute\" | \"relative\"\n\n grid?: boolean\n gridCols?: number | string\n gridRows?: number | string\n gridTemplateRows?: string\n gridTemplateColumns?: string\n gridTemplate?: string\n gridGap?: number | string\n\n flex?: boolean | string\n flexDirection?: \"row\" | \"column\"\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\"\n justifyContent?: \"start\" | \"center\" | \"end\" | \"stretch\"\n flexRow?: boolean\n flexColumn?: boolean\n gap?: number | string\n\n padding?: Distance\n paddingLeft?: Distance\n paddingRight?: Distance\n paddingTop?: Distance\n paddingBottom?: Distance\n paddingX?: Distance\n paddingY?: Distance\n\n width?: Distance\n height?: Distance\n\n matchAdapt?: boolean\n matchAdaptTemplate?: any\n}\n\nexpectTypesMatch<LayoutConfig, z.input<typeof layoutConfig>>(true)\n\nexport interface Border {\n strokeWidth?: Distance\n dashed?: boolean\n solid?: boolean\n}\n\nexport const border = z.object({\n strokeWidth: length.optional(),\n dashed: z.boolean().optional(),\n solid: z.boolean().optional(),\n})\n\nexport interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {\n name?: string\n key?: any\n children?: any\n\n /**\n * Title to display above this group in the schematic view\n */\n schTitle?: string\n\n pcbWidth?: Distance\n pcbHeight?: Distance\n schWidth?: Distance\n schHeight?: Distance\n\n pcbLayout?: LayoutConfig\n schLayout?: LayoutConfig\n cellBorder?: Border | null\n border?: Border | null\n schPadding?: Distance\n schPaddingLeft?: Distance\n schPaddingRight?: Distance\n schPaddingTop?: Distance\n schPaddingBottom?: Distance\n}\n\nexport type PartsEngine = {\n findPart: (params: {\n sourceComponent: AnySourceComponent\n footprinterString?: string\n }) => Promise<SupplierPartNumbers> | SupplierPartNumbers\n}\n\nexport interface PcbRouteCache {\n pcbTraces: PcbTrace[]\n cacheKey: string\n}\n\nexport interface AutorouterConfig {\n serverUrl?: string\n inputFormat?: \"simplified\" | \"circuit-json\"\n serverMode?: \"job\" | \"solve-endpoint\"\n serverCacheEnabled?: boolean\n cache?: PcbRouteCache\n traceClearance?: Distance\n groupMode?: \"sequential-trace\" | \"subcircuit\"\n local?: boolean\n algorithmFn?: (simpleRouteJson: any) => Promise<any>\n preset?:\n | \"sequential-trace\"\n | \"subcircuit\"\n | \"auto\"\n | \"auto-local\"\n | \"auto-cloud\"\n}\n\nexport type AutorouterProp =\n | AutorouterConfig\n | \"sequential-trace\"\n | \"subcircuit\"\n | \"auto\"\n | \"auto-local\"\n | \"auto-cloud\"\n\nexport const autorouterConfig = z.object({\n serverUrl: z.string().optional(),\n inputFormat: z.enum([\"simplified\", \"circuit-json\"]).optional(),\n serverMode: z.enum([\"job\", \"solve-endpoint\"]).optional(),\n serverCacheEnabled: z.boolean().optional(),\n cache: z.custom<PcbRouteCache>((v) => true).optional(),\n traceClearance: length.optional(),\n groupMode: z.enum([\"sequential-trace\", \"subcircuit\"]).optional(),\n algorithmFn: z\n .custom<(simpleRouteJson: any) => Promise<any>>(\n (v) => typeof v === \"function\" || v === undefined,\n )\n .optional(),\n preset: z\n .enum([\n \"sequential-trace\",\n \"subcircuit\",\n \"auto\",\n \"auto-local\",\n \"auto-cloud\",\n ])\n .optional(),\n local: z.boolean().optional(),\n})\n\nexport const autorouterProp = z.union([\n autorouterConfig,\n z.literal(\"sequential-trace\"),\n z.literal(\"subcircuit\"),\n z.literal(\"auto\"),\n z.literal(\"auto-local\"),\n z.literal(\"auto-cloud\"),\n])\n\nexport interface SubcircuitGroupProps extends BaseGroupProps {\n manualEdits?: ManualEditsFileInput\n routingDisabled?: boolean\n defaultTraceWidth?: Distance\n minTraceWidth?: Distance\n pcbRouteCache?: PcbRouteCache\n\n autorouter?: AutorouterProp\n\n /**\n * If true, we'll automatically layout the schematic for this group. Must be\n * a subcircuit (currently). This is eventually going to be replaced with more\n * sophisticated layout options/modes and will be enabled by default.\n */\n schAutoLayoutEnabled?: boolean\n\n /**\n * If true, net labels will automatically be created for complex traces\n */\n schTraceAutoLabelEnabled?: boolean\n\n partsEngine?: PartsEngine\n}\n\nexport interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps {\n subcircuit: true\n}\n\nexport interface NonSubcircuitGroupProps extends BaseGroupProps {\n subcircuit?: false | undefined\n}\n\nexport type GroupProps = SubcircuitGroupPropsWithBool | NonSubcircuitGroupProps\n\nexport const baseGroupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n children: z.any().optional(),\n schTitle: z.string().optional(),\n key: z.any().optional(),\n\n ...layoutConfig.shape,\n pcbWidth: length.optional(),\n pcbHeight: length.optional(),\n schWidth: length.optional(),\n schHeight: length.optional(),\n pcbLayout: layoutConfig.optional(),\n schLayout: layoutConfig.optional(),\n cellBorder: border.nullable().optional(),\n border: border.nullable().optional(),\n schPadding: length.optional(),\n schPaddingLeft: length.optional(),\n schPaddingRight: length.optional(),\n schPaddingTop: length.optional(),\n schPaddingBottom: length.optional(),\n})\n\nexport const partsEngine = z.custom<PartsEngine>((v) => \"findPart\" in v)\n\nexport const subcircuitGroupProps = baseGroupProps.extend({\n manualEdits: manual_edits_file.optional(),\n schAutoLayoutEnabled: z.boolean().optional(),\n schTraceAutoLabelEnabled: z.boolean().optional(),\n routingDisabled: z.boolean().optional(),\n defaultTraceWidth: length.optional(),\n minTraceWidth: length.optional(),\n partsEngine: partsEngine.optional(),\n pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),\n autorouter: autorouterProp.optional(),\n})\n\nexport const subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({\n subcircuit: z.literal(true),\n})\n\nexport const groupProps = z.discriminatedUnion(\"subcircuit\", [\n baseGroupProps.extend({ subcircuit: z.literal(false).optional() }),\n subcircuitGroupPropsWithBool,\n])\n\ntype InferredBaseGroupProps = z.input<typeof baseGroupProps>\ntype InferredSubcircuitGroupPropsWithBool = z.input<\n typeof subcircuitGroupPropsWithBool\n>\n\nexpectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)\nexpectTypesMatch<\n SubcircuitGroupPropsWithBool,\n InferredSubcircuitGroupPropsWithBool\n>(true)\n\ntype InferredGroupProps = z.input<typeof groupProps>\nexpectTypesMatch<GroupProps, InferredGroupProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport const base_manual_edit_event = z.object({\n edit_event_id: z.string(),\n in_progress: z.boolean().optional(),\n created_at: z.number(),\n})\n\nexport interface BaseManualEditEvent {\n edit_event_id: string\n in_progress?: boolean\n created_at: number\n}\n\nexport type BaseManualEditEventInput = z.input<typeof base_manual_edit_event>\n\nexpectTypesMatch<BaseManualEditEvent, z.infer<typeof base_manual_edit_event>>(\n true,\n)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_pcb_component_location_event = base_manual_edit_event.extend({\n pcb_edit_event_type: z\n .literal(\"edit_component_location\")\n .describe(\"deprecated\"),\n edit_event_type: z.literal(\"edit_pcb_component_location\"),\n pcb_component_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n})\n\n/** @deprecated use edit_pcb_component_location_event instead */\nexport const edit_component_location_event = edit_pcb_component_location_event\n\nexport interface EditPcbComponentLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_pcb_component_location\"\n /** @deprecated */\n pcb_edit_event_type: \"edit_component_location\"\n pcb_component_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditPcbComponentLocationEventInput = z.input<\n typeof edit_pcb_component_location_event\n>\n\nexpectTypesMatch<\n EditPcbComponentLocationEvent,\n z.infer<typeof edit_pcb_component_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_trace_hint_event = base_manual_edit_event.extend({\n pcb_edit_event_type: z.literal(\"edit_trace_hint\").describe(\"deprecated\"),\n edit_event_type: z.literal(\"edit_pcb_trace_hint\").optional(),\n pcb_port_id: z.string(),\n pcb_trace_hint_id: z.string().optional(),\n route: z.array(\n z.object({ x: z.number(), y: z.number(), via: z.boolean().optional() }),\n ),\n})\n\nexport interface EditTraceHintEvent extends BaseManualEditEvent {\n /** @deprecated */\n pcb_edit_event_type: \"edit_trace_hint\"\n edit_event_type?: \"edit_pcb_trace_hint\"\n pcb_port_id: string\n pcb_trace_hint_id?: string\n route: Array<{ x: number; y: number; via?: boolean }>\n}\n\nexport type EditTraceHintEventInput = z.input<typeof edit_trace_hint_event>\n\nexpectTypesMatch<EditTraceHintEvent, z.infer<typeof edit_trace_hint_event>>(\n true,\n)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_schematic_component_location_event =\n base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_schematic_component_location\"),\n schematic_component_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n })\n\nexport interface EditSchematicComponentLocationEvent\n extends BaseManualEditEvent {\n edit_event_type: \"edit_schematic_component_location\"\n schematic_component_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditSchematicComponentLocationEventInput = z.input<\n typeof edit_schematic_component_location_event\n>\n\nexpectTypesMatch<\n EditSchematicComponentLocationEvent,\n z.infer<typeof edit_schematic_component_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_pcb_group_location_event = base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_pcb_group_location\"),\n pcb_group_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n})\n\nexport interface EditPcbGroupLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_pcb_group_location\"\n pcb_group_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditPcbGroupLocationEventInput = z.input<\n typeof edit_pcb_group_location_event\n>\n\nexpectTypesMatch<\n EditPcbGroupLocationEvent,\n z.infer<typeof edit_pcb_group_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_schematic_group_location_event =\n base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_schematic_group_location\"),\n schematic_group_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n })\n\nexport interface EditSchematicGroupLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_schematic_group_location\"\n schematic_group_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditSchematicGroupLocationEventInput = z.input<\n typeof edit_schematic_group_location_event\n>\n\nexpectTypesMatch<\n EditSchematicGroupLocationEvent,\n z.infer<typeof edit_schematic_group_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n edit_pcb_component_location_event,\n type EditPcbComponentLocationEvent,\n} from \"./manual-edit-events/edit_pcb_component_location_event\"\nimport {\n edit_schematic_component_location_event,\n type EditSchematicComponentLocationEvent,\n} from \"./manual-edit-events/edit_schematic_component_location_event\"\nimport {\n edit_trace_hint_event,\n type EditTraceHintEvent,\n} from \"./manual-edit-events/edit_trace_hint_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type ManualEditEvent =\n | EditPcbComponentLocationEvent\n | EditTraceHintEvent\n | EditSchematicComponentLocationEvent\n\nexport const manual_edit_event = z.union([\n edit_pcb_component_location_event,\n edit_trace_hint_event,\n edit_schematic_component_location_event,\n])\n\nexport type ManualEditEventInput = z.input<typeof manual_edit_event>\ntype InferredManualEditEvent = z.infer<typeof manual_edit_event>\n\nexpectTypesMatch<ManualEditEvent, InferredManualEditEvent>(true)\n","import { z } from \"zod\"\nimport {\n manual_pcb_placement,\n type ManualPcbPlacement,\n} from \"./manual_pcb_placement\"\nimport { manual_edit_event } from \"./manual_edit_event\"\nimport { manual_trace_hint, type ManualTraceHint } from \"./manual_trace_hint\"\nimport {\n manual_schematic_placement,\n type ManualSchematicPlacement,\n} from \"./manual_schematic_placement\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_edits_file = z.object({\n pcb_placements: z.array(manual_pcb_placement).optional(),\n manual_trace_hints: z.array(manual_trace_hint).optional(),\n schematic_placements: z.array(manual_schematic_placement).optional(),\n})\n\nexport interface ManualEditsFile {\n pcb_placements?: ManualPcbPlacement[]\n manual_trace_hints?: ManualTraceHint[]\n schematic_placements?: ManualSchematicPlacement[]\n}\n\nexport type ManualEditsFileInput = z.input<typeof manual_edits_file>\n\nexpectTypesMatch<ManualEditsFile, z.infer<typeof manual_edits_file>>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_pcb_placement = z.object({\n selector: z.string(),\n relative_to: z\n .string()\n .optional()\n .default(\"group_center\")\n .describe(\"Can be a selector or 'group_center'\"),\n center: point,\n})\n\nexport interface ManualPcbPlacement {\n selector: string\n relative_to: string\n center: Point\n}\n\nexport type ManualPcbPlacementInput = z.input<typeof manual_pcb_placement>\ntype InferredManualPcbPlacement = z.infer<typeof manual_pcb_placement>\n\nexpectTypesMatch<ManualPcbPlacement, InferredManualPcbPlacement>(true)\n","import { z } from \"zod\"\nimport { layer_ref, route_hint_point, type RouteHintPoint } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_trace_hint = z.object({\n pcb_port_selector: z.string(),\n offsets: z.array(route_hint_point),\n})\n\nexport interface ManualTraceHint {\n pcb_port_selector: string\n offsets: Array<RouteHintPoint>\n}\n\nexport type ManualTraceHintInput = z.input<typeof manual_trace_hint>\n\nexpectTypesMatch<ManualTraceHint, z.infer<typeof manual_trace_hint>>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_schematic_placement = z.object({\n selector: z.string(),\n relative_to: z\n .string()\n .optional()\n .default(\"group_center\")\n .describe(\"Can be a selector or 'group_center'\"),\n center: point,\n})\n\nexport interface ManualSchematicPlacement {\n selector: string\n relative_to: string\n center: Point\n}\n\nexport type ManualSchematicPlacementInput = z.input<\n typeof manual_schematic_placement\n>\ntype InferredManualSchematicPlacement = z.infer<\n typeof manual_schematic_placement\n>\n\nexpectTypesMatch<ManualSchematicPlacement, InferredManualSchematicPlacement>(\n true,\n)\n","import { distance } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { subcircuitGroupProps, type SubcircuitGroupProps } from \"./group\"\n\nexport interface BreakoutProps\n extends Omit<SubcircuitGroupProps, \"subcircuit\"> {\n padding?: Distance\n paddingLeft?: Distance\n paddingRight?: Distance\n paddingTop?: Distance\n paddingBottom?: Distance\n}\n\nexport const breakoutProps = subcircuitGroupProps.extend({\n padding: distance.optional(),\n paddingLeft: distance.optional(),\n paddingRight: distance.optional(),\n paddingTop: distance.optional(),\n paddingBottom: distance.optional(),\n})\n\ntype InferredBreakoutProps = z.input<typeof breakoutProps>\nexpectTypesMatch<BreakoutProps, InferredBreakoutProps>(true)\n","import { distance, supplier_name } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n type SupplierPartNumbers,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement as schematicPinArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport type PinLabelsProp<\n PinNumber extends string = string,\n PinLabel extends string = string,\n> = Record<PinNumber, PinLabel | readonly PinLabel[] | PinLabel[]>\n\nexport type PinLabelFromPinLabelMap<PinLabelMap extends PinLabelsProp> =\n PinLabelMap extends PinLabelsProp<infer PinNumber, infer PinLabel>\n ? PinLabel\n : never\n\nexport interface PinCompatibleVariant {\n manufacturerPartNumber?: string\n supplierPartNumber?: SupplierPartNumbers\n}\n\nexport interface ChipPropsSU<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n manufacturerPartNumber?: string\n pinLabels?: PinLabelsProp<string, PinLabel>\n /**\n * Whether to show pin aliases in the schematic\n */\n showPinAliases?: boolean\n schPinArrangement?: SchematicPortArrangement\n /** @deprecated Use schPinArrangement instead. */\n schPortArrangement?: SchematicPortArrangement\n pinCompatibleVariants?: PinCompatibleVariant[]\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: Distance\n schWidth?: Distance\n schHeight?: Distance\n noSchematicRepresentation?: boolean\n internallyConnectedPins?: string[][]\n externallyConnectedPins?: string[][]\n connections?: Connections<PinLabel>\n}\n\nexport type ChipProps<PinLabelMap extends PinLabelsProp | string = string> =\n ChipPropsSU<\n PinLabelMap extends PinLabelsProp\n ? PinLabelFromPinLabelMap<PinLabelMap> | keyof PinLabelMap\n : PinLabelMap\n >\n\n/**\n * Get the pin labels for a component\n *\n * const pinLabels = { pin1: \"VCC\", pin2: \"GND\", pin3: \"DATA\" } as const\n * export const MyChip = (props: ChipProps<typeof pinLabels>) => {\n * // ...\n * }\n * type MyChipPinLabels = ChipPinLabels<typeof MyChip>\n * // MyChipPinLabels is \"VCC\" | \"GND\" | \"DATA\"\n *\n */\nexport type ChipPinLabels<T extends (props: ChipProps<any>) => any> =\n T extends (props: infer Props) => any\n ? Props extends ChipProps<infer PinLabelMap>\n ? PinLabelMap extends PinLabelsProp\n ? PinLabelFromPinLabelMap<PinLabelMap>\n : PinLabelMap extends string\n ? PinLabelMap\n : never\n : never\n : never\n\n/**\n * Get the connection prop type for a component\n *\n * const pinLabels = { pin1: \"VCC\", pin2: \"GND\", pin3: \"DATA\" } as const\n * export const MyChip = (props: ChipProps<typeof pinLabels>) => {\n * // ...\n * }\n * const connections: ChipConnections<typeof MyChip> = {\n * VCC: \"...\",\n * GND: \"...\",\n * DATA: \"...\",\n * }\n *\n */\nexport type ChipConnections<T extends (props: ChipProps<any>) => any> = {\n [K in ChipPinLabels<T>]: string\n}\n\nconst connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nconst connectionsProp = z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n\nexport const pinLabelsProp = z.record(\n z.string(),\n z.string().or(z.array(z.string()).readonly()).or(z.array(z.string())),\n)\n\nexpectTypesMatch<PinLabelsProp, z.input<typeof pinLabelsProp>>(true)\n\nexport const pinCompatibleVariant = z.object({\n manufacturerPartNumber: z.string().optional(),\n supplierPartNumber: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: pinLabelsProp.optional(),\n showPinAliases: z.boolean().optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n externallyConnectedPins: z.array(z.array(z.string())).optional(),\n schPinArrangement: schematicPinArrangement.optional(),\n schPortArrangement: schematicPinArrangement.optional(),\n pinCompatibleVariants: z.array(pinCompatibleVariant).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n noSchematicRepresentation: z.boolean().optional(),\n connections: connectionsProp.optional(),\n})\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type InferredChipProps = z.input<typeof chipProps>\n\n// Chip props are too complex to match up with zod types, we typecheck\n// them separately in the test files\nexpectTypesMatch<InferredChipProps, ChipPropsSU<string>>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { connectionTarget } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string | string[]>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n /**\n * Number of pins on the jumper (2 or 3)\n */\n pinCount?: 2 | 3\n /**\n * Groups of pins that are internally connected\n * e.g., [[\"1\",\"2\"], [\"2\",\"3\"]]\n */\n internallyConnectedPins?: string[][]\n /**\n * Connections to other components\n */\n connections?: Connections<string>\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z\n .record(z.number().or(z.string()), z.string().or(z.array(z.string())))\n .optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n pinCount: z.union([z.literal(2), z.literal(3)]).optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n connections: z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n .optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\n\nexport const connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nexport const createConnectionsProp = <T extends readonly [string, ...string[]]>(\n labels: T,\n) => {\n return z.record(z.enum(labels), connectionTarget)\n}\n","import { jumperProps, type JumperProps } from \"./jumper\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface SolderJumperProps extends JumperProps {\n /**\n * Pins that are bridged with solder by default\n */\n bridgedPins?: string[][]\n /**\n * If true, all pins are connected with cuttable traces\n */\n bridged?: boolean\n}\n\nexport const solderjumperProps = jumperProps.extend({\n bridgedPins: z.array(z.array(z.string())).optional(),\n bridged: z.boolean().optional(),\n})\n\ntype InferredSolderJumperProps = z.input<typeof solderjumperProps>\nexpectTypesMatch<SolderJumperProps, InferredSolderJumperProps>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConnectorProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string | string[]>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n /**\n * Groups of pins that are internally connected\n * e.g., [[\"1\",\"2\"], [\"2\",\"3\"]]\n */\n internallyConnectedPins?: string[][]\n /**\n * Connector standard, e.g. usb_c, m2\n */\n standard?: \"usb_c\" | \"m2\"\n}\n\nexport const connectorProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z\n .record(z.number().or(z.string()), z.string().or(z.array(z.string())))\n .optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n standard: z.enum([\"usb_c\", \"m2\"]).optional(),\n})\n\ntype InferredConnectorProps = z.input<typeof connectorProps>\nexpectTypesMatch<ConnectorProps, InferredConnectorProps>(true)\n","import { z } from \"zod\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\n\n/**\n * Pin labels for fuse component\n */\nexport const fusePinLabels = [\"pin1\", \"pin2\"] as const\n\nexport type FusePinLabels = (typeof fusePinLabels)[number]\n\nexport interface FuseProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n /**\n * Current rating of the fuse in amperes\n */\n currentRating: number | string\n\n /**\n * Voltage rating of the fuse\n */\n voltageRating?: number | string\n\n /**\n * Whether to show ratings on schematic\n */\n schShowRatings?: boolean\n\n schOrientation?: SchematicOrientation\n\n /**\n * Connections to other components\n */\n connections?: Connections<PinLabel>\n}\n\n/**\n * Schema for validating fuse props\n */\nexport const fuseProps = commonComponentProps.extend({\n currentRating: z.union([z.number(), z.string()]),\n voltageRating: z.union([z.number(), z.string()]).optional(),\n schShowRatings: z.boolean().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()).readonly(),\n z.array(z.string()),\n ]),\n )\n .optional(),\n})\n\nexport type InferredFuseProps = z.input<typeof fuseProps>\n","import { distance } from \"circuit-json\"\nimport type { PcbLayoutProps } from \"lib/common/layout\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { type PortHints, portHints } from \"lib/common/portHints\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface CirclePlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"circle\"\n holeDiameter: number | string\n outerDiameter: number | string\n portHints?: PortHints\n}\n\nexport interface OvalPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"oval\"\n outerWidth: number | string\n outerHeight: number | string\n holeWidth: number | string\n holeHeight: number | string\n portHints?: PortHints\n\n /** @deprecated use holeWidth */\n innerWidth?: number | string\n /** @deprecated use holeHeight */\n innerHeight?: number | string\n}\n\nexport interface PillPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"pill\"\n outerWidth: number | string\n outerHeight: number | string\n holeWidth: number | string\n holeHeight: number | string\n\n /** @deprecated use holeWidth */\n innerWidth?: number | string\n /** @deprecated use holeHeight */\n innerHeight?: number | string\n\n portHints?: PortHints\n}\n\nexport interface CircularHoleWithRectPlatedProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"circular_hole_with_rect_pad\"\n holeDiameter: number | string\n rectPadWidth: number | string\n rectPadHeight: number | string\n holeShape?: \"circle\"\n padShape?: \"rect\"\n portHints?: PortHints\n}\n\nexport interface PillWithRectPadPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"pill_hole_with_rect_pad\"\n holeShape: \"pill\"\n padShape: \"rect\"\n holeWidth: number | string\n holeHeight: number | string\n rectPadWidth: number | string\n rectPadHeight: number | string\n portHints?: PortHints\n}\n\nexport type PlatedHoleProps =\n | CirclePlatedHoleProps\n | OvalPlatedHoleProps\n | PillPlatedHoleProps\n | CircularHoleWithRectPlatedProps\n | PillWithRectPadPlatedHoleProps\n\nconst distanceHiddenUndefined = z\n .custom<z.input<typeof distance>>()\n .transform((a) => {\n if (a === undefined) return undefined\n return distance.parse(a)\n })\n\nexport const platedHoleProps = z\n .discriminatedUnion(\"shape\", [\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n holeWidth: distanceHiddenUndefined,\n holeHeight: distanceHiddenUndefined,\n innerWidth: distance.optional().describe(\"DEPRECATED use holeWidth\"),\n innerHeight: distance.optional().describe(\"DEPRECATED use holeHeight\"),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"pill\"),\n outerWidth: distance,\n outerHeight: distance,\n holeWidth: distanceHiddenUndefined,\n holeHeight: distanceHiddenUndefined,\n innerWidth: distance.optional().describe(\"DEPRECATED use holeWidth\"),\n innerHeight: distance.optional().describe(\"DEPRECATED use holeHeight\"),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"circular_hole_with_rect_pad\"),\n holeDiameter: distance,\n rectPadWidth: distance,\n rectPadHeight: distance,\n holeShape: z.literal(\"circle\").optional(),\n padShape: z.literal(\"rect\").optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"pill_hole_with_rect_pad\"),\n holeShape: z.literal(\"pill\"),\n padShape: z.literal(\"rect\"),\n holeWidth: distance,\n holeHeight: distance,\n rectPadWidth: distance,\n rectPadHeight: distance,\n portHints: portHints.optional(),\n }),\n ])\n .refine((a) => {\n if (\"innerWidth\" in a && a.innerWidth !== undefined) {\n a.holeWidth ??= a.innerWidth\n }\n if (\"innerHeight\" in a && a.innerHeight !== undefined) {\n a.holeHeight ??= a.innerHeight\n }\n return a\n })\n\ntype InferredPlatedHoleProps = z.input<typeof platedHoleProps>\n\nexpectTypesMatch<PlatedHoleProps, InferredPlatedHoleProps>(true)\n","import { resistance } from \"circuit-json\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport const resistorPinLabels = [\"pin1\", \"pin2\", \"pos\", \"neg\"] as const\nexport type ResistorPinLabels = (typeof resistorPinLabels)[number]\n\nexport interface ResistorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n schOrientation?: SchematicOrientation\n connections?: Connections<ResistorPinLabels>\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n\n schOrientation: schematicOrientation.optional(),\n\n connections: createConnectionsProp(resistorPinLabels).optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { resistance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type PotentiometerPinVariant = \"two_pin\" | \"three_pin\"\n\nexport interface PotentiometerProps extends CommonComponentProps {\n maxResistance: number | string\n pinVariant?: PotentiometerPinVariant\n}\n\nexport const potentiometerProps = commonComponentProps.extend({\n maxResistance: resistance,\n pinVariant: z.enum([\"two_pin\", \"three_pin\"]).optional(),\n})\n\ntype InferredPotentiometerProps = z.input<typeof potentiometerProps>\nexpectTypesMatch<PotentiometerProps, InferredPotentiometerProps>(true)\n","import { frequency, capacitance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type PinVariant = \"two_pin\" | \"four_pin\"\n\nexport interface CrystalProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n frequency: number | string\n loadCapacitance: number | string\n pinVariant?: PinVariant\n schOrientation?: SchematicOrientation\n}\n\nexport const crystalProps = commonComponentProps.extend({\n frequency: frequency,\n loadCapacitance: capacitance,\n pinVariant: z.enum([\"two_pin\", \"four_pin\"]).optional(),\n schOrientation: schematicOrientation.optional(),\n})\nexport const crystalPins = lrPins\nexport type CrystalPinLabels = (typeof crystalPins)[number]\n\ntype InferredCrystalProps = z.input<typeof crystalProps>\nexpectTypesMatch<CrystalProps, InferredCrystalProps>(true)\n","import { frequency, capacitance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type ResonatorPinVariant = \"no_ground\" | \"ground_pin\" | \"two_ground_pins\"\n\nexport interface ResonatorProps extends CommonComponentProps {\n frequency: number | string\n loadCapacitance: number | string\n pinVariant?: ResonatorPinVariant\n}\n\nexport const resonatorProps = commonComponentProps.extend({\n frequency: frequency,\n loadCapacitance: capacitance,\n pinVariant: z.enum([\"no_ground\", \"ground_pin\", \"two_ground_pins\"]).optional(),\n})\n\ntype InferredResonatorProps = z.input<typeof resonatorProps>\nexpectTypesMatch<ResonatorProps, InferredResonatorProps>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { boardProps, type BoardProps } from \"lib/components/board\"\n\nexport interface StampboardProps extends BoardProps {\n leftPinCount?: number\n rightPinCount?: number\n topPinCount?: number\n bottomPinCount?: number\n leftPins?: string[]\n rightPins?: string[]\n topPins?: string[]\n bottomPins?: string[]\n pinPitch?: number | string\n innerHoles?: boolean\n}\n\nexport const stampboardProps = boardProps.extend({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n leftPins: z.array(z.string()).optional(),\n rightPins: z.array(z.string()).optional(),\n topPins: z.array(z.string()).optional(),\n bottomPins: z.array(z.string()).optional(),\n pinPitch: distance.optional(),\n innerHoles: z.boolean().optional(),\n})\n\ntype InferredStampboardProps = z.input<typeof stampboardProps>\nexpectTypesMatch<StampboardProps, InferredStampboardProps>(true)\n","import { capacitance, voltage } from \"circuit-json\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPolarPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport const capacitorPinLabels = [\n \"pin1\",\n \"pin2\",\n \"pos\",\n \"neg\",\n \"anode\",\n \"cathode\",\n] as const\nexport type CapacitorPinLabels = (typeof capacitorPinLabels)[number]\n\nexport interface CapacitorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n capacitance: number | string\n maxVoltageRating?: number | string\n schShowRatings?: boolean\n polarized?: boolean\n decouplingFor?: string\n decouplingTo?: string\n bypassFor?: string\n bypassTo?: string\n maxDecouplingTraceLength?: number\n schOrientation?: SchematicOrientation\n connections?: Connections<CapacitorPinLabels>\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n maxVoltageRating: voltage.optional(),\n schShowRatings: z.boolean().optional().default(false),\n polarized: z.boolean().optional().default(false),\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n maxDecouplingTraceLength: z.number().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: createConnectionsProp(capacitorPinLabels).optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface NetProps {\n name: string\n connectsTo?: string | string[]\n}\n\nexport const netProps = z.object({\n name: z.string(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n})\n\ntype InferredNetProps = z.input<typeof netProps>\nexpectTypesMatch<NetProps, InferredNetProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConstrainedLayoutProps {\n name?: string\n pcbOnly?: boolean\n schOnly?: boolean\n}\n\nexport const constrainedLayoutProps = z.object({\n name: z.string().optional(),\n pcbOnly: z.boolean().optional(),\n schOnly: z.boolean().optional(),\n})\n\nexport type InferredConstrainedLayoutProps = z.input<\n typeof constrainedLayoutProps\n>\n\nexpectTypesMatch<InferredConstrainedLayoutProps, ConstrainedLayoutProps>(true)\n","import { z } from \"zod\"\n\nexport type Distance = number | string\n\nexport { distance, length } from \"circuit-json\"\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport type { Distance } from \"lib/common/distance\"\nimport { distance } from \"lib/common/distance\"\nimport { z } from \"zod\"\n\nexport type PcbXDistConstraint = {\n pcb?: true\n xDist: Distance\n\n /**\n * Selector for left component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 leftedge\", \".R1 center\"\n */\n left: string\n\n /**\n * Selector for right component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 leftedge\", \".R1 center\"\n */\n right: string\n\n /**\n * If true, the provided distance is the distance between the closest edges of\n * the left and right components\n */\n edgeToEdge?: true\n\n /**\n * If true, the provided distance is the distance between the centers of the\n * left and right components\n */\n centerToCenter?: true\n}\n\nexport type PcbYDistConstraint = {\n pcb?: true\n yDist: Distance\n\n /**\n * Selector for top component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 topedge\", \".R1 center\"\n */\n top: string\n\n /**\n * Selector for bottom component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 bottomedge\", \".R1 center\"\n */\n bottom: string\n\n edgeToEdge?: true\n centerToCenter?: true\n}\n\nexport type PcbSameYConstraint = {\n pcb?: true\n sameY?: true\n\n /**\n * Selector for components, e.g. [\".U1\", \".R1\"], you can also specify the\n * edge or center of the component e.g. [\".R1 leftedge\", \".U1 center\"]\n */\n for: string[]\n}\n\nexport type PcbSameXConstraint = {\n pcb?: true\n sameX?: true\n /**\n * Selector for components, e.g. [\".U1\", \".R1\"], you can also specify the\n * edge or center of the component e.g. [\".R1 leftedge\", \".U1 center\"]\n */\n for: string[]\n}\n\nexport type ConstraintProps =\n | PcbXDistConstraint\n | PcbYDistConstraint\n | PcbSameYConstraint\n | PcbSameXConstraint\n\n// -----------------------------------------------------------------------------\n// Zod\n// -----------------------------------------------------------------------------\n\nexport const pcbXDistConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n xDist: distance,\n left: z.string(),\n right: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n})\nexpectTypesMatch<PcbXDistConstraint, z.input<typeof pcbXDistConstraintProps>>(\n true,\n)\n\nexport const pcbYDistConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n yDist: distance,\n top: z.string(),\n bottom: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n})\nexpectTypesMatch<PcbYDistConstraint, z.input<typeof pcbYDistConstraintProps>>(\n true,\n)\n\nexport const pcbSameYConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n sameY: z.literal(true).optional(),\n for: z.array(z.string()),\n})\nexpectTypesMatch<PcbSameYConstraint, z.input<typeof pcbSameYConstraintProps>>(\n true,\n)\n\nexport const pcbSameXConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n sameX: z.literal(true).optional(),\n for: z.array(z.string()),\n})\nexpectTypesMatch<PcbSameXConstraint, z.input<typeof pcbSameXConstraintProps>>(\n true,\n)\n\nexport const constraintProps = z.union([\n pcbXDistConstraintProps,\n pcbYDistConstraintProps,\n pcbSameYConstraintProps,\n pcbSameXConstraintProps,\n])\n\nexpectTypesMatch<ConstraintProps, z.input<typeof constraintProps>>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { point, type Point } from \"lib/common/point\"\nimport { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"rect\"\n width: Distance\n height: Distance\n}\n\nexport const rectCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n })\nexpectTypesMatch<RectCutoutProps, z.input<typeof rectCutoutProps>>(true)\n\nexport interface CircleCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"circle\"\n radius: Distance\n}\n\nexport const circleCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"circle\"),\n radius: distance,\n })\nexpectTypesMatch<CircleCutoutProps, z.input<typeof circleCutoutProps>>(true)\n\nexport interface PolygonCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"polygon\"\n points: Point[]\n}\n\nexport const polygonCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"polygon\"),\n points: z.array(point),\n })\nexpectTypesMatch<PolygonCutoutProps, z.input<typeof polygonCutoutProps>>(true)\n\nexport type CutoutProps =\n | RectCutoutProps\n | CircleCutoutProps\n | PolygonCutoutProps\n\nexport const cutoutProps = z.discriminatedUnion(\"shape\", [\n rectCutoutProps,\n circleCutoutProps,\n polygonCutoutProps,\n])\n\nexport type CutoutPropsInput = z.input<typeof cutoutProps>\n","import {\n pcbLayoutProps,\n type CommonLayoutProps,\n type PcbLayoutProps,\n} from \"lib/common/layout\"\nimport { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { portHints, type PortHints } from \"lib/common/portHints\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"rect\"\n width: Distance\n height: Distance\n portHints?: PortHints\n}\n\nexport interface RotatedRectSmtPadProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"rotated_rect\"\n width: Distance\n height: Distance\n ccwRotation: number\n portHints?: PortHints\n}\n\nexport interface CircleSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"circle\"\n radius: Distance\n portHints?: PortHints\n}\n\nexport interface PillSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"pill\"\n width: Distance\n height: Distance\n radius: Distance\n portHints?: PortHints\n}\n\nexport interface PolygonSmtPadProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"polygon\"\n points: Point[]\n portHints?: PortHints\n}\n\nexport type SmtPadProps =\n | RectSmtPadProps\n | CircleSmtPadProps\n | RotatedRectSmtPadProps\n | PillSmtPadProps\n | PolygonSmtPadProps\n\n// ----------------------------------------------------------------------------\n// Zod\n// ----------------------------------------------------------------------------\n\nexport const rectSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n portHints: portHints.optional(),\n })\ntype InferredRectSmtPadProps = z.input<typeof rectSmtPadProps>\nexpectTypesMatch<InferredRectSmtPadProps, RectSmtPadProps>(true)\n\nexport const rotatedRectSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rotated_rect\"),\n width: distance,\n height: distance,\n ccwRotation: z.number(),\n portHints: portHints.optional(),\n })\ntype InferredRotatedRectSmtPadProps = z.input<typeof rotatedRectSmtPadProps>\nexpectTypesMatch<InferredRotatedRectSmtPadProps, RotatedRectSmtPadProps>(true)\n\nexport const circleSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"circle\"),\n radius: distance,\n portHints: portHints.optional(),\n })\ntype InferredCircleSmtPadProps = z.input<typeof circleSmtPadProps>\nexpectTypesMatch<InferredCircleSmtPadProps, CircleSmtPadProps>(true)\n\nexport const pillSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"pill\"),\n width: distance,\n height: distance,\n radius: distance,\n portHints: portHints.optional(),\n })\ntype InferredPillSmtPadProps = z.input<typeof pillSmtPadProps>\nexpectTypesMatch<InferredPillSmtPadProps, PillSmtPadProps>(true)\n\nexport const polygonSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"polygon\"),\n points: z.array(point),\n portHints: portHints.optional(),\n })\ntype InferredPolygonSmtPadProps = z.input<typeof polygonSmtPadProps>\nexpectTypesMatch<InferredPolygonSmtPadProps, PolygonSmtPadProps>(true)\n\nexport const smtPadProps = z.discriminatedUnion(\"shape\", [\n circleSmtPadProps,\n rectSmtPadProps,\n rotatedRectSmtPadProps,\n pillSmtPadProps,\n polygonSmtPadProps,\n])\n\nexport type InferredSmtPadProps = z.input<typeof smtPadProps>\nexpectTypesMatch<InferredSmtPadProps, SmtPadProps>(true)\n","import { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { boolean, string, z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectSolderPasteProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"rect\"\n width: Distance\n height: Distance\n}\n\nexport interface CircleSolderPasteProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"circle\"\n radius: Distance\n}\n\nexport type SolderPasteProps = RectSolderPasteProps | CircleSolderPasteProps\n\n// zod\n\nexport const rectSolderPasteProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n })\ntype InferredRectSolderPasteProps = z.input<typeof rectSolderPasteProps>\nexpectTypesMatch<InferredRectSolderPasteProps, RectSolderPasteProps>(true)\n\nexport const circleSolderPasteProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n })\ntype InferredCircleSolderPasteProps = z.input<typeof circleSolderPasteProps>\nexpectTypesMatch<InferredCircleSolderPasteProps, CircleSolderPasteProps>(true)\n\nexport const solderPasteProps = z.union([\n circleSolderPasteProps,\n rectSolderPasteProps,\n])\n\nexport type InferredSolderPasteProps = z.input<typeof solderPasteProps>\nexpectTypesMatch<InferredSolderPasteProps, SolderPasteProps>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface HoleProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n diameter?: Distance\n radius?: Distance\n}\n\nexport const holeProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n diameter: distance.optional(),\n radius: distance.optional(),\n })\n .transform((d) => ({\n ...d,\n diameter: d.diameter ?? 2 * d.radius!,\n radius: d.radius ?? d.diameter! / 2,\n }))\n\nexport type InferredHoleProps = z.input<typeof holeProps>\n\nexpectTypesMatch<HoleProps, InferredHoleProps>(true)\n","import { distance, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nconst baseTraceProps = z.object({\n key: z.string().optional(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n schDisplayLabel: z.string().optional(),\n maxLength: distance.optional(),\n})\n\nexport const traceProps = z.union([\n baseTraceProps.extend({\n path: z.array(portRef),\n }),\n baseTraceProps.extend({\n from: portRef,\n to: portRef,\n }),\n])\n\nexport type TraceProps = z.input<typeof traceProps>\n","import { type LayerRef, layer_ref } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface FootprintProps {\n /**\n * The layer that the footprint is designed for. If you set this to \"top\"\n * then it means the children were intended to represent the top layer. If\n * the <chip /> with this footprint is moved to the bottom layer, then the\n * components will be mirrored.\n *\n * Generally, you shouldn't set this except where it can help prevent\n * confusion because you have a complex multi-layer footprint. Default is\n * \"top\" and this is most intuitive.\n */\n originalLayer?: LayerRef\n}\n\nexport const footprintProps = z.object({\n originalLayer: layer_ref.default(\"top\").optional(),\n})\n\nexport type FootprintPropsInput = z.input<typeof footprintProps>\ntype InferredFootprintProps = z.infer<typeof footprintProps>\nexpectTypesMatch<InferredFootprintProps, FootprintProps>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\n/** @deprecated use battery_capacity from circuit-json when circuit-json is updated */\nconst capacity = z\n .number()\n .or(z.string().endsWith(\"mAh\"))\n .transform((v) => {\n if (typeof v === \"string\") {\n const valString = v.replace(\"mAh\", \"\")\n const num = Number.parseFloat(valString)\n if (Number.isNaN(num)) {\n throw new Error(\"Invalid capacity\")\n }\n return num\n }\n return v\n })\n .describe(\"Battery capacity in mAh\")\n\nexport interface BatteryProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n capacity?: number | string\n schOrientation?: SchematicOrientation\n}\n\nexport const batteryProps = commonComponentProps.extend({\n capacity: capacity.optional(),\n schOrientation: schematicOrientation.optional(),\n})\nexport const batteryPins = lrPolarPins\nexport type BatteryPinLabels = (typeof batteryPins)[number]\n\nexpectTypesMatch<BatteryProps, z.input<typeof batteryProps>>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinArrangement,\n type SchematicPinArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { connectionTarget } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface PinHeaderProps extends CommonComponentProps {\n /**\n * Number of pins in the header\n */\n pinCount: number\n\n /**\n * Distance between pins\n */\n pitch?: number | string\n\n /**\n * Schematic facing direction\n */\n schFacingDirection?: \"up\" | \"down\" | \"left\" | \"right\"\n\n /**\n * Whether the header is male or female\n */\n gender?: \"male\" | \"female\"\n\n /**\n * Whether to show pin labels in silkscreen\n */\n showSilkscreenPinLabels?: boolean\n\n /**\n * Whether the header has two rows of pins\n */\n doubleRow?: boolean\n\n /**\n * Diameter of the through-hole for each pin\n */\n holeDiameter?: number | string\n\n /**\n * Diameter of the plated area around each hole\n */\n platedDiameter?: number | string\n\n /**\n * Labels for each pin\n */\n pinLabels?: string[]\n\n /**\n * Connections to other components\n */\n connections?: Connections<string>\n\n /**\n * Direction the header is facing\n */\n facingDirection?: \"left\" | \"right\"\n\n /**\n * Pin arrangement in schematic view\n */\n schPinArrangement?: SchematicPinArrangement\n\n /**\n * Schematic pin style (margins, etc)\n */\n schPinStyle?: SchematicPinStyle\n\n /**\n * Schematic pin spacing\n */\n schPinSpacing?: number | string\n\n /**\n * Schematic width\n */\n schWidth?: number | string\n\n /**\n * Schematic height\n */\n schHeight?: number | string\n}\n\nexport const pinHeaderProps = commonComponentProps.extend({\n pinCount: z.number(),\n pitch: distance.optional(),\n schFacingDirection: z.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n gender: z.enum([\"male\", \"female\"]).optional().default(\"male\"),\n showSilkscreenPinLabels: z.boolean().optional(),\n doubleRow: z.boolean().optional(),\n holeDiameter: distance.optional(),\n platedDiameter: distance.optional(),\n pinLabels: z.array(z.string()).optional(),\n connections: z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n .optional(),\n facingDirection: z.enum([\"left\", \"right\"]).optional(),\n schPinArrangement: schematicPinArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\ntype InferredPinHeaderProps = z.input<typeof pinHeaderProps>\nexpectTypesMatch<PinHeaderProps, InferredPinHeaderProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { distance } from \"lib/common/distance\"\nimport { rotation } from \"circuit-json\"\n\n/**\n * @deprecated Use NetLabelProps instead.\n */\nexport interface NetAliasProps {\n net?: string\n connection?: string\n schX?: number | string\n schY?: number | string\n schRotation?: number | string\n anchorSide?: \"left\" | \"top\" | \"right\" | \"bottom\"\n}\n\n/** @deprecated Use netLabelProps instead. */\nexport const netAliasProps = z.object({\n net: z.string().optional(),\n connection: z.string().optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n anchorSide: z.enum([\"left\", \"top\", \"right\", \"bottom\"]).optional(),\n})\n\ntype InferredNetAliasProps = z.input<typeof netAliasProps>\nexpectTypesMatch<NetAliasProps, InferredNetAliasProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { distance } from \"lib/common/distance\"\nimport { rotation } from \"circuit-json\"\n\nexport interface NetLabelProps {\n net?: string\n connection?: string\n connectsTo?: string | string[]\n schX?: number | string\n schY?: number | string\n schRotation?: number | string\n anchorSide?: \"left\" | \"top\" | \"right\" | \"bottom\"\n}\n\nexport const netLabelProps = z.object({\n net: z.string().optional(),\n connection: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n anchorSide: z.enum([\"left\", \"top\", \"right\", \"bottom\"]).optional(),\n})\n\ntype InferredNetLabelProps = z.input<typeof netLabelProps>\nexpectTypesMatch<NetLabelProps, InferredNetLabelProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { chipProps, type ChipProps, type PinLabelsProp } from \"./chip\"\n\nexport type PushButtonProps<T extends PinLabelsProp | string = string> =\n ChipProps<T>\n\nexport const pushButtonProps = chipProps.extend({})\n\nexpectTypesMatch<PushButtonProps, z.input<typeof pushButtonProps>>(true)\n","import type { SubcircuitGroupProps } from \"./group\"\nimport { subcircuitGroupProps } from \"./group\"\nimport type { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SubcircuitProps = SubcircuitGroupProps\n\nexport const subcircuitProps = subcircuitGroupProps\n\ntype InferredSubcircuitProps = z.input<typeof subcircuitProps>\nexpectTypesMatch<SubcircuitProps, InferredSubcircuitProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface TransistorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n type: \"npn\" | \"pnp\" | \"bjt\" | \"jfet\" | \"mosfet\" | \"igbt\"\n}\n\nexport const transistorProps = commonComponentProps.extend({\n type: z.enum([\"npn\", \"pnp\", \"bjt\", \"jfet\", \"mosfet\", \"igbt\"]),\n})\n\nexport const transistorPins = [\n \"pin1\",\n \"emitter\",\n \"pin2\",\n \"collector\",\n \"pin3\",\n \"base\",\n] as const\nexport type TransistorPinLabels = (typeof transistorPins)[number]\n\ntype InferredTransistorProps = z.input<typeof transistorProps>\nexpectTypesMatch<TransistorProps, InferredTransistorProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"../common/layout\"\nimport { expectTypesMatch } from \"../typecheck\"\nimport { z } from \"zod\"\n\nexport interface MosfetProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n channelType: \"n\" | \"p\"\n mosfetMode: \"enhancement\" | \"depletion\"\n}\n\nexport const mosfetProps = commonComponentProps.extend({\n channelType: z.enum([\"n\", \"p\"]),\n mosfetMode: z.enum([\"enhancement\", \"depletion\"]),\n})\n\nexport const mosfetPins = [\n \"pin1\",\n \"drain\",\n \"pin2\",\n \"source\",\n \"pin3\",\n \"gate\",\n] as const\nexport type MosfetPinLabels = (typeof mosfetPins)[number]\n\ntype InferredMosfetProps = z.input<typeof mosfetProps>\nexpectTypesMatch<MosfetProps, InferredMosfetProps>(true)\n","import { inductance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface InductorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n inductance: number | string\n maxCurrentRating?: number | string\n schOrientation?: SchematicOrientation\n}\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n maxCurrentRating: z.union([z.string(), z.number()]).optional(),\n schOrientation: schematicOrientation.optional(),\n})\n\nexport const inductorPins = lrPins\nexport type InductorPinLabels = (typeof inductorPins)[number]\n\ntype InferredInductorProps = z.input<typeof inductorProps>\n\nexpectTypesMatch<InductorProps, InferredInductorProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n lrPolarPins,\n} from \"lib/common/layout\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\n\nconst diodeConnectionKeys = z.enum([\n \"anode\",\n \"cathode\",\n \"pin1\",\n \"pin2\",\n \"pos\",\n \"neg\",\n])\n\nconst connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nconst connectionsProp = z.record(diodeConnectionKeys, connectionTarget)\n\nconst diodeVariant = z.enum([\"standard\", \"schottky\", \"zener\", \"photo\", \"tvs\"])\n\nexport const diodeProps = commonComponentProps\n .extend({\n connections: connectionsProp.optional(),\n variant: diodeVariant.optional().default(\"standard\"),\n standard: z.boolean().optional(),\n schottky: z.boolean().optional(),\n zener: z.boolean().optional(),\n photo: z.boolean().optional(),\n tvs: z.boolean().optional(),\n schOrientation: schematicOrientation.optional(),\n })\n .superRefine((data, ctx) => {\n // Check if multiple boolean flags are set directly\n const enabledFlags = [\n data.standard,\n data.schottky,\n data.zener,\n data.photo,\n data.tvs,\n ].filter(Boolean).length\n\n if (enabledFlags > 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Exactly one diode variant must be enabled\",\n path: [],\n })\n return z.INVALID\n }\n })\n .transform((data) => {\n // Set all variant flags to false initially\n const result = {\n ...data,\n standard: false,\n schottky: false,\n zener: false,\n photo: false,\n tvs: false,\n }\n\n if (data.standard) result.standard = true\n else if (data.schottky) result.schottky = true\n else if (data.zener) result.zener = true\n else if (data.photo) result.photo = true\n else if (data.tvs) result.tvs = true\n else {\n switch (data.variant) {\n case \"standard\":\n result.standard = true\n break\n case \"schottky\":\n result.schottky = true\n break\n case \"zener\":\n result.zener = true\n break\n case \"photo\":\n result.photo = true\n break\n case \"tvs\":\n result.tvs = true\n break\n default:\n result.standard = true\n }\n }\n\n return result\n })\n\nexport const diodePins = lrPolarPins\nexport type DiodePinLabels = (typeof diodePins)[number]\n\nexport interface DiodeProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n connections?: {\n anode?: string | string[] | readonly string[]\n cathode?: string | string[] | readonly string[]\n pin1?: string | string[] | readonly string[]\n pin2?: string | string[] | readonly string[]\n pos?: string | string[] | readonly string[]\n neg?: string | string[] | readonly string[]\n }\n variant?: \"standard\" | \"schottky\" | \"zener\" | \"photo\" | \"tvs\"\n standard?: boolean\n schottky?: boolean\n zener?: boolean\n photo?: boolean\n tvs?: boolean\n schOrientation?: SchematicOrientation\n}\n\nexport type InferredDiodeProps = z.input<typeof diodeProps>\nexpectTypesMatch<InferredDiodeProps, DiodeProps>(true)\n","import { commonComponentProps, lrPolarPins } from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { z } from \"zod\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\n\nexport type LedPinLabels = (typeof lrPolarPins)[number]\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n wavelength: z.string().optional(),\n schDisplayValue: z.string().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: createConnectionsProp(lrPolarPins).optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nimport { z } from \"zod\"\n\nexport interface SwitchProps extends CommonComponentProps {\n type?: \"spst\" | \"spdt\" | \"dpst\" | \"dpdt\"\n isNormallyClosed?: boolean\n spdt?: boolean\n spst?: boolean\n dpst?: boolean\n dpdt?: boolean\n}\n\nexport const switchProps = commonComponentProps\n .extend({\n type: z.enum([\"spst\", \"spdt\", \"dpst\", \"dpdt\"]).optional(),\n isNormallyClosed: z.boolean().optional().default(false),\n spst: z.boolean().optional(),\n spdt: z.boolean().optional(),\n dpst: z.boolean().optional(),\n dpdt: z.boolean().optional(),\n })\n .transform((props) => {\n const updatedProps: SwitchProps = { ...props }\n\n if (updatedProps.dpdt) {\n updatedProps.type = \"dpdt\"\n } else if (updatedProps.spst) {\n updatedProps.type = \"spst\"\n } else if (updatedProps.spdt) {\n updatedProps.type = \"spdt\"\n } else if (updatedProps.dpst) {\n updatedProps.type = \"dpst\"\n }\n\n switch (updatedProps.type) {\n case \"spdt\":\n updatedProps.spdt = true\n break\n case \"spst\":\n updatedProps.spst = true\n break\n case \"dpst\":\n updatedProps.dpst = true\n break\n case \"dpdt\":\n updatedProps.dpdt = true\n break\n }\n\n return updatedProps\n })\n\nexport type InferredSwitchProps = z.infer<typeof switchProps>\nexpectTypesMatch<SwitchProps, InferredSwitchProps>(true)\n","import { length } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n color: z.string().optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n","import { length, route_hint_point } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n color: z.string().optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import { distance, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n","import { distance, layer_ref, type LayerRefInput } from \"circuit-json\"\nimport { commonLayoutProps, type CommonLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ViaProps extends CommonLayoutProps {\n name?: string\n fromLayer: LayerRefInput\n toLayer: LayerRefInput\n holeDiameter: number | string\n outerDiameter: number | string\n connectsTo?: string | string[]\n}\n\nexport const viaProps = commonLayoutProps.extend({\n name: z.string().optional(),\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n connectsTo: z.string().or(z.array(z.string())).optional(),\n})\nexport type InferredViaProps = z.input<typeof viaProps>\nexpectTypesMatch<ViaProps, InferredViaProps>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface TestpointProps extends CommonComponentProps {\n /**\n * The footprint variant of the testpoint either a surface pad or through-hole\n */\n footprintVariant?: \"pad\" | \"through_hole\"\n /**\n * The shape of the pad if using a pad variant\n */\n padShape?: \"rect\" | \"circle\"\n /**\n * Diameter of the copper pad (applies to both SMD pads and plated holes)\n */\n padDiameter?: number | string\n /**\n * Diameter of the hole if using a through-hole testpoint\n */\n holeDiameter?: number | string\n /**\n * Width of the pad when padShape is rect\n */\n width?: number | string\n /**\n * Height of the pad when padShape is rect\n */\n height?: number | string\n}\n\nexport const testpointProps = commonComponentProps\n .extend({\n footprintVariant: z.enum([\"pad\", \"through_hole\"]).optional(),\n padShape: z.enum([\"rect\", \"circle\"]).optional().default(\"circle\"),\n padDiameter: distance.optional(),\n holeDiameter: distance.optional(),\n width: distance.optional(),\n height: distance.optional(),\n })\n .refine(\n (props) =>\n props.footprintVariant !== \"through_hole\" ||\n props.holeDiameter !== undefined,\n { message: \"holeDiameter is required for through_hole testpoints\" },\n )\n\nexport type InferredTestpointProps = z.input<typeof testpointProps>\nexpectTypesMatch<TestpointProps, InferredTestpointProps>(true)\n","import { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface BreakoutPointProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n connection: string\n}\n\nexport const breakoutPointProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n connection: z.string(),\n })\n\ntype InferredBreakoutPointProps = z.input<typeof breakoutPointProps>\nexpectTypesMatch<BreakoutPointProps, InferredBreakoutPointProps>(true)\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const pcbKeepoutProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n }),\n pcbLayoutProps.extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n }),\n])\nexport type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>\n","import { voltage } from \"circuit-json\"\nimport { commonComponentProps } from \"lib/common/layout\"\nimport type { z } from \"zod\"\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\n\nexport const schematicBoxProps = z\n .object({\n schX: distance.optional(),\n schY: distance.optional(),\n width: distance.optional(),\n height: distance.optional(),\n overlay: z.array(z.string()).optional(),\n\n padding: distance.optional(),\n paddingLeft: distance.optional(),\n paddingRight: distance.optional(),\n paddingTop: distance.optional(),\n paddingBottom: distance.optional(),\n\n title: z.string().optional(),\n titleAlignment: ninePointAnchor.default(\"top_left\"),\n titleColor: z.string().optional(),\n titleFontSize: distance.optional(),\n titleInside: z.boolean().default(false),\n strokeStyle: z.enum([\"solid\", \"dashed\"]).default(\"solid\"),\n })\n .refine(\n (elm) =>\n (elm.width !== undefined && elm.height !== undefined) ||\n (Array.isArray(elm.overlay) && elm.overlay.length > 0),\n {\n message:\n \"Must provide either both `width` and `height`, or a non-empty `overlay` array.\",\n },\n )\n .refine(\n (elm) =>\n !(\n elm.width !== undefined &&\n elm.height !== undefined &&\n Array.isArray(elm.overlay) &&\n elm.overlay.length > 0\n ),\n {\n message:\n \"Cannot provide both `width`/`height` and `overlay` at the same time.\",\n },\n )\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n","import { z } from \"zod\"\n\nexport const ninePointAnchor = z.enum([\n \"top_left\",\n \"top_center\",\n \"top_right\",\n \"center_left\",\n \"center\",\n \"center_right\",\n \"bottom_left\",\n \"bottom_center\",\n \"bottom_right\",\n])\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n","import { distance, rotation } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { fivePointAnchor } from \"lib/common/fivePointAnchor\"\n\nexport const schematicTextProps = z.object({\n schX: distance.optional(),\n schY: distance.optional(),\n text: z.string(),\n fontSize: z.number().default(1),\n anchor: z\n .union([fivePointAnchor.describe(\"legacy\"), ninePointAnchor])\n .default(\"center\"),\n color: z.string().default(\"#000000\"),\n schRotation: rotation.default(0),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n","import { z } from \"zod\"\n\nexport const fivePointAnchor = z.enum([\n \"center\",\n \"left\",\n \"right\",\n \"top\",\n \"bottom\",\n])\n","import { point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicTableProps = z.object({\n schX: distance.optional(),\n schY: distance.optional(),\n children: z.any().optional(),\n cellPadding: distance.optional(),\n borderWidth: distance.optional(),\n anchor: ninePointAnchor.optional(),\n fontSize: distance.optional(),\n})\n\nexport interface SchematicTableProps {\n schX?: number | string\n schY?: number | string\n children?: any\n cellPadding?: number | string\n borderWidth?: number | string\n anchor?: z.infer<typeof ninePointAnchor>\n fontSize?: number | string\n}\n\nexpectTypesMatch<SchematicTableProps, z.input<typeof schematicTableProps>>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicRowProps = z.object({\n children: z.any().optional(),\n height: distance.optional(),\n})\n\nexport interface SchematicRowProps {\n children?: any\n height?: number | string\n}\n\nexpectTypesMatch<SchematicRowProps, z.input<typeof schematicRowProps>>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicCellProps = z.object({\n children: z.string().optional(),\n horizontalAlign: z.enum([\"left\", \"center\", \"right\"]).optional(),\n verticalAlign: z.enum([\"top\", \"middle\", \"bottom\"]).optional(),\n fontSize: distance.optional(),\n rowSpan: z.number().optional(),\n colSpan: z.number().optional(),\n width: distance.optional(),\n})\n\nexport interface SchematicCellProps {\n children?: string\n horizontalAlign?: \"left\" | \"center\" | \"right\"\n verticalAlign?: \"top\" | \"middle\" | \"bottom\"\n fontSize?: number | string\n rowSpan?: number\n colSpan?: number\n width?: number | string\n}\n\nexpectTypesMatch<SchematicCellProps, z.input<typeof schematicCellProps>>(true)\n","import { length } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { z } from \"zod\"\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: ninePointAnchor.default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n","import { length, route_hint_point } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport type { z } from \"zod\"\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n filled: z.boolean().default(true).optional(),\n stroke: z.enum([\"dashed\", \"solid\", \"none\"]).optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n","import { distance, layer_ref, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n","import { direction } from \"lib/common/direction\"\nimport { commonLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n","import {\n autorouterProp,\n type AutorouterProp,\n type PartsEngine,\n partsEngine,\n} from \"./components/group\"\nimport { expectTypesMatch } from \"./typecheck\"\nimport { z } from \"zod\"\n\nexport interface PlatformConfig {\n partsEngine?: PartsEngine\n\n autorouter?: AutorouterProp\n\n // TODO this follows a subset of the localStorage interface\n localCacheEngine?: any\n\n registryApiUrl?: string\n\n cloudAutorouterUrl?: string\n\n projectName?: string\n version?: string\n url?: string\n printBoardInformationToSilkscreen?: boolean\n\n pcbDisabled?: boolean\n schematicDisabled?: boolean\n partsEngineDisabled?: boolean\n\n footprintLibraryMap?: Record<\n string,\n Record<\n string,\n | any[]\n | ((path: string) => Promise<{\n footprintCircuitJson: any[]\n }>)\n >\n >\n}\n\nconst unvalidatedCircuitJson = z.array(z.any()).describe(\"Circuit JSON\")\nconst pathToCircuitJsonFn = z\n .function()\n .args(z.string())\n .returns(z.promise(z.object({ footprintCircuitJson: z.array(z.any()) })))\n .describe(\"A function that takes a path and returns Circuit JSON\")\n\nexport const platformConfig = z.object({\n partsEngine: partsEngine.optional(),\n autorouter: autorouterProp.optional(),\n registryApiUrl: z.string().optional(),\n cloudAutorouterUrl: z.string().optional(),\n projectName: z.string().optional(),\n version: z.string().optional(),\n url: z.string().optional(),\n printBoardInformationToSilkscreen: z.boolean().optional(),\n localCacheEngine: z.any().optional(),\n pcbDisabled: z.boolean().optional(),\n schematicDisabled: z.boolean().optional(),\n partsEngineDisabled: z.boolean().optional(),\n footprintLibraryMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.union([unvalidatedCircuitJson, pathToCircuitJsonFn]),\n ),\n )\n .optional(),\n}) as z.ZodType<PlatformConfig>\n\nexpectTypesMatch<PlatformConfig, z.infer<typeof platformConfig>>(true)\n"],"mappings":";AAYO,IAAM,mBAAmB,CAO9B,aAOS;AAAC;AAIZ,iBAQE,eAAe;AAEjB,iBAQE,iBAAiB;AAEnB,iBAOE,IAAI;AAEN,iBAOE,iCAAiC;;;ACjEnC,SAAS,SAAS;AACX,IAAM,YAAY,EAAE,KAAK,CAAC,MAAM,QAAQ,QAAQ,OAAO,CAAC;AASxD,IAAM,qBAAqB,EAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,iBAAuD,IAAI;AAC3D,iBAAyE,IAAI;;;ACnB7E,SAAS,KAAAA,UAAS;AAGX,IAAM,YAAYC,GAAE,MAAMA,GAAE,OAAO,EAAE,GAAGA,GAAE,OAAO,CAAC,CAAC;AAG1D,iBAAuD,IAAI;;;ACN3D;AAAA,EAEE,YAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,KAAAC,UAAS;;;ACRlB,SAAS,KAAAC,UAAS;;;ACAlB,SAAS,gBAAgB;AACzB,SAAS,KAAAC,UAAS;AAEX,IAAM,SAASA,GAAE,OAAO;AAAA,EAC7B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,SAAS;AAAA,EACpC,oBAAoBA,IAAE,OAAO,EAAE,SAAS;AAAA,EACxC,aAAaA,IAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAASA,IAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,KAAKA,IAAE,OAAO,EAAE,SAAS;AAAA,EACzB,mCAAmCA,IAAE,QAAQ,EAAE,SAAS;AAAA,EACxD,kBAAkBA,IAAE,IAAI,EAAE,SAAS;AAAA,EACnC,aAAaA,IAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,mBAAmBA,IAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,qBAAqBA,IAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,qBAAqBA,IAClB;AAAA,IACCA,IAAE,OAAO;AAAA,IACTA,IAAE;AAAA,MACAA,IAAE,OAAO;AAAA,MACTA,IAAE,MAAM,CAAC,wBAAwB,mBAAmB,CAAC;AAAA,IACvD;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAED,iBAAiE,IAAI;","names":["z","z","distance","z","z","z","z","z","z","distance","z","z","distance","z","distance","distance","distance","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","point","z","point","z","z","z","point","z","point","z","z","distance","z","distance","distance","distance","supplier_name","z","supplier_name","distance","distance","z","connectionTarget","z","distance","connectionTarget","z","distance","z","distance","z","z","distance","z","distance","z","resistance","z","resistance","z","frequency","capacitance","z","frequency","capacitance","distance","z","z","distance","capacitance","z","capacitance","z","z","z","distance","length","z","distance","z","z","distance","z","z","distance","z","z","distance","z","z","distance","distance","route_hint_point","z","z","distance","route_hint_point","layer_ref","z","layer_ref","z","z","distance","z","distance","connectionTarget","z","rotation","z","distance","z","rotation","z","distance","z","z","z","z","z","connectionTarget","connectionsProp","z","z","z","length","z","length","length","route_hint_point","z","route_hint_point","length","distance","route_hint_point","z","distance","layer_ref","z","layer_ref","distance","distance","z","distance","z","distance","z","distance","voltage","voltage","distance","z","z","z","distance","distance","z","distance","rotation","z","z","z","distance","rotation","point","z","distance","z","z","distance","distance","z","z","distance","distance","z","z","distance","length","z","length","length","route_hint_point","z","route_hint_point","length","distance","distance","distance","z","distance","distance","z","distance","distance","layer_ref","route_hint_point","z","z","z"]}
1
+ {"version":3,"sources":["../lib/typecheck.ts","../lib/common/direction.ts","../lib/common/portHints.ts","../lib/common/layout.ts","../lib/common/cadModel.ts","../lib/common/point3.ts","../lib/common/footprintProp.ts","../lib/common/schematicOrientation.ts","../lib/common/schematicPinDefinitions.ts","../lib/common/schematicPinStyle.ts","../lib/components/board.ts","../lib/common/point.ts","../lib/components/group.ts","../lib/manual-edits/manual-edit-events/base_manual_edit_event.ts","../lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts","../lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts","../lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts","../lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts","../lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts","../lib/manual-edits/manual_edit_event.ts","../lib/manual-edits/manual_edits_file.ts","../lib/manual-edits/manual_pcb_placement.ts","../lib/manual-edits/manual_trace_hint.ts","../lib/manual-edits/manual_schematic_placement.ts","../lib/components/breakout.ts","../lib/components/chip.ts","../lib/components/jumper.ts","../lib/common/connectionsProp.ts","../lib/components/solderjumper.ts","../lib/components/connector.ts","../lib/components/fuse.ts","../lib/components/platedhole.ts","../lib/components/resistor.ts","../lib/components/potentiometer.ts","../lib/components/crystal.ts","../lib/components/resonator.ts","../lib/components/stampboard.ts","../lib/components/capacitor.ts","../lib/components/net.ts","../lib/components/constrainedlayout.ts","../lib/common/distance.ts","../lib/components/constraint.ts","../lib/components/cutout.ts","../lib/components/smtpad.ts","../lib/components/solderpaste.ts","../lib/components/hole.ts","../lib/components/trace.ts","../lib/components/footprint.ts","../lib/components/battery.ts","../lib/components/pin-header.ts","../lib/components/netalias.ts","../lib/components/netlabel.ts","../lib/components/push-button.ts","../lib/components/subcircuit.ts","../lib/components/transistor.ts","../lib/components/mosfet.ts","../lib/components/inductor.ts","../lib/components/diode.ts","../lib/components/led.ts","../lib/components/switch.ts","../lib/components/fabrication-note-text.ts","../lib/components/fabrication-note-path.ts","../lib/components/pcb-trace.ts","../lib/components/via.ts","../lib/components/testpoint.ts","../lib/components/breakoutpoint.ts","../lib/components/pcb-keepout.ts","../lib/components/power-source.ts","../lib/components/schematic-box.ts","../lib/common/ninePointAnchor.ts","../lib/components/schematic-line.ts","../lib/components/schematic-text.ts","../lib/common/fivePointAnchor.ts","../lib/components/schematic-path.ts","../lib/components/schematic-table.ts","../lib/components/schematic-row.ts","../lib/components/schematic-cell.ts","../lib/components/silkscreen-text.ts","../lib/components/silkscreen-path.ts","../lib/components/silkscreen-line.ts","../lib/components/silkscreen-rect.ts","../lib/components/silkscreen-circle.ts","../lib/components/trace-hint.ts","../lib/components/port.ts","../lib/platformConfig.ts"],"sourcesContent":["import type { TypeEqual } from \"ts-expect\"\n\ntype IsNever<T> = [T] extends [never] ? true : false\n\ntype GetMismatchedProps<T1, T2> = {\n [K in keyof T1 & keyof T2]: T1[K] extends T2[K]\n ? T2[K] extends T1[K]\n ? never\n : K\n : K\n}[keyof T1 & keyof T2]\n\nexport const expectTypesMatch = <\n const T1,\n const T2,\n T3 = Exclude<keyof T1, keyof T2>,\n T4 = Exclude<keyof T2, keyof T1>,\n T5 = GetMismatchedProps<T1, T2>,\n>(\n shouldBe: IsNever<T3> extends true\n ? IsNever<T4> extends true\n ? IsNever<T5> extends true\n ? TypeEqual<T1, T2>\n : `property ${T5 extends string ? T5 : \"\"} has mismatched types`\n : `extra props ${T4 extends string ? T4 : \"\"}`\n : `missing props ${T3 extends string ? T3 : \"\"}`,\n): void => {}\n\n// ------ TESTS -------\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: number\n b: number\n }\n>(\"extra props b\")\n\nexpectTypesMatch<\n {\n a: number\n b: number\n },\n {\n a: number\n }\n>(\"missing props b\")\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: number\n }\n>(true)\n\nexpectTypesMatch<\n {\n a: number\n },\n {\n a: string\n }\n>(\"property a has mismatched types\")\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nexport const direction = z.enum([\"up\", \"down\", \"left\", \"right\"])\nexport type Direction = \"up\" | \"down\" | \"left\" | \"right\"\n\nexport type DirectionAlongEdge =\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n\nexport const directionAlongEdge = z.enum([\n \"top-to-bottom\",\n \"left-to-right\",\n \"bottom-to-top\",\n \"right-to-left\",\n])\n\nexpectTypesMatch<Direction, z.infer<typeof direction>>(true)\nexpectTypesMatch<DirectionAlongEdge, z.infer<typeof directionAlongEdge>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const portHints = z.array(z.string().or(z.number()))\nexport type PortHints = (string | number)[]\n\nexpectTypesMatch<PortHints, z.infer<typeof portHints>>(true)\n","import {\n type LayerRefInput,\n distance,\n layer_ref,\n rotation,\n supplier_name,\n} from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { type CadModelProp, cadModelProp } from \"./cadModel\"\nimport { type FootprintProp, footprintProp } from \"./footprintProp\"\n\nexport interface PcbLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n layer?: LayerRefInput\n}\n\nexport interface CommonLayoutProps {\n pcbX?: string | number\n pcbY?: string | number\n pcbRotation?: string | number\n\n schX?: string | number\n schY?: string | number\n schRotation?: string | number\n\n layer?: LayerRefInput\n footprint?: FootprintProp\n}\n\nexport const pcbLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n layer: layer_ref.optional(),\n})\ntype InferredPcbLayoutProps = z.input<typeof pcbLayoutProps>\nexpectTypesMatch<PcbLayoutProps, InferredPcbLayoutProps>(true)\n\nexport const commonLayoutProps = z.object({\n pcbX: distance.optional(),\n pcbY: distance.optional(),\n pcbRotation: rotation.optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n layer: layer_ref.optional(),\n footprint: footprintProp.optional(),\n})\n\ntype InferredCommonLayoutProps = z.input<typeof commonLayoutProps>\nexpectTypesMatch<CommonLayoutProps, InferredCommonLayoutProps>(true)\n\nexport type SupplierName =\n | \"jlcpcb\"\n | \"macrofab\"\n | \"pcbway\"\n | \"digikey\"\n | \"mouser\"\n | \"lcsc\"\nexport type SupplierPartNumbers = { [k in SupplierName]?: string[] }\nexport interface SupplierProps {\n supplierPartNumbers?: SupplierPartNumbers\n}\nexport const supplierProps = z.object({\n supplierPartNumbers: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexpectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)\n\nexport interface CommonComponentProps<PinLabel extends string = string>\n extends CommonLayoutProps {\n key?: any\n name: string\n pinAttributes?: Record<PinLabel, Record<string, any>>\n supplierPartNumbers?: SupplierPartNumbers\n cadModel?: CadModelProp\n children?: any\n symbolName?: string\n doNotPlace?: boolean\n}\n\nexport const commonComponentProps = commonLayoutProps\n .merge(supplierProps)\n .extend({\n key: z.any().optional(),\n name: z.string(),\n cadModel: cadModelProp.optional(),\n children: z.any().optional(),\n symbolName: z.string().optional(),\n doNotPlace: z.boolean().optional(),\n pinAttributes: z\n .record(z.string(), z.record(z.string(), z.any()))\n .optional(),\n })\n\ntype InferredCommonComponentProps = z.input<typeof commonComponentProps>\nexpectTypesMatch<CommonComponentProps, InferredCommonComponentProps>(true)\n\nexport const componentProps = commonComponentProps\nexport type ComponentProps = z.input<typeof componentProps>\n\nexport const lrPins = [\"pin1\", \"left\", \"pin2\", \"right\"] as const\nexport const lrPolarPins = [\n \"pin1\",\n \"left\",\n \"anode\",\n \"pos\",\n \"pin2\",\n \"right\",\n \"cathode\",\n \"neg\",\n] as const\n\nexport const distanceOrMultiplier = distance.or(z.enum([\"2x\", \"3x\", \"4x\"]))\n","import { z } from \"zod\"\nimport { point3 } from \"./point3\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const rotationPoint3 = z.object({\n x: z.union([z.number(), z.string()]),\n y: z.union([z.number(), z.string()]),\n z: z.union([z.number(), z.string()]),\n})\n\nexport interface CadModelBase {\n rotationOffset?:\n | number\n | { x: number | string; y: number | string; z: number | string }\n positionOffset?: {\n x: number | string\n y: number | string\n z: number | string\n }\n size?: { x: number | string; y: number | string; z: number | string }\n}\n\nexport const cadModelBase = z.object({\n rotationOffset: z.number().or(rotationPoint3).optional(),\n positionOffset: point3.optional(),\n size: point3.optional(),\n})\n\nexpectTypesMatch<CadModelBase, z.input<typeof cadModelBase>>(true)\n\nexport interface CadModelStl extends CadModelBase {\n stlUrl: string\n}\nexport const cadModelStl = cadModelBase.extend({\n stlUrl: z.string(),\n})\n\nexport interface CadModelObj extends CadModelBase {\n objUrl: string\n mtlUrl?: string\n}\nexport const cadModelObj = cadModelBase.extend({\n objUrl: z.string(),\n mtlUrl: z.string().optional(),\n})\n\nexport interface CadModelJscad extends CadModelBase {\n jscad: Record<string, any>\n}\nexport const cadModelJscad = cadModelBase.extend({\n jscad: z.record(z.any()),\n})\n\nexport type CadModelProp =\n | null\n | string\n | CadModelStl\n | CadModelObj\n | CadModelJscad\n\nexport const cadModelProp = z.union([\n z.null(),\n z.string(),\n cadModelStl,\n cadModelObj,\n cadModelJscad,\n])\n\ntype InferredCadModelProp = z.input<typeof cadModelProp>\nexpectTypesMatch<CadModelProp, InferredCadModelProp>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const point3 = z.object({\n x: distance,\n y: distance,\n z: distance,\n})\n","import type { LayerRef } from \"circuit-json\"\nimport type { ReactElement } from \"react\"\nimport { z } from \"zod\"\n\n/**\n * This is an abbreviated definition of the soup elements that you can find here:\n * https://docs.tscircuit.com/api-reference/advanced/soup#pcb-smtpad\n */\nexport type FootprintSoupElements = {\n type: \"pcb_smtpad\" | \"pcb_plated_hole\"\n x: string | number\n y: string | number\n layer?: LayerRef\n holeDiameter?: string | number\n outerDiameter?: string | number\n shape?: \"circle\" | \"rect\"\n width?: string | number\n height?: string | number\n portHints?: string[]\n}\n\nexport type FootprintProp = string | ReactElement | FootprintSoupElements[]\nexport const footprintProp = z.custom<FootprintProp>((v) => true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport const schematicOrientation = z\n .enum([\n \"vertical\",\n \"horizontal\",\n \"pos_top\",\n \"pos_bottom\",\n \"pos_left\",\n \"pos_right\",\n \"neg_top\",\n \"neg_bottom\",\n \"neg_left\",\n \"neg_right\",\n ])\n .describe(\n \"horizontal means pins go 1->2 rightward and vertical means pins go 1->2 downward (generally, positive on top)\",\n )\n\nexport type SchematicOrientation =\n | \"vertical\"\n | \"horizontal\"\n | \"pos_top\"\n | \"pos_bottom\"\n | \"pos_left\"\n | \"pos_right\"\n | \"neg_top\"\n | \"neg_bottom\"\n | \"neg_left\"\n | \"neg_right\"\n\nexpectTypesMatch<SchematicOrientation, z.infer<typeof schematicOrientation>>(\n true,\n)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\n/**\n * @deprecated Use SchematicPortArrangementWithPinCounts instead.\n */\nexport interface SchematicPortArrangementWithSizes {\n leftSize?: number\n topSize?: number\n rightSize?: number\n bottomSize?: number\n}\n\n/**\n * Specifies the number of pins on each side of the schematic box component.\n */\nexport interface SchematicPortArrangementWithPinCounts {\n leftPinCount?: number\n topPinCount?: number\n rightPinCount?: number\n bottomPinCount?: number\n}\n\nexport interface PinSideDefinition {\n pins: Array<number | string>\n direction:\n | \"top-to-bottom\"\n | \"left-to-right\"\n | \"bottom-to-top\"\n | \"right-to-left\"\n}\n\nexport interface SchematicPortArrangementWithSides {\n leftSide?: PinSideDefinition\n topSide?: PinSideDefinition\n rightSide?: PinSideDefinition\n bottomSide?: PinSideDefinition\n}\n\nexport interface SchematicPortArrangement\n extends SchematicPortArrangementWithSizes,\n SchematicPortArrangementWithSides,\n SchematicPortArrangementWithPinCounts {}\n\nexport type SchematicPinArrangement = SchematicPortArrangement\nexport type SchematicPinArrangementWithSizes = SchematicPortArrangementWithSizes\nexport type SchematicPinArrangementWithSides = SchematicPortArrangementWithSides\nexport type SchematicPinArrangementWithPinCounts =\n SchematicPortArrangementWithPinCounts\n\nexport const explicitPinSideDefinition = z.object({\n pins: z.array(z.union([z.number(), z.string()])),\n direction: z.union([\n z.literal(\"top-to-bottom\"),\n z.literal(\"left-to-right\"),\n z.literal(\"bottom-to-top\"),\n z.literal(\"right-to-left\"),\n ]),\n})\n\n/**\n * @deprecated Use schematicPinArrangement instead.\n */\nexport const schematicPortArrangement = z.object({\n leftSize: z.number().optional().describe(\"@deprecated, use leftPinCount\"),\n topSize: z.number().optional().describe(\"@deprecated, use topPinCount\"),\n rightSize: z.number().optional().describe(\"@deprecated, use rightPinCount\"),\n bottomSize: z.number().optional().describe(\"@deprecated, use bottomPinCount\"),\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n leftSide: explicitPinSideDefinition.optional(),\n rightSide: explicitPinSideDefinition.optional(),\n topSide: explicitPinSideDefinition.optional(),\n bottomSide: explicitPinSideDefinition.optional(),\n})\n\nexport const schematicPinArrangement = schematicPortArrangement\n\nexpectTypesMatch<\n SchematicPortArrangement,\n z.input<typeof schematicPortArrangement>\n>(true)\n","import { distance } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type SchematicPinStyle = Record<\n string,\n {\n marginTop?: number | string\n marginRight?: number | string\n marginBottom?: number | string\n marginLeft?: number | string\n\n /** @deprecated use marginLeft */\n leftMargin?: number | string\n /** @deprecated use marginRight */\n rightMargin?: number | string\n /** @deprecated use marginTop */\n topMargin?: number | string\n /** @deprecated use marginBottom */\n bottomMargin?: number | string\n }\n>\n\nexport const schematicPinStyle = z.record(\n z.object({\n marginLeft: distance.optional(),\n marginRight: distance.optional(),\n marginTop: distance.optional(),\n marginBottom: distance.optional(),\n\n leftMargin: distance.optional(),\n rightMargin: distance.optional(),\n topMargin: distance.optional(),\n bottomMargin: distance.optional(),\n }),\n)\n\nexpectTypesMatch<SchematicPinStyle, z.input<typeof schematicPinStyle>>(true)\n","import { distance } from \"circuit-json\"\nimport { type Point, point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { subcircuitGroupProps, type SubcircuitGroupProps } from \"./group\"\n\nexport interface BoardProps extends Omit<SubcircuitGroupProps, \"subcircuit\"> {\n width?: number | string\n height?: number | string\n outline?: Point[]\n outlineOffsetX?: number | string\n outlineOffsetY?: number | string\n material?: \"fr4\" | \"fr1\"\n}\n\nexport const boardProps = subcircuitGroupProps.extend({\n width: distance.optional(),\n height: distance.optional(),\n outline: z.array(point).optional(),\n outlineOffsetX: distance.optional(),\n outlineOffsetY: distance.optional(),\n material: z.enum([\"fr4\", \"fr1\"]).default(\"fr4\"),\n})\n\ntype InferredBoardProps = z.input<typeof boardProps>\nexpectTypesMatch<BoardProps, InferredBoardProps>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const point = z.object({\n x: distance,\n y: distance,\n})\n\nexport type Point = { x: number | string; y: number | string }\n","import { layer_ref, length } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport {\n type CommonLayoutProps,\n commonLayoutProps,\n type SupplierPartNumbers,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport type { AnySourceComponent, PcbTrace } from \"circuit-json\"\nimport {\n manual_edits_file,\n type ManualEditsFile,\n type ManualEditsFileInput,\n} from \"lib/manual-edits\"\n\nexport const layoutConfig = z.object({\n layoutMode: z.enum([\"grid\", \"flex\", \"match-adapt\", \"none\"]).optional(),\n position: z.enum([\"absolute\", \"relative\"]).optional(),\n\n grid: z.boolean().optional(),\n gridCols: z.number().or(z.string()).optional(),\n gridRows: z.number().or(z.string()).optional(),\n gridTemplateRows: z.string().optional(),\n gridTemplateColumns: z.string().optional(),\n gridTemplate: z.string().optional(),\n gridGap: z.number().or(z.string()).optional(),\n\n flex: z.boolean().or(z.string()).optional(),\n flexDirection: z.enum([\"row\", \"column\"]).optional(),\n alignItems: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n justifyContent: z.enum([\"start\", \"center\", \"end\", \"stretch\"]).optional(),\n flexRow: z.boolean().optional(),\n flexColumn: z.boolean().optional(),\n gap: z.number().or(z.string()).optional(),\n\n padding: length.optional(),\n paddingLeft: length.optional(),\n paddingRight: length.optional(),\n paddingTop: length.optional(),\n paddingBottom: length.optional(),\n paddingX: length.optional(),\n paddingY: length.optional(),\n\n width: length.optional(),\n height: length.optional(),\n\n matchAdapt: z.boolean().optional(),\n matchAdaptTemplate: z.any().optional(),\n})\n\nexport interface LayoutConfig {\n layoutMode?: \"grid\" | \"flex\" | \"match-adapt\" | \"none\"\n position?: \"absolute\" | \"relative\"\n\n grid?: boolean\n gridCols?: number | string\n gridRows?: number | string\n gridTemplateRows?: string\n gridTemplateColumns?: string\n gridTemplate?: string\n gridGap?: number | string\n\n flex?: boolean | string\n flexDirection?: \"row\" | \"column\"\n alignItems?: \"start\" | \"center\" | \"end\" | \"stretch\"\n justifyContent?: \"start\" | \"center\" | \"end\" | \"stretch\"\n flexRow?: boolean\n flexColumn?: boolean\n gap?: number | string\n\n padding?: Distance\n paddingLeft?: Distance\n paddingRight?: Distance\n paddingTop?: Distance\n paddingBottom?: Distance\n paddingX?: Distance\n paddingY?: Distance\n\n width?: Distance\n height?: Distance\n\n matchAdapt?: boolean\n matchAdaptTemplate?: any\n}\n\nexpectTypesMatch<LayoutConfig, z.input<typeof layoutConfig>>(true)\n\nexport interface Border {\n strokeWidth?: Distance\n dashed?: boolean\n solid?: boolean\n}\n\nexport const border = z.object({\n strokeWidth: length.optional(),\n dashed: z.boolean().optional(),\n solid: z.boolean().optional(),\n})\n\nexport interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {\n name?: string\n key?: any\n children?: any\n\n /**\n * Title to display above this group in the schematic view\n */\n schTitle?: string\n\n pcbWidth?: Distance\n pcbHeight?: Distance\n schWidth?: Distance\n schHeight?: Distance\n\n pcbLayout?: LayoutConfig\n schLayout?: LayoutConfig\n cellBorder?: Border | null\n border?: Border | null\n schPadding?: Distance\n schPaddingLeft?: Distance\n schPaddingRight?: Distance\n schPaddingTop?: Distance\n schPaddingBottom?: Distance\n}\n\nexport type PartsEngine = {\n findPart: (params: {\n sourceComponent: AnySourceComponent\n footprinterString?: string\n }) => Promise<SupplierPartNumbers> | SupplierPartNumbers\n}\n\nexport interface PcbRouteCache {\n pcbTraces: PcbTrace[]\n cacheKey: string\n}\n\nexport interface AutorouterConfig {\n serverUrl?: string\n inputFormat?: \"simplified\" | \"circuit-json\"\n serverMode?: \"job\" | \"solve-endpoint\"\n serverCacheEnabled?: boolean\n cache?: PcbRouteCache\n traceClearance?: Distance\n groupMode?: \"sequential-trace\" | \"subcircuit\"\n local?: boolean\n algorithmFn?: (simpleRouteJson: any) => Promise<any>\n preset?:\n | \"sequential-trace\"\n | \"subcircuit\"\n | \"auto\"\n | \"auto-local\"\n | \"auto-cloud\"\n}\n\nexport type AutorouterProp =\n | AutorouterConfig\n | \"sequential-trace\"\n | \"subcircuit\"\n | \"auto\"\n | \"auto-local\"\n | \"auto-cloud\"\n\nexport const autorouterConfig = z.object({\n serverUrl: z.string().optional(),\n inputFormat: z.enum([\"simplified\", \"circuit-json\"]).optional(),\n serverMode: z.enum([\"job\", \"solve-endpoint\"]).optional(),\n serverCacheEnabled: z.boolean().optional(),\n cache: z.custom<PcbRouteCache>((v) => true).optional(),\n traceClearance: length.optional(),\n groupMode: z.enum([\"sequential-trace\", \"subcircuit\"]).optional(),\n algorithmFn: z\n .custom<(simpleRouteJson: any) => Promise<any>>(\n (v) => typeof v === \"function\" || v === undefined,\n )\n .optional(),\n preset: z\n .enum([\n \"sequential-trace\",\n \"subcircuit\",\n \"auto\",\n \"auto-local\",\n \"auto-cloud\",\n ])\n .optional(),\n local: z.boolean().optional(),\n})\n\nexport const autorouterProp = z.union([\n autorouterConfig,\n z.literal(\"sequential-trace\"),\n z.literal(\"subcircuit\"),\n z.literal(\"auto\"),\n z.literal(\"auto-local\"),\n z.literal(\"auto-cloud\"),\n])\n\nexport interface SubcircuitGroupProps extends BaseGroupProps {\n manualEdits?: ManualEditsFileInput\n routingDisabled?: boolean\n defaultTraceWidth?: Distance\n minTraceWidth?: Distance\n pcbRouteCache?: PcbRouteCache\n\n autorouter?: AutorouterProp\n\n /**\n * If true, we'll automatically layout the schematic for this group. Must be\n * a subcircuit (currently). This is eventually going to be replaced with more\n * sophisticated layout options/modes and will be enabled by default.\n */\n schAutoLayoutEnabled?: boolean\n\n /**\n * If true, net labels will automatically be created for complex traces\n */\n schTraceAutoLabelEnabled?: boolean\n\n partsEngine?: PartsEngine\n}\n\nexport interface SubcircuitGroupPropsWithBool extends SubcircuitGroupProps {\n subcircuit: true\n}\n\nexport interface NonSubcircuitGroupProps extends BaseGroupProps {\n subcircuit?: false | undefined\n}\n\nexport type GroupProps = SubcircuitGroupPropsWithBool | NonSubcircuitGroupProps\n\nexport const baseGroupProps = commonLayoutProps.extend({\n name: z.string().optional(),\n children: z.any().optional(),\n schTitle: z.string().optional(),\n key: z.any().optional(),\n\n ...layoutConfig.shape,\n pcbWidth: length.optional(),\n pcbHeight: length.optional(),\n schWidth: length.optional(),\n schHeight: length.optional(),\n pcbLayout: layoutConfig.optional(),\n schLayout: layoutConfig.optional(),\n cellBorder: border.nullable().optional(),\n border: border.nullable().optional(),\n schPadding: length.optional(),\n schPaddingLeft: length.optional(),\n schPaddingRight: length.optional(),\n schPaddingTop: length.optional(),\n schPaddingBottom: length.optional(),\n})\n\nexport const partsEngine = z.custom<PartsEngine>((v) => \"findPart\" in v)\n\nexport const subcircuitGroupProps = baseGroupProps.extend({\n manualEdits: manual_edits_file.optional(),\n schAutoLayoutEnabled: z.boolean().optional(),\n schTraceAutoLabelEnabled: z.boolean().optional(),\n routingDisabled: z.boolean().optional(),\n defaultTraceWidth: length.optional(),\n minTraceWidth: length.optional(),\n partsEngine: partsEngine.optional(),\n pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),\n autorouter: autorouterProp.optional(),\n})\n\nexport const subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({\n subcircuit: z.literal(true),\n})\n\nexport const groupProps = z.discriminatedUnion(\"subcircuit\", [\n baseGroupProps.extend({ subcircuit: z.literal(false).optional() }),\n subcircuitGroupPropsWithBool,\n])\n\ntype InferredBaseGroupProps = z.input<typeof baseGroupProps>\ntype InferredSubcircuitGroupPropsWithBool = z.input<\n typeof subcircuitGroupPropsWithBool\n>\n\nexpectTypesMatch<BaseGroupProps, InferredBaseGroupProps>(true)\nexpectTypesMatch<\n SubcircuitGroupPropsWithBool,\n InferredSubcircuitGroupPropsWithBool\n>(true)\n\ntype InferredGroupProps = z.input<typeof groupProps>\nexpectTypesMatch<GroupProps, InferredGroupProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport const base_manual_edit_event = z.object({\n edit_event_id: z.string(),\n in_progress: z.boolean().optional(),\n created_at: z.number(),\n})\n\nexport interface BaseManualEditEvent {\n edit_event_id: string\n in_progress?: boolean\n created_at: number\n}\n\nexport type BaseManualEditEventInput = z.input<typeof base_manual_edit_event>\n\nexpectTypesMatch<BaseManualEditEvent, z.infer<typeof base_manual_edit_event>>(\n true,\n)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_pcb_component_location_event = base_manual_edit_event.extend({\n pcb_edit_event_type: z\n .literal(\"edit_component_location\")\n .describe(\"deprecated\"),\n edit_event_type: z.literal(\"edit_pcb_component_location\"),\n pcb_component_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n})\n\n/** @deprecated use edit_pcb_component_location_event instead */\nexport const edit_component_location_event = edit_pcb_component_location_event\n\nexport interface EditPcbComponentLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_pcb_component_location\"\n /** @deprecated */\n pcb_edit_event_type: \"edit_component_location\"\n pcb_component_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditPcbComponentLocationEventInput = z.input<\n typeof edit_pcb_component_location_event\n>\n\nexpectTypesMatch<\n EditPcbComponentLocationEvent,\n z.infer<typeof edit_pcb_component_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_trace_hint_event = base_manual_edit_event.extend({\n pcb_edit_event_type: z.literal(\"edit_trace_hint\").describe(\"deprecated\"),\n edit_event_type: z.literal(\"edit_pcb_trace_hint\").optional(),\n pcb_port_id: z.string(),\n pcb_trace_hint_id: z.string().optional(),\n route: z.array(\n z.object({ x: z.number(), y: z.number(), via: z.boolean().optional() }),\n ),\n})\n\nexport interface EditTraceHintEvent extends BaseManualEditEvent {\n /** @deprecated */\n pcb_edit_event_type: \"edit_trace_hint\"\n edit_event_type?: \"edit_pcb_trace_hint\"\n pcb_port_id: string\n pcb_trace_hint_id?: string\n route: Array<{ x: number; y: number; via?: boolean }>\n}\n\nexport type EditTraceHintEventInput = z.input<typeof edit_trace_hint_event>\n\nexpectTypesMatch<EditTraceHintEvent, z.infer<typeof edit_trace_hint_event>>(\n true,\n)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_schematic_component_location_event =\n base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_schematic_component_location\"),\n schematic_component_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n })\n\nexport interface EditSchematicComponentLocationEvent\n extends BaseManualEditEvent {\n edit_event_type: \"edit_schematic_component_location\"\n schematic_component_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditSchematicComponentLocationEventInput = z.input<\n typeof edit_schematic_component_location_event\n>\n\nexpectTypesMatch<\n EditSchematicComponentLocationEvent,\n z.infer<typeof edit_schematic_component_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_pcb_group_location_event = base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_pcb_group_location\"),\n pcb_group_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n})\n\nexport interface EditPcbGroupLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_pcb_group_location\"\n pcb_group_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditPcbGroupLocationEventInput = z.input<\n typeof edit_pcb_group_location_event\n>\n\nexpectTypesMatch<\n EditPcbGroupLocationEvent,\n z.infer<typeof edit_pcb_group_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n base_manual_edit_event,\n type BaseManualEditEvent,\n} from \"./base_manual_edit_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const edit_schematic_group_location_event =\n base_manual_edit_event.extend({\n edit_event_type: z.literal(\"edit_schematic_group_location\"),\n schematic_group_id: z.string(),\n original_center: z.object({ x: z.number(), y: z.number() }),\n new_center: z.object({ x: z.number(), y: z.number() }),\n })\n\nexport interface EditSchematicGroupLocationEvent extends BaseManualEditEvent {\n edit_event_type: \"edit_schematic_group_location\"\n schematic_group_id: string\n original_center: { x: number; y: number }\n new_center: { x: number; y: number }\n}\n\nexport type EditSchematicGroupLocationEventInput = z.input<\n typeof edit_schematic_group_location_event\n>\n\nexpectTypesMatch<\n EditSchematicGroupLocationEvent,\n z.infer<typeof edit_schematic_group_location_event>\n>(true)\n","import { z } from \"zod\"\nimport {\n edit_pcb_component_location_event,\n type EditPcbComponentLocationEvent,\n} from \"./manual-edit-events/edit_pcb_component_location_event\"\nimport {\n edit_schematic_component_location_event,\n type EditSchematicComponentLocationEvent,\n} from \"./manual-edit-events/edit_schematic_component_location_event\"\nimport {\n edit_trace_hint_event,\n type EditTraceHintEvent,\n} from \"./manual-edit-events/edit_trace_hint_event\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type ManualEditEvent =\n | EditPcbComponentLocationEvent\n | EditTraceHintEvent\n | EditSchematicComponentLocationEvent\n\nexport const manual_edit_event = z.union([\n edit_pcb_component_location_event,\n edit_trace_hint_event,\n edit_schematic_component_location_event,\n])\n\nexport type ManualEditEventInput = z.input<typeof manual_edit_event>\ntype InferredManualEditEvent = z.infer<typeof manual_edit_event>\n\nexpectTypesMatch<ManualEditEvent, InferredManualEditEvent>(true)\n","import { z } from \"zod\"\nimport {\n manual_pcb_placement,\n type ManualPcbPlacement,\n} from \"./manual_pcb_placement\"\nimport { manual_edit_event } from \"./manual_edit_event\"\nimport { manual_trace_hint, type ManualTraceHint } from \"./manual_trace_hint\"\nimport {\n manual_schematic_placement,\n type ManualSchematicPlacement,\n} from \"./manual_schematic_placement\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_edits_file = z.object({\n pcb_placements: z.array(manual_pcb_placement).optional(),\n manual_trace_hints: z.array(manual_trace_hint).optional(),\n schematic_placements: z.array(manual_schematic_placement).optional(),\n})\n\nexport interface ManualEditsFile {\n pcb_placements?: ManualPcbPlacement[]\n manual_trace_hints?: ManualTraceHint[]\n schematic_placements?: ManualSchematicPlacement[]\n}\n\nexport type ManualEditsFileInput = z.input<typeof manual_edits_file>\n\nexpectTypesMatch<ManualEditsFile, z.infer<typeof manual_edits_file>>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_pcb_placement = z.object({\n selector: z.string(),\n relative_to: z\n .string()\n .optional()\n .default(\"group_center\")\n .describe(\"Can be a selector or 'group_center'\"),\n center: point,\n})\n\nexport interface ManualPcbPlacement {\n selector: string\n relative_to: string\n center: Point\n}\n\nexport type ManualPcbPlacementInput = z.input<typeof manual_pcb_placement>\ntype InferredManualPcbPlacement = z.infer<typeof manual_pcb_placement>\n\nexpectTypesMatch<ManualPcbPlacement, InferredManualPcbPlacement>(true)\n","import { z } from \"zod\"\nimport { layer_ref, route_hint_point, type RouteHintPoint } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_trace_hint = z.object({\n pcb_port_selector: z.string(),\n offsets: z.array(route_hint_point),\n})\n\nexport interface ManualTraceHint {\n pcb_port_selector: string\n offsets: Array<RouteHintPoint>\n}\n\nexport type ManualTraceHintInput = z.input<typeof manual_trace_hint>\n\nexpectTypesMatch<ManualTraceHint, z.infer<typeof manual_trace_hint>>(true)\n","import { z } from \"zod\"\nimport { point, type Point } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const manual_schematic_placement = z.object({\n selector: z.string(),\n relative_to: z\n .string()\n .optional()\n .default(\"group_center\")\n .describe(\"Can be a selector or 'group_center'\"),\n center: point,\n})\n\nexport interface ManualSchematicPlacement {\n selector: string\n relative_to: string\n center: Point\n}\n\nexport type ManualSchematicPlacementInput = z.input<\n typeof manual_schematic_placement\n>\ntype InferredManualSchematicPlacement = z.infer<\n typeof manual_schematic_placement\n>\n\nexpectTypesMatch<ManualSchematicPlacement, InferredManualSchematicPlacement>(\n true,\n)\n","import { distance } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { subcircuitGroupProps, type SubcircuitGroupProps } from \"./group\"\n\nexport interface BreakoutProps\n extends Omit<SubcircuitGroupProps, \"subcircuit\"> {\n padding?: Distance\n paddingLeft?: Distance\n paddingRight?: Distance\n paddingTop?: Distance\n paddingBottom?: Distance\n}\n\nexport const breakoutProps = subcircuitGroupProps.extend({\n padding: distance.optional(),\n paddingLeft: distance.optional(),\n paddingRight: distance.optional(),\n paddingTop: distance.optional(),\n paddingBottom: distance.optional(),\n})\n\ntype InferredBreakoutProps = z.input<typeof breakoutProps>\nexpectTypesMatch<BreakoutProps, InferredBreakoutProps>(true)\n","import { distance, supplier_name } from \"circuit-json\"\nimport type { Distance } from \"lib/common/distance\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n type SupplierPartNumbers,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement as schematicPinArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport type PinLabelsProp<\n PinNumber extends string = string,\n PinLabel extends string = string,\n> = Record<PinNumber, PinLabel | readonly PinLabel[] | PinLabel[]>\n\nexport type PinLabelFromPinLabelMap<PinLabelMap extends PinLabelsProp> =\n PinLabelMap extends PinLabelsProp<infer PinNumber, infer PinLabel>\n ? PinLabel\n : never\n\nexport interface PinCompatibleVariant {\n manufacturerPartNumber?: string\n supplierPartNumber?: SupplierPartNumbers\n}\n\nexport interface ChipPropsSU<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n manufacturerPartNumber?: string\n pinLabels?: PinLabelsProp<string, PinLabel>\n /**\n * Whether to show pin aliases in the schematic\n */\n showPinAliases?: boolean\n /**\n * Labels for PCB pins\n */\n pcbPinLabels?: Record<string, string>\n schPinArrangement?: SchematicPortArrangement\n /** @deprecated Use schPinArrangement instead. */\n schPortArrangement?: SchematicPortArrangement\n pinCompatibleVariants?: PinCompatibleVariant[]\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: Distance\n schWidth?: Distance\n schHeight?: Distance\n noSchematicRepresentation?: boolean\n internallyConnectedPins?: string[][]\n externallyConnectedPins?: string[][]\n connections?: Connections<PinLabel>\n}\n\nexport type ChipProps<PinLabelMap extends PinLabelsProp | string = string> =\n ChipPropsSU<\n PinLabelMap extends PinLabelsProp\n ? PinLabelFromPinLabelMap<PinLabelMap> | keyof PinLabelMap\n : PinLabelMap\n >\n\n/**\n * Get the pin labels for a component\n *\n * const pinLabels = { pin1: \"VCC\", pin2: \"GND\", pin3: \"DATA\" } as const\n * export const MyChip = (props: ChipProps<typeof pinLabels>) => {\n * // ...\n * }\n * type MyChipPinLabels = ChipPinLabels<typeof MyChip>\n * // MyChipPinLabels is \"VCC\" | \"GND\" | \"DATA\"\n *\n */\nexport type ChipPinLabels<T extends (props: ChipProps<any>) => any> =\n T extends (props: infer Props) => any\n ? Props extends ChipProps<infer PinLabelMap>\n ? PinLabelMap extends PinLabelsProp\n ? PinLabelFromPinLabelMap<PinLabelMap>\n : PinLabelMap extends string\n ? PinLabelMap\n : never\n : never\n : never\n\n/**\n * Get the connection prop type for a component\n *\n * const pinLabels = { pin1: \"VCC\", pin2: \"GND\", pin3: \"DATA\" } as const\n * export const MyChip = (props: ChipProps<typeof pinLabels>) => {\n * // ...\n * }\n * const connections: ChipConnections<typeof MyChip> = {\n * VCC: \"...\",\n * GND: \"...\",\n * DATA: \"...\",\n * }\n *\n */\nexport type ChipConnections<T extends (props: ChipProps<any>) => any> = {\n [K in ChipPinLabels<T>]: string\n}\n\nconst connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nconst connectionsProp = z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n\nexport const pinLabelsProp = z.record(\n z.string(),\n z.string().or(z.array(z.string()).readonly()).or(z.array(z.string())),\n)\n\nexpectTypesMatch<PinLabelsProp, z.input<typeof pinLabelsProp>>(true)\n\nexport const pinCompatibleVariant = z.object({\n manufacturerPartNumber: z.string().optional(),\n supplierPartNumber: z.record(supplier_name, z.array(z.string())).optional(),\n})\n\nexport const chipProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: pinLabelsProp.optional(),\n showPinAliases: z.boolean().optional(),\n pcbPinLabels: z.record(z.string(), z.string()).optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n externallyConnectedPins: z.array(z.array(z.string())).optional(),\n schPinArrangement: schematicPinArrangement.optional(),\n schPortArrangement: schematicPinArrangement.optional(),\n pinCompatibleVariants: z.array(pinCompatibleVariant).optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n noSchematicRepresentation: z.boolean().optional(),\n connections: connectionsProp.optional(),\n})\n\n/**\n * @deprecated Use ChipProps instead.\n */\nexport const bugProps = chipProps\nexport type InferredChipProps = z.input<typeof chipProps>\n\n// Chip props are too complex to match up with zod types, we typecheck\n// them separately in the test files\nexpectTypesMatch<InferredChipProps, ChipPropsSU<string>>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { connectionTarget } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface JumperProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string | string[]>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n /**\n * Labels for PCB pins\n */\n pcbPinLabels?: Record<string, string>\n /**\n * Number of pins on the jumper (2 or 3)\n */\n pinCount?: 2 | 3\n /**\n * Groups of pins that are internally connected\n * e.g., [[\"1\",\"2\"], [\"2\",\"3\"]]\n */\n internallyConnectedPins?: string[][]\n /**\n * Connections to other components\n */\n connections?: Connections<string>\n}\n\nexport const jumperProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z\n .record(z.number().or(z.string()), z.string().or(z.array(z.string())))\n .optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n pcbPinLabels: z.record(z.string(), z.string()).optional(),\n pinCount: z.union([z.literal(2), z.literal(3)]).optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n connections: z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n .optional(),\n})\n\ntype InferredJumperProps = z.input<typeof jumperProps>\nexpectTypesMatch<JumperProps, InferredJumperProps>(true)\n","import { z } from \"zod\"\n\nexport const connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nexport const createConnectionsProp = <T extends readonly [string, ...string[]]>(\n labels: T,\n) => {\n return z.record(z.enum(labels), connectionTarget)\n}\n","import { jumperProps, type JumperProps } from \"./jumper\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface SolderJumperProps extends JumperProps {\n /**\n * Pins that are bridged with solder by default\n */\n bridgedPins?: string[][]\n /**\n * If true, all pins are connected with cuttable traces\n */\n bridged?: boolean\n}\n\nexport const solderjumperProps = jumperProps.extend({\n bridgedPins: z.array(z.array(z.string())).optional(),\n bridged: z.boolean().optional(),\n})\n\ntype InferredSolderJumperProps = z.input<typeof solderjumperProps>\nexpectTypesMatch<SolderJumperProps, InferredSolderJumperProps>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n type SchematicPortArrangement,\n schematicPortArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConnectorProps extends CommonComponentProps {\n manufacturerPartNumber?: string\n pinLabels?: Record<number | string, string | string[]>\n schPinStyle?: SchematicPinStyle\n schPinSpacing?: number | string\n schWidth?: number | string\n schHeight?: number | string\n schDirection?: \"left\" | \"right\"\n schPortArrangement?: SchematicPortArrangement\n /**\n * Groups of pins that are internally connected\n * e.g., [[\"1\",\"2\"], [\"2\",\"3\"]]\n */\n internallyConnectedPins?: string[][]\n /**\n * Connector standard, e.g. usb_c, m2\n */\n standard?: \"usb_c\" | \"m2\"\n}\n\nexport const connectorProps = commonComponentProps.extend({\n manufacturerPartNumber: z.string().optional(),\n pinLabels: z\n .record(z.number().or(z.string()), z.string().or(z.array(z.string())))\n .optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n schDirection: z.enum([\"left\", \"right\"]).optional(),\n schPortArrangement: schematicPortArrangement.optional(),\n internallyConnectedPins: z.array(z.array(z.string())).optional(),\n standard: z.enum([\"usb_c\", \"m2\"]).optional(),\n})\n\ntype InferredConnectorProps = z.input<typeof connectorProps>\nexpectTypesMatch<ConnectorProps, InferredConnectorProps>(true)\n","import { z } from \"zod\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\n\n/**\n * Pin labels for fuse component\n */\nexport const fusePinLabels = [\"pin1\", \"pin2\"] as const\n\nexport type FusePinLabels = (typeof fusePinLabels)[number]\n\nexport interface FuseProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n /**\n * Current rating of the fuse in amperes\n */\n currentRating: number | string\n\n /**\n * Voltage rating of the fuse\n */\n voltageRating?: number | string\n\n /**\n * Whether to show ratings on schematic\n */\n schShowRatings?: boolean\n\n schOrientation?: SchematicOrientation\n\n /**\n * Connections to other components\n */\n connections?: Connections<PinLabel>\n}\n\n/**\n * Schema for validating fuse props\n */\nexport const fuseProps = commonComponentProps.extend({\n currentRating: z.union([z.number(), z.string()]),\n voltageRating: z.union([z.number(), z.string()]).optional(),\n schShowRatings: z.boolean().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: z\n .record(\n z.string(),\n z.union([\n z.string(),\n z.array(z.string()).readonly(),\n z.array(z.string()),\n ]),\n )\n .optional(),\n})\n\nexport type InferredFuseProps = z.input<typeof fuseProps>\n","import { distance } from \"circuit-json\"\nimport type { PcbLayoutProps } from \"lib/common/layout\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { type PortHints, portHints } from \"lib/common/portHints\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface CirclePlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"circle\"\n holeDiameter: number | string\n outerDiameter: number | string\n portHints?: PortHints\n}\n\nexport interface OvalPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"oval\"\n outerWidth: number | string\n outerHeight: number | string\n holeWidth: number | string\n holeHeight: number | string\n portHints?: PortHints\n\n /** @deprecated use holeWidth */\n innerWidth?: number | string\n /** @deprecated use holeHeight */\n innerHeight?: number | string\n}\n\nexport interface PillPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"pill\"\n outerWidth: number | string\n outerHeight: number | string\n holeWidth: number | string\n holeHeight: number | string\n\n /** @deprecated use holeWidth */\n innerWidth?: number | string\n /** @deprecated use holeHeight */\n innerHeight?: number | string\n\n portHints?: PortHints\n}\n\nexport interface CircularHoleWithRectPlatedProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"circular_hole_with_rect_pad\"\n holeDiameter: number | string\n rectPadWidth: number | string\n rectPadHeight: number | string\n holeShape?: \"circle\"\n padShape?: \"rect\"\n portHints?: PortHints\n}\n\nexport interface PillWithRectPadPlatedHoleProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n name?: string\n connectsTo?: string | string[]\n shape: \"pill_hole_with_rect_pad\"\n holeShape: \"pill\"\n padShape: \"rect\"\n holeWidth: number | string\n holeHeight: number | string\n rectPadWidth: number | string\n rectPadHeight: number | string\n portHints?: PortHints\n}\n\nexport type PlatedHoleProps =\n | CirclePlatedHoleProps\n | OvalPlatedHoleProps\n | PillPlatedHoleProps\n | CircularHoleWithRectPlatedProps\n | PillWithRectPadPlatedHoleProps\n\nconst distanceHiddenUndefined = z\n .custom<z.input<typeof distance>>()\n .transform((a) => {\n if (a === undefined) return undefined\n return distance.parse(a)\n })\n\nexport const platedHoleProps = z\n .discriminatedUnion(\"shape\", [\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"circle\"),\n holeDiameter: distance,\n outerDiameter: distance,\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"oval\"),\n outerWidth: distance,\n outerHeight: distance,\n holeWidth: distanceHiddenUndefined,\n holeHeight: distanceHiddenUndefined,\n innerWidth: distance.optional().describe(\"DEPRECATED use holeWidth\"),\n innerHeight: distance.optional().describe(\"DEPRECATED use holeHeight\"),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"pill\"),\n outerWidth: distance,\n outerHeight: distance,\n holeWidth: distanceHiddenUndefined,\n holeHeight: distanceHiddenUndefined,\n innerWidth: distance.optional().describe(\"DEPRECATED use holeWidth\"),\n innerHeight: distance.optional().describe(\"DEPRECATED use holeHeight\"),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"circular_hole_with_rect_pad\"),\n holeDiameter: distance,\n rectPadWidth: distance,\n rectPadHeight: distance,\n holeShape: z.literal(\"circle\").optional(),\n padShape: z.literal(\"rect\").optional(),\n portHints: portHints.optional(),\n }),\n pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({\n name: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n shape: z.literal(\"pill_hole_with_rect_pad\"),\n holeShape: z.literal(\"pill\"),\n padShape: z.literal(\"rect\"),\n holeWidth: distance,\n holeHeight: distance,\n rectPadWidth: distance,\n rectPadHeight: distance,\n portHints: portHints.optional(),\n }),\n ])\n .refine((a) => {\n if (\"innerWidth\" in a && a.innerWidth !== undefined) {\n a.holeWidth ??= a.innerWidth\n }\n if (\"innerHeight\" in a && a.innerHeight !== undefined) {\n a.holeHeight ??= a.innerHeight\n }\n return a\n })\n\ntype InferredPlatedHoleProps = z.input<typeof platedHoleProps>\n\nexpectTypesMatch<PlatedHoleProps, InferredPlatedHoleProps>(true)\n","import { resistance } from \"circuit-json\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport const resistorPinLabels = [\"pin1\", \"pin2\", \"pos\", \"neg\"] as const\nexport type ResistorPinLabels = (typeof resistorPinLabels)[number]\n\nexport interface ResistorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n resistance: number | string\n pullupFor?: string\n pullupTo?: string\n pulldownFor?: string\n pulldownTo?: string\n schOrientation?: SchematicOrientation\n connections?: Connections<ResistorPinLabels>\n}\n\nexport const resistorProps = commonComponentProps.extend({\n resistance,\n\n pullupFor: z.string().optional(),\n pullupTo: z.string().optional(),\n\n pulldownFor: z.string().optional(),\n pulldownTo: z.string().optional(),\n\n schOrientation: schematicOrientation.optional(),\n\n connections: createConnectionsProp(resistorPinLabels).optional(),\n})\nexport const resistorPins = lrPins\n\ntype InferredResistorProps = z.input<typeof resistorProps>\nexpectTypesMatch<ResistorProps, InferredResistorProps>(true)\n","import { resistance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type PotentiometerPinVariant = \"two_pin\" | \"three_pin\"\n\nexport interface PotentiometerProps extends CommonComponentProps {\n maxResistance: number | string\n pinVariant?: PotentiometerPinVariant\n}\n\nexport const potentiometerProps = commonComponentProps.extend({\n maxResistance: resistance,\n pinVariant: z.enum([\"two_pin\", \"three_pin\"]).optional(),\n})\n\ntype InferredPotentiometerProps = z.input<typeof potentiometerProps>\nexpectTypesMatch<PotentiometerProps, InferredPotentiometerProps>(true)\n","import { frequency, capacitance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type PinVariant = \"two_pin\" | \"four_pin\"\n\nexport interface CrystalProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n frequency: number | string\n loadCapacitance: number | string\n pinVariant?: PinVariant\n schOrientation?: SchematicOrientation\n}\n\nexport const crystalProps = commonComponentProps.extend({\n frequency: frequency,\n loadCapacitance: capacitance,\n pinVariant: z.enum([\"two_pin\", \"four_pin\"]).optional(),\n schOrientation: schematicOrientation.optional(),\n})\nexport const crystalPins = lrPins\nexport type CrystalPinLabels = (typeof crystalPins)[number]\n\ntype InferredCrystalProps = z.input<typeof crystalProps>\nexpectTypesMatch<CrystalProps, InferredCrystalProps>(true)\n","import { frequency, capacitance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport type ResonatorPinVariant = \"no_ground\" | \"ground_pin\" | \"two_ground_pins\"\n\nexport interface ResonatorProps extends CommonComponentProps {\n frequency: number | string\n loadCapacitance: number | string\n pinVariant?: ResonatorPinVariant\n}\n\nexport const resonatorProps = commonComponentProps.extend({\n frequency: frequency,\n loadCapacitance: capacitance,\n pinVariant: z.enum([\"no_ground\", \"ground_pin\", \"two_ground_pins\"]).optional(),\n})\n\ntype InferredResonatorProps = z.input<typeof resonatorProps>\nexpectTypesMatch<ResonatorProps, InferredResonatorProps>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { boardProps, type BoardProps } from \"lib/components/board\"\n\nexport interface StampboardProps extends BoardProps {\n leftPinCount?: number\n rightPinCount?: number\n topPinCount?: number\n bottomPinCount?: number\n leftPins?: string[]\n rightPins?: string[]\n topPins?: string[]\n bottomPins?: string[]\n pinPitch?: number | string\n innerHoles?: boolean\n}\n\nexport const stampboardProps = boardProps.extend({\n leftPinCount: z.number().optional(),\n rightPinCount: z.number().optional(),\n topPinCount: z.number().optional(),\n bottomPinCount: z.number().optional(),\n leftPins: z.array(z.string()).optional(),\n rightPins: z.array(z.string()).optional(),\n topPins: z.array(z.string()).optional(),\n bottomPins: z.array(z.string()).optional(),\n pinPitch: distance.optional(),\n innerHoles: z.boolean().optional(),\n})\n\ntype InferredStampboardProps = z.input<typeof stampboardProps>\nexpectTypesMatch<StampboardProps, InferredStampboardProps>(true)\n","import { capacitance, voltage } from \"circuit-json\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPolarPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { z } from \"zod\"\n\nexport const capacitorPinLabels = [\n \"pin1\",\n \"pin2\",\n \"pos\",\n \"neg\",\n \"anode\",\n \"cathode\",\n] as const\nexport type CapacitorPinLabels = (typeof capacitorPinLabels)[number]\n\nexport interface CapacitorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n capacitance: number | string\n maxVoltageRating?: number | string\n schShowRatings?: boolean\n polarized?: boolean\n decouplingFor?: string\n decouplingTo?: string\n bypassFor?: string\n bypassTo?: string\n maxDecouplingTraceLength?: number\n schOrientation?: SchematicOrientation\n connections?: Connections<CapacitorPinLabels>\n}\n\nexport const capacitorProps = commonComponentProps.extend({\n capacitance,\n maxVoltageRating: voltage.optional(),\n schShowRatings: z.boolean().optional().default(false),\n polarized: z.boolean().optional().default(false),\n decouplingFor: z.string().optional(),\n decouplingTo: z.string().optional(),\n bypassFor: z.string().optional(),\n bypassTo: z.string().optional(),\n maxDecouplingTraceLength: z.number().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: createConnectionsProp(capacitorPinLabels).optional(),\n})\nexport const capacitorPins = lrPolarPins\n\nexpectTypesMatch<CapacitorProps, z.input<typeof capacitorProps>>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface NetProps {\n name: string\n connectsTo?: string | string[]\n}\n\nexport const netProps = z.object({\n name: z.string(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n})\n\ntype InferredNetProps = z.input<typeof netProps>\nexpectTypesMatch<NetProps, InferredNetProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ConstrainedLayoutProps {\n name?: string\n pcbOnly?: boolean\n schOnly?: boolean\n}\n\nexport const constrainedLayoutProps = z.object({\n name: z.string().optional(),\n pcbOnly: z.boolean().optional(),\n schOnly: z.boolean().optional(),\n})\n\nexport type InferredConstrainedLayoutProps = z.input<\n typeof constrainedLayoutProps\n>\n\nexpectTypesMatch<InferredConstrainedLayoutProps, ConstrainedLayoutProps>(true)\n","import { z } from \"zod\"\n\nexport type Distance = number | string\n\nexport { distance, length } from \"circuit-json\"\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport type { Distance } from \"lib/common/distance\"\nimport { distance } from \"lib/common/distance\"\nimport { z } from \"zod\"\n\nexport type PcbXDistConstraint = {\n pcb?: true\n xDist: Distance\n\n /**\n * Selector for left component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 leftedge\", \".R1 center\"\n */\n left: string\n\n /**\n * Selector for right component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 leftedge\", \".R1 center\"\n */\n right: string\n\n /**\n * If true, the provided distance is the distance between the closest edges of\n * the left and right components\n */\n edgeToEdge?: true\n\n /**\n * If true, the provided distance is the distance between the centers of the\n * left and right components\n */\n centerToCenter?: true\n}\n\nexport type PcbYDistConstraint = {\n pcb?: true\n yDist: Distance\n\n /**\n * Selector for top component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 topedge\", \".R1 center\"\n */\n top: string\n\n /**\n * Selector for bottom component, e.g. \".U1\" or \".R1\", you can also specify the\n * edge or center of the component e.g. \".R1 bottomedge\", \".R1 center\"\n */\n bottom: string\n\n edgeToEdge?: true\n centerToCenter?: true\n}\n\nexport type PcbSameYConstraint = {\n pcb?: true\n sameY?: true\n\n /**\n * Selector for components, e.g. [\".U1\", \".R1\"], you can also specify the\n * edge or center of the component e.g. [\".R1 leftedge\", \".U1 center\"]\n */\n for: string[]\n}\n\nexport type PcbSameXConstraint = {\n pcb?: true\n sameX?: true\n /**\n * Selector for components, e.g. [\".U1\", \".R1\"], you can also specify the\n * edge or center of the component e.g. [\".R1 leftedge\", \".U1 center\"]\n */\n for: string[]\n}\n\nexport type ConstraintProps =\n | PcbXDistConstraint\n | PcbYDistConstraint\n | PcbSameYConstraint\n | PcbSameXConstraint\n\n// -----------------------------------------------------------------------------\n// Zod\n// -----------------------------------------------------------------------------\n\nexport const pcbXDistConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n xDist: distance,\n left: z.string(),\n right: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n})\nexpectTypesMatch<PcbXDistConstraint, z.input<typeof pcbXDistConstraintProps>>(\n true,\n)\n\nexport const pcbYDistConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n yDist: distance,\n top: z.string(),\n bottom: z.string(),\n\n edgeToEdge: z.literal(true).optional(),\n centerToCenter: z.literal(true).optional(),\n})\nexpectTypesMatch<PcbYDistConstraint, z.input<typeof pcbYDistConstraintProps>>(\n true,\n)\n\nexport const pcbSameYConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n sameY: z.literal(true).optional(),\n for: z.array(z.string()),\n})\nexpectTypesMatch<PcbSameYConstraint, z.input<typeof pcbSameYConstraintProps>>(\n true,\n)\n\nexport const pcbSameXConstraintProps = z.object({\n pcb: z.literal(true).optional(),\n sameX: z.literal(true).optional(),\n for: z.array(z.string()),\n})\nexpectTypesMatch<PcbSameXConstraint, z.input<typeof pcbSameXConstraintProps>>(\n true,\n)\n\nexport const constraintProps = z.union([\n pcbXDistConstraintProps,\n pcbYDistConstraintProps,\n pcbSameYConstraintProps,\n pcbSameXConstraintProps,\n])\n\nexpectTypesMatch<ConstraintProps, z.input<typeof constraintProps>>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { point, type Point } from \"lib/common/point\"\nimport { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"rect\"\n width: Distance\n height: Distance\n}\n\nexport const rectCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n })\nexpectTypesMatch<RectCutoutProps, z.input<typeof rectCutoutProps>>(true)\n\nexport interface CircleCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"circle\"\n radius: Distance\n}\n\nexport const circleCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"circle\"),\n radius: distance,\n })\nexpectTypesMatch<CircleCutoutProps, z.input<typeof circleCutoutProps>>(true)\n\nexport interface PolygonCutoutProps\n extends Omit<PcbLayoutProps, \"layer\" | \"pcbRotation\"> {\n name?: string\n shape: \"polygon\"\n points: Point[]\n}\n\nexport const polygonCutoutProps = pcbLayoutProps\n .omit({\n layer: true,\n pcbRotation: true,\n })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"polygon\"),\n points: z.array(point),\n })\nexpectTypesMatch<PolygonCutoutProps, z.input<typeof polygonCutoutProps>>(true)\n\nexport type CutoutProps =\n | RectCutoutProps\n | CircleCutoutProps\n | PolygonCutoutProps\n\nexport const cutoutProps = z.discriminatedUnion(\"shape\", [\n rectCutoutProps,\n circleCutoutProps,\n polygonCutoutProps,\n])\n\nexport type CutoutPropsInput = z.input<typeof cutoutProps>\n","import {\n pcbLayoutProps,\n type CommonLayoutProps,\n type PcbLayoutProps,\n} from \"lib/common/layout\"\nimport { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { portHints, type PortHints } from \"lib/common/portHints\"\nimport { point, type Point } from \"lib/common/point\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"rect\"\n width: Distance\n height: Distance\n portHints?: PortHints\n}\n\nexport interface RotatedRectSmtPadProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"rotated_rect\"\n width: Distance\n height: Distance\n ccwRotation: number\n portHints?: PortHints\n}\n\nexport interface CircleSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"circle\"\n radius: Distance\n portHints?: PortHints\n}\n\nexport interface PillSmtPadProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"pill\"\n width: Distance\n height: Distance\n radius: Distance\n portHints?: PortHints\n}\n\nexport interface PolygonSmtPadProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n shape: \"polygon\"\n points: Point[]\n portHints?: PortHints\n}\n\nexport type SmtPadProps =\n | RectSmtPadProps\n | CircleSmtPadProps\n | RotatedRectSmtPadProps\n | PillSmtPadProps\n | PolygonSmtPadProps\n\n// ----------------------------------------------------------------------------\n// Zod\n// ----------------------------------------------------------------------------\n\nexport const rectSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n portHints: portHints.optional(),\n })\ntype InferredRectSmtPadProps = z.input<typeof rectSmtPadProps>\nexpectTypesMatch<InferredRectSmtPadProps, RectSmtPadProps>(true)\n\nexport const rotatedRectSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"rotated_rect\"),\n width: distance,\n height: distance,\n ccwRotation: z.number(),\n portHints: portHints.optional(),\n })\ntype InferredRotatedRectSmtPadProps = z.input<typeof rotatedRectSmtPadProps>\nexpectTypesMatch<InferredRotatedRectSmtPadProps, RotatedRectSmtPadProps>(true)\n\nexport const circleSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"circle\"),\n radius: distance,\n portHints: portHints.optional(),\n })\ntype InferredCircleSmtPadProps = z.input<typeof circleSmtPadProps>\nexpectTypesMatch<InferredCircleSmtPadProps, CircleSmtPadProps>(true)\n\nexport const pillSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"pill\"),\n width: distance,\n height: distance,\n radius: distance,\n portHints: portHints.optional(),\n })\ntype InferredPillSmtPadProps = z.input<typeof pillSmtPadProps>\nexpectTypesMatch<InferredPillSmtPadProps, PillSmtPadProps>(true)\n\nexport const polygonSmtPadProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n shape: z.literal(\"polygon\"),\n points: z.array(point),\n portHints: portHints.optional(),\n })\ntype InferredPolygonSmtPadProps = z.input<typeof polygonSmtPadProps>\nexpectTypesMatch<InferredPolygonSmtPadProps, PolygonSmtPadProps>(true)\n\nexport const smtPadProps = z.discriminatedUnion(\"shape\", [\n circleSmtPadProps,\n rectSmtPadProps,\n rotatedRectSmtPadProps,\n pillSmtPadProps,\n polygonSmtPadProps,\n])\n\nexport type InferredSmtPadProps = z.input<typeof smtPadProps>\nexpectTypesMatch<InferredSmtPadProps, SmtPadProps>(true)\n","import { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { boolean, string, z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface RectSolderPasteProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"rect\"\n width: Distance\n height: Distance\n}\n\nexport interface CircleSolderPasteProps\n extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n shape: \"circle\"\n radius: Distance\n}\n\nexport type SolderPasteProps = RectSolderPasteProps | CircleSolderPasteProps\n\n// zod\n\nexport const rectSolderPasteProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n })\ntype InferredRectSolderPasteProps = z.input<typeof rectSolderPasteProps>\nexpectTypesMatch<InferredRectSolderPasteProps, RectSolderPasteProps>(true)\n\nexport const circleSolderPasteProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n })\ntype InferredCircleSolderPasteProps = z.input<typeof circleSolderPasteProps>\nexpectTypesMatch<InferredCircleSolderPasteProps, CircleSolderPasteProps>(true)\n\nexport const solderPasteProps = z.union([\n circleSolderPasteProps,\n rectSolderPasteProps,\n])\n\nexport type InferredSolderPasteProps = z.input<typeof solderPasteProps>\nexpectTypesMatch<InferredSolderPasteProps, SolderPasteProps>(true)\n","import { z } from \"zod\"\nimport { distance, type Distance } from \"lib/common/distance\"\nimport { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport interface HoleProps extends Omit<PcbLayoutProps, \"pcbRotation\"> {\n name?: string\n diameter?: Distance\n radius?: Distance\n}\n\nexport const holeProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n name: z.string().optional(),\n diameter: distance.optional(),\n radius: distance.optional(),\n })\n .transform((d) => ({\n ...d,\n diameter: d.diameter ?? 2 * d.radius!,\n radius: d.radius ?? d.diameter! / 2,\n }))\n\nexport type InferredHoleProps = z.input<typeof holeProps>\n\nexpectTypesMatch<HoleProps, InferredHoleProps>(true)\n","import { distance, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { point } from \"../common/point\"\n\nexport const portRef = z.union([\n z.string(),\n z.custom<{ getPortSelector: () => string }>((v) =>\n Boolean(v.getPortSelector),\n ),\n])\n\nconst baseTraceProps = z.object({\n key: z.string().optional(),\n thickness: distance.optional(),\n schematicRouteHints: z.array(point).optional(),\n pcbRouteHints: z.array(route_hint_point).optional(),\n schDisplayLabel: z.string().optional(),\n maxLength: distance.optional(),\n})\n\nexport const traceProps = z.union([\n baseTraceProps.extend({\n path: z.array(portRef),\n }),\n baseTraceProps.extend({\n from: portRef,\n to: portRef,\n }),\n])\n\nexport type TraceProps = z.input<typeof traceProps>\n","import { type LayerRef, layer_ref } from \"circuit-json\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface FootprintProps {\n /**\n * The layer that the footprint is designed for. If you set this to \"top\"\n * then it means the children were intended to represent the top layer. If\n * the <chip /> with this footprint is moved to the bottom layer, then the\n * components will be mirrored.\n *\n * Generally, you shouldn't set this except where it can help prevent\n * confusion because you have a complex multi-layer footprint. Default is\n * \"top\" and this is most intuitive.\n */\n originalLayer?: LayerRef\n}\n\nexport const footprintProps = z.object({\n originalLayer: layer_ref.default(\"top\").optional(),\n})\n\nexport type FootprintPropsInput = z.input<typeof footprintProps>\ntype InferredFootprintProps = z.infer<typeof footprintProps>\nexpectTypesMatch<InferredFootprintProps, FootprintProps>(true)\n","import { z } from \"zod\"\nimport {\n commonComponentProps,\n lrPins,\n lrPolarPins,\n type CommonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\n/** @deprecated use battery_capacity from circuit-json when circuit-json is updated */\nconst capacity = z\n .number()\n .or(z.string().endsWith(\"mAh\"))\n .transform((v) => {\n if (typeof v === \"string\") {\n const valString = v.replace(\"mAh\", \"\")\n const num = Number.parseFloat(valString)\n if (Number.isNaN(num)) {\n throw new Error(\"Invalid capacity\")\n }\n return num\n }\n return v\n })\n .describe(\"Battery capacity in mAh\")\n\nexport interface BatteryProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n capacity?: number | string\n schOrientation?: SchematicOrientation\n}\n\nexport const batteryProps = commonComponentProps.extend({\n capacity: capacity.optional(),\n schOrientation: schematicOrientation.optional(),\n})\nexport const batteryPins = lrPolarPins\nexport type BatteryPinLabels = (typeof batteryPins)[number]\n\nexpectTypesMatch<BatteryProps, z.input<typeof batteryProps>>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport {\n schematicPinArrangement,\n type SchematicPinArrangement,\n} from \"lib/common/schematicPinDefinitions\"\nimport {\n type SchematicPinStyle,\n schematicPinStyle,\n} from \"lib/common/schematicPinStyle\"\nimport { connectionTarget } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface PinHeaderProps extends CommonComponentProps {\n /**\n * Number of pins in the header\n */\n pinCount: number\n\n /**\n * Distance between pins\n */\n pitch?: number | string\n\n /**\n * Schematic facing direction\n */\n schFacingDirection?: \"up\" | \"down\" | \"left\" | \"right\"\n\n /**\n * Whether the header is male or female\n */\n gender?: \"male\" | \"female\"\n\n /**\n * Whether to show pin labels in silkscreen\n */\n showSilkscreenPinLabels?: boolean\n\n /**\n * Labels for PCB pins\n */\n pcbPinLabels?: Record<string, string>\n\n /**\n * Whether the header has two rows of pins\n */\n doubleRow?: boolean\n\n /**\n * Diameter of the through-hole for each pin\n */\n holeDiameter?: number | string\n\n /**\n * Diameter of the plated area around each hole\n */\n platedDiameter?: number | string\n\n /**\n * Labels for each pin\n */\n pinLabels?: string[]\n\n /**\n * Connections to other components\n */\n connections?: Connections<string>\n\n /**\n * Direction the header is facing\n */\n facingDirection?: \"left\" | \"right\"\n\n /**\n * Pin arrangement in schematic view\n */\n schPinArrangement?: SchematicPinArrangement\n\n /**\n * Schematic pin style (margins, etc)\n */\n schPinStyle?: SchematicPinStyle\n\n /**\n * Schematic pin spacing\n */\n schPinSpacing?: number | string\n\n /**\n * Schematic width\n */\n schWidth?: number | string\n\n /**\n * Schematic height\n */\n schHeight?: number | string\n}\n\nexport const pinHeaderProps = commonComponentProps.extend({\n pinCount: z.number(),\n pitch: distance.optional(),\n schFacingDirection: z.enum([\"up\", \"down\", \"left\", \"right\"]).optional(),\n gender: z.enum([\"male\", \"female\"]).optional().default(\"male\"),\n showSilkscreenPinLabels: z.boolean().optional(),\n pcbPinLabels: z.record(z.string(), z.string()).optional(),\n doubleRow: z.boolean().optional(),\n holeDiameter: distance.optional(),\n platedDiameter: distance.optional(),\n pinLabels: z.array(z.string()).optional(),\n connections: z\n .custom<Connections>()\n .pipe(z.record(z.string(), connectionTarget))\n .optional(),\n facingDirection: z.enum([\"left\", \"right\"]).optional(),\n schPinArrangement: schematicPinArrangement.optional(),\n schPinStyle: schematicPinStyle.optional(),\n schPinSpacing: distance.optional(),\n schWidth: distance.optional(),\n schHeight: distance.optional(),\n})\n\ntype InferredPinHeaderProps = z.input<typeof pinHeaderProps>\nexpectTypesMatch<PinHeaderProps, InferredPinHeaderProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { distance } from \"lib/common/distance\"\nimport { rotation } from \"circuit-json\"\n\n/**\n * @deprecated Use NetLabelProps instead.\n */\nexport interface NetAliasProps {\n net?: string\n connection?: string\n schX?: number | string\n schY?: number | string\n schRotation?: number | string\n anchorSide?: \"left\" | \"top\" | \"right\" | \"bottom\"\n}\n\n/** @deprecated Use netLabelProps instead. */\nexport const netAliasProps = z.object({\n net: z.string().optional(),\n connection: z.string().optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n anchorSide: z.enum([\"left\", \"top\", \"right\", \"bottom\"]).optional(),\n})\n\ntype InferredNetAliasProps = z.input<typeof netAliasProps>\nexpectTypesMatch<NetAliasProps, InferredNetAliasProps>(true)\n","import { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { distance } from \"lib/common/distance\"\nimport { rotation } from \"circuit-json\"\n\nexport interface NetLabelProps {\n net?: string\n connection?: string\n connectsTo?: string | string[]\n schX?: number | string\n schY?: number | string\n schRotation?: number | string\n anchorSide?: \"left\" | \"top\" | \"right\" | \"bottom\"\n}\n\nexport const netLabelProps = z.object({\n net: z.string().optional(),\n connection: z.string().optional(),\n connectsTo: z.string().or(z.array(z.string())).optional(),\n schX: distance.optional(),\n schY: distance.optional(),\n schRotation: rotation.optional(),\n anchorSide: z.enum([\"left\", \"top\", \"right\", \"bottom\"]).optional(),\n})\n\ntype InferredNetLabelProps = z.input<typeof netLabelProps>\nexpectTypesMatch<NetLabelProps, InferredNetLabelProps>(true)\n","import { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\nimport { chipProps, type ChipProps, type PinLabelsProp } from \"./chip\"\n\nexport type PushButtonProps<T extends PinLabelsProp | string = string> =\n ChipProps<T>\n\nexport const pushButtonProps = chipProps.extend({})\n\nexpectTypesMatch<PushButtonProps, z.input<typeof pushButtonProps>>(true)\n","import type { SubcircuitGroupProps } from \"./group\"\nimport { subcircuitGroupProps } from \"./group\"\nimport type { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport type SubcircuitProps = SubcircuitGroupProps\n\nexport const subcircuitProps = subcircuitGroupProps\n\ntype InferredSubcircuitProps = z.input<typeof subcircuitProps>\nexpectTypesMatch<SubcircuitProps, InferredSubcircuitProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface TransistorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n type: \"npn\" | \"pnp\" | \"bjt\" | \"jfet\" | \"mosfet\" | \"igbt\"\n}\n\nexport const transistorProps = commonComponentProps.extend({\n type: z.enum([\"npn\", \"pnp\", \"bjt\", \"jfet\", \"mosfet\", \"igbt\"]),\n})\n\nexport const transistorPins = [\n \"pin1\",\n \"emitter\",\n \"pin2\",\n \"collector\",\n \"pin3\",\n \"base\",\n] as const\nexport type TransistorPinLabels = (typeof transistorPins)[number]\n\ntype InferredTransistorProps = z.input<typeof transistorProps>\nexpectTypesMatch<TransistorProps, InferredTransistorProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"../common/layout\"\nimport { expectTypesMatch } from \"../typecheck\"\nimport { z } from \"zod\"\n\nexport interface MosfetProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n channelType: \"n\" | \"p\"\n mosfetMode: \"enhancement\" | \"depletion\"\n}\n\nexport const mosfetProps = commonComponentProps.extend({\n channelType: z.enum([\"n\", \"p\"]),\n mosfetMode: z.enum([\"enhancement\", \"depletion\"]),\n})\n\nexport const mosfetPins = [\n \"pin1\",\n \"drain\",\n \"pin2\",\n \"source\",\n \"pin3\",\n \"gate\",\n] as const\nexport type MosfetPinLabels = (typeof mosfetPins)[number]\n\ntype InferredMosfetProps = z.input<typeof mosfetProps>\nexpectTypesMatch<MosfetProps, InferredMosfetProps>(true)\n","import { inductance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n lrPins,\n} from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface InductorProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n inductance: number | string\n maxCurrentRating?: number | string\n schOrientation?: SchematicOrientation\n}\n\nexport const inductorProps = commonComponentProps.extend({\n inductance,\n maxCurrentRating: z.union([z.string(), z.number()]).optional(),\n schOrientation: schematicOrientation.optional(),\n})\n\nexport const inductorPins = lrPins\nexport type InductorPinLabels = (typeof inductorPins)[number]\n\ntype InferredInductorProps = z.input<typeof inductorProps>\n\nexpectTypesMatch<InductorProps, InferredInductorProps>(true)\n","import {\n type CommonComponentProps,\n commonComponentProps,\n lrPolarPins,\n} from \"lib/common/layout\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\n\nconst diodeConnectionKeys = z.enum([\n \"anode\",\n \"cathode\",\n \"pin1\",\n \"pin2\",\n \"pos\",\n \"neg\",\n])\n\nconst connectionTarget = z\n .string()\n .or(z.array(z.string()).readonly())\n .or(z.array(z.string()))\n\nconst connectionsProp = z.record(diodeConnectionKeys, connectionTarget)\n\nconst diodeVariant = z.enum([\"standard\", \"schottky\", \"zener\", \"photo\", \"tvs\"])\n\nexport const diodeProps = commonComponentProps\n .extend({\n connections: connectionsProp.optional(),\n variant: diodeVariant.optional().default(\"standard\"),\n standard: z.boolean().optional(),\n schottky: z.boolean().optional(),\n zener: z.boolean().optional(),\n photo: z.boolean().optional(),\n tvs: z.boolean().optional(),\n schOrientation: schematicOrientation.optional(),\n })\n .superRefine((data, ctx) => {\n // Check if multiple boolean flags are set directly\n const enabledFlags = [\n data.standard,\n data.schottky,\n data.zener,\n data.photo,\n data.tvs,\n ].filter(Boolean).length\n\n if (enabledFlags > 1) {\n ctx.addIssue({\n code: z.ZodIssueCode.custom,\n message: \"Exactly one diode variant must be enabled\",\n path: [],\n })\n return z.INVALID\n }\n })\n .transform((data) => {\n // Set all variant flags to false initially\n const result = {\n ...data,\n standard: false,\n schottky: false,\n zener: false,\n photo: false,\n tvs: false,\n }\n\n if (data.standard) result.standard = true\n else if (data.schottky) result.schottky = true\n else if (data.zener) result.zener = true\n else if (data.photo) result.photo = true\n else if (data.tvs) result.tvs = true\n else {\n switch (data.variant) {\n case \"standard\":\n result.standard = true\n break\n case \"schottky\":\n result.schottky = true\n break\n case \"zener\":\n result.zener = true\n break\n case \"photo\":\n result.photo = true\n break\n case \"tvs\":\n result.tvs = true\n break\n default:\n result.standard = true\n }\n }\n\n return result\n })\n\nexport const diodePins = lrPolarPins\nexport type DiodePinLabels = (typeof diodePins)[number]\n\nexport interface DiodeProps<PinLabel extends string = string>\n extends CommonComponentProps<PinLabel> {\n connections?: {\n anode?: string | string[] | readonly string[]\n cathode?: string | string[] | readonly string[]\n pin1?: string | string[] | readonly string[]\n pin2?: string | string[] | readonly string[]\n pos?: string | string[] | readonly string[]\n neg?: string | string[] | readonly string[]\n }\n variant?: \"standard\" | \"schottky\" | \"zener\" | \"photo\" | \"tvs\"\n standard?: boolean\n schottky?: boolean\n zener?: boolean\n photo?: boolean\n tvs?: boolean\n schOrientation?: SchematicOrientation\n}\n\nexport type InferredDiodeProps = z.input<typeof diodeProps>\nexpectTypesMatch<InferredDiodeProps, DiodeProps>(true)\n","import { commonComponentProps, lrPolarPins } from \"lib/common/layout\"\nimport {\n schematicOrientation,\n type SchematicOrientation,\n} from \"lib/common/schematicOrientation\"\nimport { z } from \"zod\"\nimport { createConnectionsProp } from \"lib/common/connectionsProp\"\nimport type { Connections } from \"lib/utility-types/connections-and-selectors\"\n\nexport type LedPinLabels = (typeof lrPolarPins)[number]\n\nexport const ledProps = commonComponentProps.extend({\n color: z.string().optional(),\n wavelength: z.string().optional(),\n schDisplayValue: z.string().optional(),\n schOrientation: schematicOrientation.optional(),\n connections: createConnectionsProp(lrPolarPins).optional(),\n})\nexport const ledPins = lrPolarPins\nexport type LedProps = z.input<typeof ledProps>\n","import {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nimport { z } from \"zod\"\n\nexport interface SwitchProps extends CommonComponentProps {\n type?: \"spst\" | \"spdt\" | \"dpst\" | \"dpdt\"\n isNormallyClosed?: boolean\n spdt?: boolean\n spst?: boolean\n dpst?: boolean\n dpdt?: boolean\n}\n\nexport const switchProps = commonComponentProps\n .extend({\n type: z.enum([\"spst\", \"spdt\", \"dpst\", \"dpdt\"]).optional(),\n isNormallyClosed: z.boolean().optional().default(false),\n spst: z.boolean().optional(),\n spdt: z.boolean().optional(),\n dpst: z.boolean().optional(),\n dpdt: z.boolean().optional(),\n })\n .transform((props) => {\n const updatedProps: SwitchProps = { ...props }\n\n if (updatedProps.dpdt) {\n updatedProps.type = \"dpdt\"\n } else if (updatedProps.spst) {\n updatedProps.type = \"spst\"\n } else if (updatedProps.spdt) {\n updatedProps.type = \"spdt\"\n } else if (updatedProps.dpst) {\n updatedProps.type = \"dpst\"\n }\n\n switch (updatedProps.type) {\n case \"spdt\":\n updatedProps.spdt = true\n break\n case \"spst\":\n updatedProps.spst = true\n break\n case \"dpst\":\n updatedProps.dpst = true\n break\n case \"dpdt\":\n updatedProps.dpdt = true\n break\n }\n\n return updatedProps\n })\n\nexport type InferredSwitchProps = z.infer<typeof switchProps>\nexpectTypesMatch<SwitchProps, InferredSwitchProps>(true)\n","import { length } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const fabricationNoteTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: z\n .enum([\"center\", \"top_left\", \"top_right\", \"bottom_left\", \"bottom_right\"])\n .default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n color: z.string().optional(),\n})\nexport type FabricationNoteTextProps = z.input<typeof fabricationNoteTextProps>\n","import { length, route_hint_point } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const fabricationNotePathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n color: z.string().optional(),\n })\nexport type FabricationNotePathProps = z.input<typeof fabricationNotePathProps>\n","import { distance, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const pcbTraceProps = z.object({\n layer: z.string().optional(),\n thickness: distance.optional(),\n route: z.array(route_hint_point),\n})\nexport type PcbTraceProps = z.input<typeof pcbTraceProps>\n","import { distance, layer_ref, type LayerRefInput } from \"circuit-json\"\nimport { commonLayoutProps, type CommonLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface ViaProps extends CommonLayoutProps {\n name?: string\n fromLayer: LayerRefInput\n toLayer: LayerRefInput\n holeDiameter: number | string\n outerDiameter: number | string\n connectsTo?: string | string[]\n}\n\nexport const viaProps = commonLayoutProps.extend({\n name: z.string().optional(),\n fromLayer: layer_ref,\n toLayer: layer_ref,\n holeDiameter: distance,\n outerDiameter: distance,\n connectsTo: z.string().or(z.array(z.string())).optional(),\n})\nexport type InferredViaProps = z.input<typeof viaProps>\nexpectTypesMatch<ViaProps, InferredViaProps>(true)\n","import { distance } from \"circuit-json\"\nimport {\n type CommonComponentProps,\n commonComponentProps,\n} from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface TestpointProps extends CommonComponentProps {\n /**\n * The footprint variant of the testpoint either a surface pad or through-hole\n */\n footprintVariant?: \"pad\" | \"through_hole\"\n /**\n * The shape of the pad if using a pad variant\n */\n padShape?: \"rect\" | \"circle\"\n /**\n * Diameter of the copper pad (applies to both SMD pads and plated holes)\n */\n padDiameter?: number | string\n /**\n * Diameter of the hole if using a through-hole testpoint\n */\n holeDiameter?: number | string\n /**\n * Width of the pad when padShape is rect\n */\n width?: number | string\n /**\n * Height of the pad when padShape is rect\n */\n height?: number | string\n}\n\nexport const testpointProps = commonComponentProps\n .extend({\n footprintVariant: z.enum([\"pad\", \"through_hole\"]).optional(),\n padShape: z.enum([\"rect\", \"circle\"]).optional().default(\"circle\"),\n padDiameter: distance.optional(),\n holeDiameter: distance.optional(),\n width: distance.optional(),\n height: distance.optional(),\n })\n .refine(\n (props) =>\n props.footprintVariant !== \"through_hole\" ||\n props.holeDiameter !== undefined,\n { message: \"holeDiameter is required for through_hole testpoints\" },\n )\n\nexport type InferredTestpointProps = z.input<typeof testpointProps>\nexpectTypesMatch<TestpointProps, InferredTestpointProps>(true)\n","import { pcbLayoutProps, type PcbLayoutProps } from \"lib/common/layout\"\nimport { expectTypesMatch } from \"lib/typecheck\"\nimport { z } from \"zod\"\n\nexport interface BreakoutPointProps\n extends Omit<PcbLayoutProps, \"pcbRotation\" | \"layer\"> {\n connection: string\n}\n\nexport const breakoutPointProps = pcbLayoutProps\n .omit({ pcbRotation: true, layer: true })\n .extend({\n connection: z.string(),\n })\n\ntype InferredBreakoutPointProps = z.input<typeof breakoutPointProps>\nexpectTypesMatch<BreakoutPointProps, InferredBreakoutPointProps>(true)\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const pcbKeepoutProps = z.union([\n pcbLayoutProps.omit({ pcbRotation: true }).extend({\n shape: z.literal(\"circle\"),\n radius: distance,\n }),\n pcbLayoutProps.extend({\n shape: z.literal(\"rect\"),\n width: distance,\n height: distance,\n }),\n])\nexport type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>\n","import { voltage } from \"circuit-json\"\nimport { commonComponentProps } from \"lib/common/layout\"\nimport type { z } from \"zod\"\n\nexport const powerSourceProps = commonComponentProps.extend({\n voltage,\n})\nexport type PowerSourceProps = z.input<typeof powerSourceProps>\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\n\nexport const schematicBoxProps = z\n .object({\n schX: distance.optional(),\n schY: distance.optional(),\n width: distance.optional(),\n height: distance.optional(),\n overlay: z.array(z.string()).optional(),\n\n padding: distance.optional(),\n paddingLeft: distance.optional(),\n paddingRight: distance.optional(),\n paddingTop: distance.optional(),\n paddingBottom: distance.optional(),\n\n title: z.string().optional(),\n titleAlignment: ninePointAnchor.default(\"top_left\"),\n titleColor: z.string().optional(),\n titleFontSize: distance.optional(),\n titleInside: z.boolean().default(false),\n strokeStyle: z.enum([\"solid\", \"dashed\"]).default(\"solid\"),\n })\n .refine(\n (elm) =>\n (elm.width !== undefined && elm.height !== undefined) ||\n (Array.isArray(elm.overlay) && elm.overlay.length > 0),\n {\n message:\n \"Must provide either both `width` and `height`, or a non-empty `overlay` array.\",\n },\n )\n .refine(\n (elm) =>\n !(\n elm.width !== undefined &&\n elm.height !== undefined &&\n Array.isArray(elm.overlay) &&\n elm.overlay.length > 0\n ),\n {\n message:\n \"Cannot provide both `width`/`height` and `overlay` at the same time.\",\n },\n )\nexport type SchematicBoxProps = z.input<typeof schematicBoxProps>\n","import { z } from \"zod\"\n\nexport const ninePointAnchor = z.enum([\n \"top_left\",\n \"top_center\",\n \"top_right\",\n \"center_left\",\n \"center\",\n \"center_right\",\n \"bottom_left\",\n \"bottom_center\",\n \"bottom_right\",\n])\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const schematicLineProps = z.object({\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n})\nexport type SchematicLineProps = z.input<typeof schematicLineProps>\n","import { distance, rotation } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { fivePointAnchor } from \"lib/common/fivePointAnchor\"\n\nexport const schematicTextProps = z.object({\n schX: distance.optional(),\n schY: distance.optional(),\n text: z.string(),\n fontSize: z.number().default(1),\n anchor: z\n .union([fivePointAnchor.describe(\"legacy\"), ninePointAnchor])\n .default(\"center\"),\n color: z.string().default(\"#000000\"),\n schRotation: rotation.default(0),\n})\nexport type SchematicTextProps = z.input<typeof schematicTextProps>\n","import { z } from \"zod\"\n\nexport const fivePointAnchor = z.enum([\n \"center\",\n \"left\",\n \"right\",\n \"top\",\n \"bottom\",\n])\n","import { point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const schematicPathProps = z.object({\n points: z.array(point),\n isFilled: z.boolean().optional().default(false),\n fillColor: z.enum([\"red\", \"blue\"]).optional(),\n})\nexport type SchematicPathProps = z.input<typeof schematicPathProps>\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicTableProps = z.object({\n schX: distance.optional(),\n schY: distance.optional(),\n children: z.any().optional(),\n cellPadding: distance.optional(),\n borderWidth: distance.optional(),\n anchor: ninePointAnchor.optional(),\n fontSize: distance.optional(),\n})\n\nexport interface SchematicTableProps {\n schX?: number | string\n schY?: number | string\n children?: any\n cellPadding?: number | string\n borderWidth?: number | string\n anchor?: z.infer<typeof ninePointAnchor>\n fontSize?: number | string\n}\n\nexpectTypesMatch<SchematicTableProps, z.input<typeof schematicTableProps>>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicRowProps = z.object({\n children: z.any().optional(),\n height: distance.optional(),\n})\n\nexport interface SchematicRowProps {\n children?: any\n height?: number | string\n}\n\nexpectTypesMatch<SchematicRowProps, z.input<typeof schematicRowProps>>(true)\n","import { distance } from \"circuit-json\"\nimport { z } from \"zod\"\nimport { expectTypesMatch } from \"lib/typecheck\"\n\nexport const schematicCellProps = z.object({\n children: z.string().optional(),\n horizontalAlign: z.enum([\"left\", \"center\", \"right\"]).optional(),\n verticalAlign: z.enum([\"top\", \"middle\", \"bottom\"]).optional(),\n fontSize: distance.optional(),\n rowSpan: z.number().optional(),\n colSpan: z.number().optional(),\n width: distance.optional(),\n text: z.string().optional(),\n})\n\nexport interface SchematicCellProps {\n children?: string\n horizontalAlign?: \"left\" | \"center\" | \"right\"\n verticalAlign?: \"top\" | \"middle\" | \"bottom\"\n fontSize?: number | string\n rowSpan?: number\n colSpan?: number\n width?: number | string\n text?: string\n}\n\nexpectTypesMatch<SchematicCellProps, z.input<typeof schematicCellProps>>(true)\n","import { length } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { ninePointAnchor } from \"lib/common/ninePointAnchor\"\nimport { z } from \"zod\"\n\nexport const silkscreenTextProps = pcbLayoutProps.extend({\n text: z.string(),\n anchorAlignment: ninePointAnchor.default(\"center\"),\n font: z.enum([\"tscircuit2024\"]).optional(),\n fontSize: length.optional(),\n})\nexport type SilkscreenTextProps = z.input<typeof silkscreenTextProps>\n","import { length, route_hint_point } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenPathProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n route: z.array(route_hint_point),\n strokeWidth: length.optional(),\n })\nexport type SilkscreenPathProps = z.input<typeof silkscreenPathProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport type { z } from \"zod\"\n\nexport const silkscreenLineProps = pcbLayoutProps\n .omit({ pcbX: true, pcbY: true, pcbRotation: true })\n .extend({\n strokeWidth: distance,\n x1: distance,\n y1: distance,\n x2: distance,\n y2: distance,\n })\nexport type SilkscreenLineProps = z.input<typeof silkscreenLineProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenRectProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n filled: z.boolean().default(true).optional(),\n stroke: z.enum([\"dashed\", \"solid\", \"none\"]).optional(),\n strokeWidth: distance.optional(),\n width: distance,\n height: distance,\n })\nexport type SilkscreenRectProps = z.input<typeof silkscreenRectProps>\n","import { distance } from \"circuit-json\"\nimport { pcbLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const silkscreenCircleProps = pcbLayoutProps\n .omit({ pcbRotation: true })\n .extend({\n isFilled: z.boolean().optional(),\n isOutline: z.boolean().optional(),\n strokeWidth: distance.optional(),\n radius: distance,\n })\nexport type SilkscreenCircleProps = z.input<typeof silkscreenCircleProps>\n","import { distance, layer_ref, route_hint_point } from \"circuit-json\"\nimport { z } from \"zod\"\n\nexport const routeHintPointProps = z.object({\n x: distance,\n y: distance,\n via: z.boolean().optional(),\n toLayer: layer_ref.optional(),\n})\n\nexport const traceHintProps = z.object({\n for: z\n .string()\n .optional()\n .describe(\n \"Selector for the port you're targeting, not required if you're inside a trace\",\n ),\n order: z.number().optional(),\n offset: route_hint_point.or(routeHintPointProps).optional(),\n offsets: z\n .array(route_hint_point)\n .or(z.array(routeHintPointProps))\n .optional(),\n traceWidth: z.number().optional(),\n})\n\nexport type TraceHintProps = z.input<typeof traceHintProps>\n","import { direction } from \"lib/common/direction\"\nimport { commonLayoutProps } from \"lib/common/layout\"\nimport { z } from \"zod\"\n\nexport const portProps = commonLayoutProps.extend({\n name: z.string(),\n pinNumber: z.number().optional(),\n aliases: z.array(z.string()).optional(),\n direction: direction,\n})\nexport type PortProps = z.input<typeof portProps>\n","import {\n autorouterProp,\n type AutorouterProp,\n type PartsEngine,\n partsEngine,\n} from \"./components/group\"\nimport { expectTypesMatch } from \"./typecheck\"\nimport { z } from \"zod\"\n\nexport interface PlatformConfig {\n partsEngine?: PartsEngine\n\n autorouter?: AutorouterProp\n\n // TODO this follows a subset of the localStorage interface\n localCacheEngine?: any\n\n registryApiUrl?: string\n\n cloudAutorouterUrl?: string\n\n projectName?: string\n version?: string\n url?: string\n printBoardInformationToSilkscreen?: boolean\n\n pcbDisabled?: boolean\n schematicDisabled?: boolean\n partsEngineDisabled?: boolean\n\n footprintLibraryMap?: Record<\n string,\n Record<\n string,\n | any[]\n | ((path: string) => Promise<{\n footprintCircuitJson: any[]\n }>)\n >\n >\n}\n\nconst unvalidatedCircuitJson = z.array(z.any()).describe(\"Circuit JSON\")\nconst pathToCircuitJsonFn = z\n .function()\n .args(z.string())\n .returns(z.promise(z.object({ footprintCircuitJson: z.array(z.any()) })))\n .describe(\"A function that takes a path and returns Circuit JSON\")\n\nexport const platformConfig = z.object({\n partsEngine: partsEngine.optional(),\n autorouter: autorouterProp.optional(),\n registryApiUrl: z.string().optional(),\n cloudAutorouterUrl: z.string().optional(),\n projectName: z.string().optional(),\n version: z.string().optional(),\n url: z.string().optional(),\n printBoardInformationToSilkscreen: z.boolean().optional(),\n localCacheEngine: z.any().optional(),\n pcbDisabled: z.boolean().optional(),\n schematicDisabled: z.boolean().optional(),\n partsEngineDisabled: z.boolean().optional(),\n footprintLibraryMap: z\n .record(\n z.string(),\n z.record(\n z.string(),\n z.union([unvalidatedCircuitJson, pathToCircuitJsonFn]),\n ),\n )\n .optional(),\n}) as z.ZodType<PlatformConfig>\n\nexpectTypesMatch<PlatformConfig, z.infer<typeof platformConfig>>(true)\n"],"mappings":";AAYO,IAAM,mBAAmB,CAO9B,aAOS;AAAC;AAIZ,iBAQE,eAAe;AAEjB,iBAQE,iBAAiB;AAEnB,iBAOE,IAAI;AAEN,iBAOE,iCAAiC;;;ACjEnC,SAAS,SAAS;AACX,IAAM,YAAY,EAAE,KAAK,CAAC,MAAM,QAAQ,QAAQ,OAAO,CAAC;AASxD,IAAM,qBAAqB,EAAE,KAAK;AAAA,EACvC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AACF,CAAC;AAED,iBAAuD,IAAI;AAC3D,iBAAyE,IAAI;;;ACnB7E,SAAS,KAAAA,UAAS;AAGX,IAAM,YAAYC,GAAE,MAAMA,GAAE,OAAO,EAAE,GAAGA,GAAE,OAAO,CAAC,CAAC;AAG1D,iBAAuD,IAAI;;;ACN3D;AAAA,EAEE,YAAAC;AAAA,EACA;AAAA,EACA;AAAA,EACA;AAAA,OACK;AAEP,SAAS,KAAAC,UAAS;;;ACRlB,SAAS,KAAAC,UAAS;;;ACAlB,SAAS,gBAAgB;AACzB,SAAS,KAAAC,UAAS;AAEX,IAAM,SAASA,GAAE,OAAO;AAAA,EAC7B,GAAG;AAAA,EACH,GAAG;AAAA,EACH,GAAG;AACL,CAAC;;;ADHM,IAAM,iBAAiBC,GAA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AAE,MAAMA,IAAE,IAAI,CAAC,EAAE,CAAC,CAAC,CAAC,EACvE,SAAS,uDAAuD;AAE5D,IAAM,iBAAiBA,IAAE,OAAO;AAAA,EACrC,aAAa,YAAY,SAAS;AAAA,EAClC,YAAY,eAAe,SAAS;AAAA,EACpC,gBAAgBA,IAAE,OAAO,EAAE,SAAS;AAAA,EACpC,oBAAoBA,IAAE,OAAO,EAAE,SAAS;AAAA,EACxC,aAAaA,IAAE,OAAO,EAAE,SAAS;AAAA,EACjC,SAASA,IAAE,OAAO,EAAE,SAAS;AAAA,EAC7B,KAAKA,IAAE,OAAO,EAAE,SAAS;AAAA,EACzB,mCAAmCA,IAAE,QAAQ,EAAE,SAAS;AAAA,EACxD,kBAAkBA,IAAE,IAAI,EAAE,SAAS;AAAA,EACnC,aAAaA,IAAE,QAAQ,EAAE,SAAS;AAAA,EAClC,mBAAmBA,IAAE,QAAQ,EAAE,SAAS;AAAA,EACxC,qBAAqBA,IAAE,QAAQ,EAAE,SAAS;AAAA,EAC1C,qBAAqBA,IAClB;AAAA,IACCA,IAAE,OAAO;AAAA,IACTA,IAAE;AAAA,MACAA,IAAE,OAAO;AAAA,MACTA,IAAE,MAAM,CAAC,wBAAwB,mBAAmB,CAAC;AAAA,IACvD;AAAA,EACF,EACC,SAAS;AACd,CAAC;AAED,iBAAiE,IAAI;","names":["z","z","distance","z","z","z","z","z","z","distance","z","z","distance","z","distance","distance","distance","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","z","point","z","point","z","z","z","point","z","point","z","z","distance","z","distance","distance","distance","supplier_name","z","supplier_name","distance","distance","z","connectionTarget","z","distance","connectionTarget","z","distance","z","distance","z","z","distance","z","distance","z","resistance","z","resistance","z","frequency","capacitance","z","frequency","capacitance","distance","z","z","distance","capacitance","z","capacitance","z","z","z","distance","length","z","distance","z","z","distance","z","z","distance","z","z","distance","z","z","distance","distance","route_hint_point","z","z","distance","route_hint_point","layer_ref","z","layer_ref","z","z","distance","z","distance","connectionTarget","z","rotation","z","distance","z","rotation","z","distance","z","z","z","z","z","connectionTarget","connectionsProp","z","z","z","length","z","length","length","route_hint_point","z","route_hint_point","length","distance","route_hint_point","z","distance","layer_ref","z","layer_ref","distance","distance","z","distance","z","distance","z","distance","voltage","voltage","distance","z","z","z","distance","distance","z","distance","rotation","z","z","z","distance","rotation","point","z","distance","z","z","distance","distance","z","z","distance","distance","z","z","distance","length","z","length","length","route_hint_point","z","route_hint_point","length","distance","distance","distance","z","distance","distance","z","distance","distance","layer_ref","route_hint_point","z","z","z"]}
@@ -40,6 +40,10 @@ export interface ChipPropsSU<PinLabel extends string = string>
40
40
  * Whether to show pin aliases in the schematic
41
41
  */
42
42
  showPinAliases?: boolean
43
+ /**
44
+ * Labels for PCB pins
45
+ */
46
+ pcbPinLabels?: Record<string, string>
43
47
  schPinArrangement?: SchematicPortArrangement
44
48
  /** @deprecated Use schPinArrangement instead. */
45
49
  schPortArrangement?: SchematicPortArrangement
@@ -126,6 +130,7 @@ export const chipProps = commonComponentProps.extend({
126
130
  manufacturerPartNumber: z.string().optional(),
127
131
  pinLabels: pinLabelsProp.optional(),
128
132
  showPinAliases: z.boolean().optional(),
133
+ pcbPinLabels: z.record(z.string(), z.string()).optional(),
129
134
  internallyConnectedPins: z.array(z.array(z.string())).optional(),
130
135
  externallyConnectedPins: z.array(z.array(z.string())).optional(),
131
136
  schPinArrangement: schematicPinArrangement.optional(),
@@ -25,6 +25,10 @@ export interface JumperProps extends CommonComponentProps {
25
25
  schHeight?: number | string
26
26
  schDirection?: "left" | "right"
27
27
  schPortArrangement?: SchematicPortArrangement
28
+ /**
29
+ * Labels for PCB pins
30
+ */
31
+ pcbPinLabels?: Record<string, string>
28
32
  /**
29
33
  * Number of pins on the jumper (2 or 3)
30
34
  */
@@ -51,6 +55,7 @@ export const jumperProps = commonComponentProps.extend({
51
55
  schHeight: distance.optional(),
52
56
  schDirection: z.enum(["left", "right"]).optional(),
53
57
  schPortArrangement: schematicPortArrangement.optional(),
58
+ pcbPinLabels: z.record(z.string(), z.string()).optional(),
54
59
  pinCount: z.union([z.literal(2), z.literal(3)]).optional(),
55
60
  internallyConnectedPins: z.array(z.array(z.string())).optional(),
56
61
  connections: z
@@ -42,6 +42,11 @@ export interface PinHeaderProps extends CommonComponentProps {
42
42
  */
43
43
  showSilkscreenPinLabels?: boolean
44
44
 
45
+ /**
46
+ * Labels for PCB pins
47
+ */
48
+ pcbPinLabels?: Record<string, string>
49
+
45
50
  /**
46
51
  * Whether the header has two rows of pins
47
52
  */
@@ -104,6 +109,7 @@ export const pinHeaderProps = commonComponentProps.extend({
104
109
  schFacingDirection: z.enum(["up", "down", "left", "right"]).optional(),
105
110
  gender: z.enum(["male", "female"]).optional().default("male"),
106
111
  showSilkscreenPinLabels: z.boolean().optional(),
112
+ pcbPinLabels: z.record(z.string(), z.string()).optional(),
107
113
  doubleRow: z.boolean().optional(),
108
114
  holeDiameter: distance.optional(),
109
115
  platedDiameter: distance.optional(),
@@ -10,6 +10,7 @@ export const schematicCellProps = z.object({
10
10
  rowSpan: z.number().optional(),
11
11
  colSpan: z.number().optional(),
12
12
  width: distance.optional(),
13
+ text: z.string().optional(),
13
14
  })
14
15
 
15
16
  export interface SchematicCellProps {
@@ -20,6 +21,7 @@ export interface SchematicCellProps {
20
21
  rowSpan?: number
21
22
  colSpan?: number
22
23
  width?: number | string
24
+ text?: string
23
25
  }
24
26
 
25
27
  expectTypesMatch<SchematicCellProps, z.input<typeof schematicCellProps>>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.255",
3
+ "version": "0.0.257",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",