@tscircuit/props 0.0.530 → 0.0.532

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
@@ -234,8 +234,9 @@ export interface AutoroutingPhaseProps extends RoutingTolerances {
234
234
  ### BatteryProps `<battery />`
235
235
 
236
236
  ```ts
237
- export interface BatteryProps<PinLabel extends string = string>
238
- extends CommonComponentProps<PinLabel> {
237
+ export interface BatteryProps<
238
+ PinLabel extends string = string,
239
+ > extends CommonComponentProps<PinLabel> {
239
240
  capacity?: number | string;
240
241
  voltage?: number | string;
241
242
  standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C";
@@ -248,8 +249,10 @@ export interface BatteryProps<PinLabel extends string = string>
248
249
  ### BoardProps `<board />`
249
250
 
250
251
  ```ts
251
- export interface BoardProps
252
- extends Omit<SubcircuitGroupProps, "subcircuit" | "connections"> {
252
+ export interface BoardProps extends Omit<
253
+ SubcircuitGroupProps,
254
+ "subcircuit" | "connections"
255
+ > {
253
256
  title?: string;
254
257
  material?: "fr4" | "fr1" | "flex";
255
258
  /** Number of layers for the PCB */
@@ -283,8 +286,10 @@ export interface BoardProps
283
286
  ### BreakoutProps `<breakout />`
284
287
 
285
288
  ```ts
286
- export interface BreakoutProps
287
- extends Omit<SubcircuitGroupProps, "subcircuit"> {
289
+ export interface BreakoutProps extends Omit<
290
+ SubcircuitGroupProps,
291
+ "subcircuit"
292
+ > {
288
293
  padding?: Distance;
289
294
  paddingLeft?: Distance;
290
295
  paddingRight?: Distance;
@@ -298,8 +303,10 @@ export interface BreakoutProps
298
303
  ### BreakoutPointProps `<breakoutpoint />`
299
304
 
300
305
  ```ts
301
- export interface BreakoutPointProps
302
- extends Omit<PcbLayoutProps, "pcbRotation" | "layer"> {
306
+ export interface BreakoutPointProps extends Omit<
307
+ PcbLayoutProps,
308
+ "pcbRotation" | "layer"
309
+ > {
303
310
  connection: string;
304
311
  }
305
312
  ```
@@ -351,8 +358,9 @@ export interface CadModelProps extends CadModelBase {
351
358
  ### CapacitorProps `<capacitor />`
352
359
 
353
360
  ```ts
354
- export interface CapacitorProps<PinLabel extends string = string>
355
- extends CommonComponentProps<PinLabel> {
361
+ export interface CapacitorProps<
362
+ PinLabel extends string = string,
363
+ > extends CommonComponentProps<PinLabel> {
356
364
  capacitance: number | string;
357
365
  maxVoltageRating?: number | string;
358
366
  schShowRatings?: boolean;
@@ -513,8 +521,9 @@ export type CourtyardRectProps = z.input<typeof courtyardRectProps>;
513
521
  ### CrystalProps `<crystal />`
514
522
 
515
523
  ```ts
516
- export interface CrystalProps<PinLabel extends string = string>
517
- extends CommonComponentProps<PinLabel> {
524
+ export interface CrystalProps<
525
+ PinLabel extends string = string,
526
+ > extends CommonComponentProps<PinLabel> {
518
527
  frequency: number | string;
519
528
  loadCapacitance: number | string;
520
529
  manufacturerPartNumber?: string;
@@ -530,8 +539,9 @@ export interface CrystalProps<PinLabel extends string = string>
530
539
  ### CurrentSourceProps `<currentsource />`
531
540
 
532
541
  ```ts
533
- export interface CurrentSourceProps<PinLabel extends string = string>
534
- extends CommonComponentProps<PinLabel> {
542
+ export interface CurrentSourceProps<
543
+ PinLabel extends string = string,
544
+ > extends CommonComponentProps<PinLabel> {
535
545
  current?: number | string;
536
546
  frequency?: number | string;
537
547
  peakToPeakCurrent?: number | string;
@@ -547,8 +557,10 @@ export interface CurrentSourceProps<PinLabel extends string = string>
547
557
  ### RectCutoutProps `<cutout />`
548
558
 
549
559
  ```ts
550
- export interface RectCutoutProps
551
- extends Omit<PcbLayoutProps, "layer" | "pcbRotation"> {
560
+ export interface RectCutoutProps extends Omit<
561
+ PcbLayoutProps,
562
+ "layer" | "pcbRotation"
563
+ > {
552
564
  name?: string;
553
565
  shape: "rect";
554
566
  width: Distance;
@@ -561,8 +573,9 @@ export interface RectCutoutProps
561
573
  ### DiodeProps `<diode />`
562
574
 
563
575
  ```ts
564
- export interface DiodeProps<PinLabel extends string = string>
565
- extends CommonComponentProps<PinLabel> {
576
+ export interface DiodeProps<
577
+ PinLabel extends string = string,
578
+ > extends CommonComponentProps<PinLabel> {
566
579
  connections?: {
567
580
  anode?: string | string[] | readonly string[];
568
581
  cathode?: string | string[] | readonly string[];
@@ -587,19 +600,18 @@ export interface DiodeProps<PinLabel extends string = string>
587
600
  ### FabricationNoteDimensionProps `<fabricationnotedimension />`
588
601
 
589
602
  ```ts
590
- export interface FabricationNoteDimensionProps
591
- extends Omit<
592
- PcbLayoutProps,
593
- | "pcbLeftEdgeX"
594
- | "pcbRightEdgeX"
595
- | "pcbTopEdgeY"
596
- | "pcbBottomEdgeY"
597
- | "pcbX"
598
- | "pcbY"
599
- | "pcbOffsetX"
600
- | "pcbOffsetY"
601
- | "pcbRotation"
602
- > {
603
+ export interface FabricationNoteDimensionProps extends Omit<
604
+ PcbLayoutProps,
605
+ | "pcbLeftEdgeX"
606
+ | "pcbRightEdgeX"
607
+ | "pcbTopEdgeY"
608
+ | "pcbBottomEdgeY"
609
+ | "pcbX"
610
+ | "pcbY"
611
+ | "pcbOffsetX"
612
+ | "pcbOffsetY"
613
+ | "pcbRotation"
614
+ > {
603
615
  from: string | Point;
604
616
  to: string | Point;
605
617
  text?: string;
@@ -700,8 +712,9 @@ export interface FootprintProps {
700
712
  ### FuseProps `<fuse />`
701
713
 
702
714
  ```ts
703
- export interface FuseProps<PinLabel extends string = string>
704
- extends CommonComponentProps<PinLabel> {
715
+ export interface FuseProps<
716
+ PinLabel extends string = string,
717
+ > extends CommonComponentProps<PinLabel> {
705
718
  /**
706
719
  * Current rating of the fuse in amperes
707
720
  */
@@ -879,8 +892,9 @@ export interface CircleHoleProps extends PcbLayoutProps {
879
892
  ### InductorProps `<inductor />`
880
893
 
881
894
  ```ts
882
- export interface InductorProps<PinLabel extends string = string>
883
- extends CommonComponentProps<PinLabel> {
895
+ export interface InductorProps<
896
+ PinLabel extends string = string,
897
+ > extends CommonComponentProps<PinLabel> {
884
898
  inductance: number | string;
885
899
  maxCurrentRating?: number | string;
886
900
  schOrientation?: SchematicOrientation;
@@ -962,8 +976,9 @@ export type LedProps = z.input<typeof ledProps>;
962
976
  ### MosfetProps `<mosfet />`
963
977
 
964
978
  ```ts
965
- export interface MosfetProps<PinLabel extends string = string>
966
- extends CommonComponentProps<PinLabel> {
979
+ export interface MosfetProps<
980
+ PinLabel extends string = string,
981
+ > extends CommonComponentProps<PinLabel> {
967
982
  channelType: "n" | "p";
968
983
  mosfetMode: "enhancement" | "depletion";
969
984
  }
@@ -975,8 +990,7 @@ export interface MosfetProps<PinLabel extends string = string>
975
990
 
976
991
  ```ts
977
992
  export interface MountedBoardProps
978
- extends SubcircuitGroupProps,
979
- MountedBoardChipProps {
993
+ extends SubcircuitGroupProps, MountedBoardChipProps {
980
994
  boardToBoardDistance?: Distance;
981
995
  mountOrientation?: "faceDown" | "faceUp";
982
996
  }
@@ -1033,8 +1047,9 @@ export interface NetLabelProps {
1033
1047
  ### OpAmpProps `<opamp />`
1034
1048
 
1035
1049
  ```ts
1036
- export interface OpAmpProps<PinLabel extends string = string>
1037
- extends CommonComponentProps<PinLabel> {
1050
+ export interface OpAmpProps<
1051
+ PinLabel extends string = string,
1052
+ > extends CommonComponentProps<PinLabel> {
1038
1053
  connections?: Connections<OpAmpPinLabels>;
1039
1054
  }
1040
1055
  ```
@@ -1044,8 +1059,10 @@ export interface OpAmpProps<PinLabel extends string = string>
1044
1059
  ### PanelProps `<panel />`
1045
1060
 
1046
1061
  ```ts
1047
- export interface PanelProps
1048
- extends Omit<BaseGroupProps, "height" | "layoutMode" | "width"> {
1062
+ export interface PanelProps extends Omit<
1063
+ BaseGroupProps,
1064
+ "height" | "layoutMode" | "width"
1065
+ > {
1049
1066
  width?: Distance;
1050
1067
  height?: Distance;
1051
1068
  children?: BaseGroupProps["children"];
@@ -1088,19 +1105,18 @@ export type PcbKeepoutProps = z.input<typeof pcbKeepoutProps>;
1088
1105
  ### PcbNoteDimensionProps `<pcbnotedimension />`
1089
1106
 
1090
1107
  ```ts
1091
- export interface PcbNoteDimensionProps
1092
- extends Omit<
1093
- PcbLayoutProps,
1094
- | "pcbLeftEdgeX"
1095
- | "pcbRightEdgeX"
1096
- | "pcbTopEdgeY"
1097
- | "pcbBottomEdgeY"
1098
- | "pcbX"
1099
- | "pcbY"
1100
- | "pcbOffsetX"
1101
- | "pcbOffsetY"
1102
- | "pcbRotation"
1103
- > {
1108
+ export interface PcbNoteDimensionProps extends Omit<
1109
+ PcbLayoutProps,
1110
+ | "pcbLeftEdgeX"
1111
+ | "pcbRightEdgeX"
1112
+ | "pcbTopEdgeY"
1113
+ | "pcbBottomEdgeY"
1114
+ | "pcbX"
1115
+ | "pcbY"
1116
+ | "pcbOffsetX"
1117
+ | "pcbOffsetY"
1118
+ | "pcbRotation"
1119
+ > {
1104
1120
  from: string | Point;
1105
1121
  to: string | Point;
1106
1122
  text?: string;
@@ -1121,19 +1137,18 @@ export interface PcbNoteDimensionProps
1121
1137
  ### PcbNoteLineProps `<pcbnoteline />`
1122
1138
 
1123
1139
  ```ts
1124
- export interface PcbNoteLineProps
1125
- extends Omit<
1126
- PcbLayoutProps,
1127
- | "pcbLeftEdgeX"
1128
- | "pcbRightEdgeX"
1129
- | "pcbTopEdgeY"
1130
- | "pcbBottomEdgeY"
1131
- | "pcbX"
1132
- | "pcbY"
1133
- | "pcbOffsetX"
1134
- | "pcbOffsetY"
1135
- | "pcbRotation"
1136
- > {
1140
+ export interface PcbNoteLineProps extends Omit<
1141
+ PcbLayoutProps,
1142
+ | "pcbLeftEdgeX"
1143
+ | "pcbRightEdgeX"
1144
+ | "pcbTopEdgeY"
1145
+ | "pcbBottomEdgeY"
1146
+ | "pcbX"
1147
+ | "pcbY"
1148
+ | "pcbOffsetX"
1149
+ | "pcbOffsetY"
1150
+ | "pcbRotation"
1151
+ > {
1137
1152
  x1: string | number;
1138
1153
  y1: string | number;
1139
1154
  x2: string | number;
@@ -1149,19 +1164,18 @@ export interface PcbNoteLineProps
1149
1164
  ### PcbNotePathProps `<pcbnotepath />`
1150
1165
 
1151
1166
  ```ts
1152
- export interface PcbNotePathProps
1153
- extends Omit<
1154
- PcbLayoutProps,
1155
- | "pcbLeftEdgeX"
1156
- | "pcbRightEdgeX"
1157
- | "pcbTopEdgeY"
1158
- | "pcbBottomEdgeY"
1159
- | "pcbX"
1160
- | "pcbY"
1161
- | "pcbOffsetX"
1162
- | "pcbOffsetY"
1163
- | "pcbRotation"
1164
- > {
1167
+ export interface PcbNotePathProps extends Omit<
1168
+ PcbLayoutProps,
1169
+ | "pcbLeftEdgeX"
1170
+ | "pcbRightEdgeX"
1171
+ | "pcbTopEdgeY"
1172
+ | "pcbBottomEdgeY"
1173
+ | "pcbX"
1174
+ | "pcbY"
1175
+ | "pcbOffsetX"
1176
+ | "pcbOffsetY"
1177
+ | "pcbRotation"
1178
+ > {
1165
1179
  route: RouteHintPointInput[];
1166
1180
  strokeWidth?: string | number;
1167
1181
  color?: string;
@@ -1321,8 +1335,10 @@ export interface PinHeaderProps extends CommonComponentProps {
1321
1335
  ### CirclePlatedHoleProps `<platedhole />`
1322
1336
 
1323
1337
  ```ts
1324
- export interface CirclePlatedHoleProps
1325
- extends Omit<PcbLayoutProps, "pcbRotation" | "layer"> {
1338
+ export interface CirclePlatedHoleProps extends Omit<
1339
+ PcbLayoutProps,
1340
+ "pcbRotation" | "layer"
1341
+ > {
1326
1342
  name?: string;
1327
1343
  connectsTo?: string | string[];
1328
1344
  shape: "circle";
@@ -1348,8 +1364,9 @@ export type PortProps = z.input<typeof portProps>;
1348
1364
  ### PotentiometerProps `<potentiometer />`
1349
1365
 
1350
1366
  ```ts
1351
- export interface PotentiometerProps<PinLabel extends string = string>
1352
- extends CommonComponentProps<PinLabel> {
1367
+ export interface PotentiometerProps<
1368
+ PinLabel extends string = string,
1369
+ > extends CommonComponentProps<PinLabel> {
1353
1370
  maxResistance: number | string;
1354
1371
  pinVariant?: PotentiometerPinVariant;
1355
1372
  connections?: Connections<PotentiometerPinLabels>;
@@ -1378,8 +1395,9 @@ export type PushButtonProps<T extends PinLabelsProp | string = string> =
1378
1395
  ### ResistorProps `<resistor />`
1379
1396
 
1380
1397
  ```ts
1381
- export interface ResistorProps<PinLabel extends string = string>
1382
- extends CommonComponentProps<PinLabel> {
1398
+ export interface ResistorProps<
1399
+ PinLabel extends string = string,
1400
+ > extends CommonComponentProps<PinLabel> {
1383
1401
  resistance: number | string;
1384
1402
  tolerance?: number | string;
1385
1403
  pullupFor?: string;
@@ -1668,8 +1686,10 @@ export interface SolderJumperProps extends JumperProps {
1668
1686
  ### RectSolderPasteProps `<solderpaste />`
1669
1687
 
1670
1688
  ```ts
1671
- export interface RectSolderPasteProps
1672
- extends Omit<PcbLayoutProps, "pcbRotation"> {
1689
+ export interface RectSolderPasteProps extends Omit<
1690
+ PcbLayoutProps,
1691
+ "pcbRotation"
1692
+ > {
1673
1693
  shape: "rect";
1674
1694
  width: Distance;
1675
1695
  height: Distance;
@@ -1808,8 +1828,9 @@ export type TraceHintProps = z.input<typeof traceHintProps>;
1808
1828
  ### TransistorProps `<transistor />`
1809
1829
 
1810
1830
  ```ts
1811
- export interface TransistorProps<PinLabel extends string = string>
1812
- extends CommonComponentProps<PinLabel> {
1831
+ export interface TransistorProps<
1832
+ PinLabel extends string = string,
1833
+ > extends CommonComponentProps<PinLabel> {
1813
1834
  type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt";
1814
1835
  connections?: Connections<transistorPinsLabels>;
1815
1836
  }
@@ -1822,8 +1843,9 @@ export interface TransistorProps<PinLabel extends string = string>
1822
1843
  ```ts
1823
1844
  export interface ViaProps extends CommonLayoutProps {
1824
1845
  name?: string;
1825
- fromLayer: LayerRefInput;
1826
- toLayer: LayerRefInput;
1846
+ fromLayer?: LayerRefInput;
1847
+ toLayer?: LayerRefInput;
1848
+ layers?: LayerRefInput[];
1827
1849
  holeDiameter?: number | string;
1828
1850
  outerDiameter?: number | string;
1829
1851
  connectsTo?: string | string[];
@@ -1849,8 +1871,9 @@ export interface VoltageProbeProps extends Omit<CommonComponentProps, "name"> {
1849
1871
  ### VoltageSourceProps `<voltagesource />`
1850
1872
 
1851
1873
  ```ts
1852
- export interface VoltageSourceProps<PinLabel extends string = string>
1853
- extends CommonComponentProps<PinLabel> {
1874
+ export interface VoltageSourceProps<
1875
+ PinLabel extends string = string,
1876
+ > extends CommonComponentProps<PinLabel> {
1854
1877
  voltage?: number | string;
1855
1878
  frequency?: number | string;
1856
1879
  peakToPeakVoltage?: number | string;
@@ -1911,7 +1934,7 @@ export interface PlatformConfig {
1911
1934
  spiceEngineMap?: Record<string, SpiceEngine>;
1912
1935
 
1913
1936
  footprintLibraryMap?: Record<
1914
- string,
1937
+ FootprintLibraryPrefix,
1915
1938
  | ((
1916
1939
  path: string,
1917
1940
  options?: { resolvedPcbStyle?: PcbStyle },
@@ -1926,7 +1949,12 @@ export interface PlatformConfig {
1926
1949
  >
1927
1950
  >;
1928
1951
 
1929
- footprintFileParserMap?: Record<string, FootprintFileParserEntry>;
1952
+ footprintFileParserMap?: Record<FileExtension, FootprintFileParserEntry>;
1953
+
1954
+ staticFileLoaderMap?: Record<
1955
+ FileExtension,
1956
+ (fileContent: FileContent) => Promise<EsModuleImportResult>
1957
+ >;
1930
1958
 
1931
1959
  resolveProjectStaticFileImportUrl?: (path: string) => Promise<string>;
1932
1960
  nodeModulesResolver?: (modulePath: string) => Promise<string | null>;
@@ -1945,18 +1973,17 @@ export interface PlatformConfig {
1945
1973
  ### ProjectConfig
1946
1974
 
1947
1975
  ```ts
1948
- export interface ProjectConfig
1949
- extends Pick<
1950
- PlatformConfig,
1951
- | "projectName"
1952
- | "projectBaseUrl"
1953
- | "version"
1954
- | "url"
1955
- | "printBoardInformationToSilkscreen"
1956
- | "includeBoardFiles"
1957
- | "snapshotsDir"
1958
- | "defaultSpiceEngine"
1959
- > {}
1976
+ export interface ProjectConfig extends Pick<
1977
+ PlatformConfig,
1978
+ | "projectName"
1979
+ | "projectBaseUrl"
1980
+ | "version"
1981
+ | "url"
1982
+ | "printBoardInformationToSilkscreen"
1983
+ | "includeBoardFiles"
1984
+ | "snapshotsDir"
1985
+ | "defaultSpiceEngine"
1986
+ > {}
1960
1987
  ```
1961
1988
 
1962
1989
  [Source](https://github.com/tscircuit/props/blob/main/lib/projectConfig.ts)