@tscircuit/props 0.0.261 → 0.0.263

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
@@ -15,327 +15,332 @@ resistorProps.parse({ resistance: "10k" } as ResistorPropsInput);
15
15
  ```
16
16
 
17
17
  <!-- COMPONENT_TABLE_START -->
18
-
19
18
  ## Available Components
20
19
 
21
- | Component | Props Interface |
22
- | ----------------------- | --------------------------------------------------------------------- |
23
- | `<battery />` | [`BatteryProps`](#batteryprops-battery) |
24
- | `<board />` | [`BoardProps`](#boardprops-board) |
25
- | `<breakout />` | [`BreakoutProps`](#breakoutprops-breakout) |
26
- | `<breakoutpoint />` | [`BreakoutPointProps`](#breakoutpointprops-breakoutpoint) |
27
- | `<capacitor />` | [`CapacitorProps`](#capacitorprops-capacitor) |
28
- | `<chip />` | [`ChipProps`](#chipprops-chip) |
29
- | `<connector />` | [`ConnectorProps`](#connectorprops-connector) |
20
+ | Component | Props Interface |
21
+ | --------- | -------------- |
22
+ | `<battery />` | [`BatteryProps`](#batteryprops-battery) |
23
+ | `<board />` | [`BoardProps`](#boardprops-board) |
24
+ | `<breakout />` | [`BreakoutProps`](#breakoutprops-breakout) |
25
+ | `<breakoutpoint />` | [`BreakoutPointProps`](#breakoutpointprops-breakoutpoint) |
26
+ | `<capacitor />` | [`CapacitorProps`](#capacitorprops-capacitor) |
27
+ | `<chip />` | [`ChipProps`](#chipprops-chip) |
28
+ | `<connector />` | [`ConnectorProps`](#connectorprops-connector) |
30
29
  | `<constrainedlayout />` | [`ConstrainedLayoutProps`](#constrainedlayoutprops-constrainedlayout) |
31
- | `<crystal />` | [`CrystalProps`](#crystalprops-crystal) |
32
- | `<cutout />` | [`RectCutoutProps`](#rectcutoutprops-cutout) |
33
- | `<diode />` | [`DiodeProps`](#diodeprops-diode) |
34
- | `<footprint />` | [`FootprintProps`](#footprintprops-footprint) |
35
- | `<fuse />` | [`FuseProps`](#fuseprops-fuse) |
36
- | `<group />` | [`BaseGroupProps`](#basegroupprops-group) |
37
- | `<hole />` | [`HoleProps`](#holeprops-hole) |
38
- | `<inductor />` | [`InductorProps`](#inductorprops-inductor) |
39
- | `<jumper />` | [`JumperProps`](#jumperprops-jumper) |
40
- | `<mosfet />` | [`MosfetProps`](#mosfetprops-mosfet) |
41
- | `<net />` | [`NetProps`](#netprops-net) |
42
- | `<netalias />` | [`NetAliasProps`](#netaliasprops-netalias) |
43
- | `<netlabel />` | [`NetLabelProps`](#netlabelprops-netlabel) |
44
- | `<pinheader />` | [`PinHeaderProps`](#pinheaderprops-pinheader) |
45
- | `<platedhole />` | [`CirclePlatedHoleProps`](#circleplatedholeprops-platedhole) |
46
- | `<potentiometer />` | [`PotentiometerProps`](#potentiometerprops-potentiometer) |
47
- | `<resistor />` | [`ResistorProps`](#resistorprops-resistor) |
48
- | `<resonator />` | [`ResonatorProps`](#resonatorprops-resonator) |
49
- | `<schematiccell />` | [`SchematicCellProps`](#schematiccellprops-schematiccell) |
50
- | `<schematicrow />` | [`SchematicRowProps`](#schematicrowprops-schematicrow) |
51
- | `<schematictable />` | [`SchematicTableProps`](#schematictableprops-schematictable) |
52
- | `<smtpad />` | [`RectSmtPadProps`](#rectsmtpadprops-smtpad) |
53
- | `<solderjumper />` | [`SolderJumperProps`](#solderjumperprops-solderjumper) |
54
- | `<solderpaste />` | [`RectSolderPasteProps`](#rectsolderpasteprops-solderpaste) |
55
- | `<stampboard />` | [`StampboardProps`](#stampboardprops-stampboard) |
56
- | `<switch />` | [`SwitchProps`](#switchprops-switch) |
57
- | `<testpoint />` | [`TestpointProps`](#testpointprops-testpoint) |
58
- | `<transistor />` | [`TransistorProps`](#transistorprops-transistor) |
59
- | `<via />` | [`ViaProps`](#viaprops-via) |
60
-
30
+ | `<crystal />` | [`CrystalProps`](#crystalprops-crystal) |
31
+ | `<cutout />` | [`RectCutoutProps`](#rectcutoutprops-cutout) |
32
+ | `<diode />` | [`DiodeProps`](#diodeprops-diode) |
33
+ | `<footprint />` | [`FootprintProps`](#footprintprops-footprint) |
34
+ | `<fuse />` | [`FuseProps`](#fuseprops-fuse) |
35
+ | `<group />` | [`BaseGroupProps`](#basegroupprops-group) |
36
+ | `<hole />` | [`HoleProps`](#holeprops-hole) |
37
+ | `<inductor />` | [`InductorProps`](#inductorprops-inductor) |
38
+ | `<jumper />` | [`JumperProps`](#jumperprops-jumper) |
39
+ | `<mosfet />` | [`MosfetProps`](#mosfetprops-mosfet) |
40
+ | `<net />` | [`NetProps`](#netprops-net) |
41
+ | `<netalias />` | [`NetAliasProps`](#netaliasprops-netalias) |
42
+ | `<netlabel />` | [`NetLabelProps`](#netlabelprops-netlabel) |
43
+ | `<pinheader />` | [`PinHeaderProps`](#pinheaderprops-pinheader) |
44
+ | `<platedhole />` | [`CirclePlatedHoleProps`](#circleplatedholeprops-platedhole) |
45
+ | `<potentiometer />` | [`PotentiometerProps`](#potentiometerprops-potentiometer) |
46
+ | `<resistor />` | [`ResistorProps`](#resistorprops-resistor) |
47
+ | `<resonator />` | [`ResonatorProps`](#resonatorprops-resonator) |
48
+ | `<schematiccell />` | [`SchematicCellProps`](#schematiccellprops-schematiccell) |
49
+ | `<schematicrow />` | [`SchematicRowProps`](#schematicrowprops-schematicrow) |
50
+ | `<schematictable />` | [`SchematicTableProps`](#schematictableprops-schematictable) |
51
+ | `<smtpad />` | [`RectSmtPadProps`](#rectsmtpadprops-smtpad) |
52
+ | `<solderjumper />` | [`SolderJumperProps`](#solderjumperprops-solderjumper) |
53
+ | `<solderpaste />` | [`RectSolderPasteProps`](#rectsolderpasteprops-solderpaste) |
54
+ | `<stampboard />` | [`StampboardProps`](#stampboardprops-stampboard) |
55
+ | `<switch />` | [`SwitchProps`](#switchprops-switch) |
56
+ | `<testpoint />` | [`TestpointProps`](#testpointprops-testpoint) |
57
+ | `<transistor />` | [`TransistorProps`](#transistorprops-transistor) |
58
+ | `<via />` | [`ViaProps`](#viaprops-via) |
61
59
  <!-- COMPONENT_TABLE_END -->
62
60
 
63
61
  <!-- USAGE_EXAMPLES_START -->
64
-
65
62
  ## Usage Examples
66
63
 
67
64
  ```tsx
68
- import { resistorProps, type ResistorProps } from "@tscircuit/props";
65
+ import { resistorProps, type ResistorProps } from "@tscircuit/props"
69
66
 
70
67
  // Validate component props
71
- const validatedProps = resistorProps.parse({ resistance: "10k" });
68
+ const validatedProps = resistorProps.parse({ resistance: "10k" })
72
69
  // { resistance: 10000 }
73
70
 
74
71
  // Type safety
75
72
  const myResistor: ResistorProps = {
76
73
  name: "R1",
77
74
  resistance: 10000,
78
- footprint: "0805",
79
- };
75
+ footprint: "0805"
76
+ }
80
77
  ```
81
-
82
78
  <!-- USAGE_EXAMPLES_END -->
83
79
 
84
80
  <!-- INTERFACE_DEFINITIONS_START -->
85
-
86
81
  ## Component Interface Definitions
87
82
 
88
83
  Below are the TypeScript interface definitions for all component props:
89
84
 
85
+
90
86
  ### CommonComponentProps
91
87
 
92
88
  ```ts
93
89
  export interface CommonComponentProps extends CommonLayoutProps {
94
- key?: any;
95
- name: string;
96
- supplierPartNumbers?: SupplierPartNumbers;
97
- cadModel?: CadModelProp;
98
- children?: any;
99
- symbolName?: string;
100
- doNotPlace?: boolean;
90
+ key?: any
91
+ name: string
92
+ pinAttributes?: Record<PinLabel, PinAttributeMap>
93
+ supplierPartNumbers?: SupplierPartNumbers
94
+ cadModel?: CadModelProp
95
+ children?: any
96
+ symbolName?: string
97
+ doNotPlace?: boolean
101
98
  }
102
99
  ```
103
100
 
104
101
  [Source](https://github.com/tscircuit/props/blob/main/lib/common/layout.ts)
105
102
 
103
+
106
104
  ### SubcircuitGroupProps
107
105
 
108
106
  ```ts
109
107
  export interface SubcircuitGroupProps extends BaseGroupProps {
110
- layout?: LayoutBuilder;
111
- manualEdits?: ManualEditsFileInput;
112
- routingDisabled?: boolean;
113
- defaultTraceWidth?: Distance;
114
- minTraceWidth?: Distance;
115
- pcbRouteCache?: PcbRouteCache;
108
+ layout?: LayoutBuilder
109
+ manualEdits?: ManualEditsFileInput
110
+ routingDisabled?: boolean
111
+ defaultTraceWidth?: Distance
112
+ minTraceWidth?: Distance
113
+ pcbRouteCache?: PcbRouteCache
116
114
 
117
- autorouter?: AutorouterProp;
115
+ autorouter?: AutorouterProp
118
116
 
119
117
  /**
120
118
  * If true, we'll automatically layout the schematic for this group. Must be
121
119
  * a subcircuit (currently). This is eventually going to be replaced with more
122
120
  * sophisticated layout options/modes and will be enabled by default.
123
121
  */
124
- schAutoLayoutEnabled?: boolean;
122
+ schAutoLayoutEnabled?: boolean
125
123
 
126
124
  /**
127
125
  * If true, net labels will automatically be created for complex traces
128
126
  */
129
- schTraceAutoLabelEnabled?: boolean;
127
+ schTraceAutoLabelEnabled?: boolean
130
128
 
131
- partsEngine?: PartsEngine;
129
+ partsEngine?: PartsEngine
132
130
  }
133
131
  ```
134
132
 
135
133
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/group.ts)
136
134
 
135
+
137
136
  ### BatteryProps `<battery />`
138
137
 
139
138
  ```ts
140
139
  export interface BatteryProps<PinLabel extends string = string>
141
140
  extends CommonComponentProps<PinLabel> {
142
- capacity?: number | string;
143
- schOrientation?: SchematicOrientation;
141
+ capacity?: number | string
142
+ schOrientation?: SchematicOrientation
144
143
  }
145
144
  ```
146
145
 
147
146
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/battery.ts)
148
147
 
148
+
149
149
  ### BoardProps `<board />`
150
150
 
151
151
  ```ts
152
152
  export interface BoardProps extends Omit<SubcircuitGroupProps, "subcircuit"> {
153
- width?: number | string;
154
- height?: number | string;
155
- outline?: Point[];
156
- outlineOffsetX?: number | string;
157
- outlineOffsetY?: number | string;
158
- material?: "fr4" | "fr1";
153
+ material?: "fr4" | "fr1"
159
154
  }
160
155
  ```
161
156
 
162
157
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/board.ts)
163
158
 
159
+
164
160
  ### BreakoutProps `<breakout />`
165
161
 
166
162
  ```ts
167
163
  export interface BreakoutProps
168
164
  extends Omit<SubcircuitGroupProps, "subcircuit"> {
169
- padding?: Distance;
170
- paddingLeft?: Distance;
171
- paddingRight?: Distance;
172
- paddingTop?: Distance;
173
- paddingBottom?: Distance;
165
+ padding?: Distance
166
+ paddingLeft?: Distance
167
+ paddingRight?: Distance
168
+ paddingTop?: Distance
169
+ paddingBottom?: Distance
174
170
  }
175
171
  ```
176
172
 
177
173
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/breakout.ts)
178
174
 
175
+
179
176
  ### BreakoutPointProps `<breakoutpoint />`
180
177
 
181
178
  ```ts
182
179
  export interface BreakoutPointProps
183
180
  extends Omit<PcbLayoutProps, "pcbRotation" | "layer"> {
184
- connection: string;
181
+ connection: string
185
182
  }
186
183
  ```
187
184
 
188
185
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/breakoutpoint.ts)
189
186
 
187
+
190
188
  ### CapacitorProps `<capacitor />`
191
189
 
192
190
  ```ts
193
191
  export interface CapacitorProps<PinLabel extends string = string>
194
192
  extends CommonComponentProps<PinLabel> {
195
- capacitance: number | string;
196
- maxVoltageRating?: number | string;
197
- schShowRatings?: boolean;
198
- polarized?: boolean;
199
- decouplingFor?: string;
200
- decouplingTo?: string;
201
- bypassFor?: string;
202
- bypassTo?: string;
203
- maxDecouplingTraceLength?: number;
204
- schOrientation?: SchematicOrientation;
205
- connections?: Connections<CapacitorPinLabels>;
193
+ capacitance: number | string
194
+ maxVoltageRating?: number | string
195
+ schShowRatings?: boolean
196
+ polarized?: boolean
197
+ decouplingFor?: string
198
+ decouplingTo?: string
199
+ bypassFor?: string
200
+ bypassTo?: string
201
+ maxDecouplingTraceLength?: number
202
+ schOrientation?: SchematicOrientation
203
+ connections?: Connections<CapacitorPinLabels>
206
204
  }
207
205
  ```
208
206
 
209
207
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/capacitor.ts)
210
208
 
209
+
211
210
  ### ChipProps `<chip />`
212
211
 
213
212
  ```ts
214
213
  export interface ChipPropsSU<
215
214
  PinLabel extends SchematicPinLabel = SchematicPinLabel,
216
215
  > extends CommonComponentProps<PinLabel> {
217
- manufacturerPartNumber?: string;
218
- pinLabels?: PinLabelsProp<SchematicPinLabel, PinLabel>;
216
+ manufacturerPartNumber?: string
217
+ pinLabels?: PinLabelsProp<SchematicPinLabel, PinLabel>
219
218
  /**
220
219
  * Whether to show pin aliases in the schematic
221
220
  */
222
- showPinAliases?: boolean;
221
+ showPinAliases?: boolean
223
222
  /**
224
223
  * Labels for PCB pins
225
224
  */
226
- pcbPinLabels?: Record<string, string>;
227
- schPinArrangement?: SchematicPortArrangement;
225
+ pcbPinLabels?: Record<string, string>
226
+ schPinArrangement?: SchematicPortArrangement
228
227
  /** @deprecated Use schPinArrangement instead. */
229
- schPortArrangement?: SchematicPortArrangement;
230
- pinCompatibleVariants?: PinCompatibleVariant[];
231
- schPinStyle?: SchematicPinStyle;
232
- schPinSpacing?: Distance;
233
- schWidth?: Distance;
234
- schHeight?: Distance;
235
- noSchematicRepresentation?: boolean;
236
- internallyConnectedPins?: string[][];
237
- externallyConnectedPins?: string[][];
238
- connections?: Connections<PinLabel>;
228
+ schPortArrangement?: SchematicPortArrangement
229
+ pinCompatibleVariants?: PinCompatibleVariant[]
230
+ schPinStyle?: SchematicPinStyle
231
+ schPinSpacing?: Distance
232
+ schWidth?: Distance
233
+ schHeight?: Distance
234
+ noSchematicRepresentation?: boolean
235
+ internallyConnectedPins?: string[][]
236
+ externallyConnectedPins?: string[][]
237
+ connections?: Connections<PinLabel>
239
238
  }
240
239
  ```
241
240
 
242
241
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/chip.ts)
243
242
 
243
+
244
244
  ### ConnectorProps `<connector />`
245
245
 
246
246
  ```ts
247
247
  export interface ConnectorProps extends CommonComponentProps {
248
- manufacturerPartNumber?: string;
248
+ manufacturerPartNumber?: string
249
249
  pinLabels?: Record<
250
250
  number | SchematicPinLabel,
251
251
  SchematicPinLabel | SchematicPinLabel[]
252
- >;
253
- schPinStyle?: SchematicPinStyle;
254
- schPinSpacing?: number | string;
255
- schWidth?: number | string;
256
- schHeight?: number | string;
257
- schDirection?: "left" | "right";
258
- schPortArrangement?: SchematicPortArrangement;
252
+ >
253
+ schPinStyle?: SchematicPinStyle
254
+ schPinSpacing?: number | string
255
+ schWidth?: number | string
256
+ schHeight?: number | string
257
+ schDirection?: "left" | "right"
258
+ schPortArrangement?: SchematicPortArrangement
259
259
  /**
260
260
  * Groups of pins that are internally connected
261
261
  * e.g., [["1","2"], ["2","3"]]
262
262
  */
263
- internallyConnectedPins?: string[][];
263
+ internallyConnectedPins?: string[][]
264
264
  /**
265
265
  * Connector standard, e.g. usb_c, m2
266
266
  */
267
- standard?: "usb_c" | "m2";
267
+ standard?: "usb_c" | "m2"
268
268
  }
269
269
  ```
270
270
 
271
271
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/connector.ts)
272
272
 
273
+
273
274
  ### ConstrainedLayoutProps `<constrainedlayout />`
274
275
 
275
276
  ```ts
276
277
  export interface ConstrainedLayoutProps {
277
- name?: string;
278
- pcbOnly?: boolean;
279
- schOnly?: boolean;
278
+ name?: string
279
+ pcbOnly?: boolean
280
+ schOnly?: boolean
280
281
  }
281
282
  ```
282
283
 
283
284
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/constrainedlayout.ts)
284
285
 
286
+
285
287
  ### CrystalProps `<crystal />`
286
288
 
287
289
  ```ts
288
290
  export interface CrystalProps<PinLabel extends string = string>
289
291
  extends CommonComponentProps<PinLabel> {
290
- frequency: number | string;
291
- loadCapacitance: number | string;
292
- pinVariant?: PinVariant;
293
- schOrientation?: SchematicOrientation;
292
+ frequency: number | string
293
+ loadCapacitance: number | string
294
+ pinVariant?: PinVariant
295
+ schOrientation?: SchematicOrientation
294
296
  }
295
297
  ```
296
298
 
297
299
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/crystal.ts)
298
300
 
301
+
299
302
  ### RectCutoutProps `<cutout />`
300
303
 
301
304
  ```ts
302
305
  export interface RectCutoutProps
303
306
  extends Omit<PcbLayoutProps, "layer" | "pcbRotation"> {
304
- name?: string;
305
- shape: "rect";
306
- width: Distance;
307
- height: Distance;
307
+ name?: string
308
+ shape: "rect"
309
+ width: Distance
310
+ height: Distance
308
311
  }
309
312
  ```
310
313
 
311
314
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/cutout.ts)
312
315
 
316
+
313
317
  ### DiodeProps `<diode />`
314
318
 
315
319
  ```ts
316
320
  export interface DiodeProps<PinLabel extends string = string>
317
321
  extends CommonComponentProps<PinLabel> {
318
322
  connections?: {
319
- anode?: string | string[] | readonly string[];
320
- cathode?: string | string[] | readonly string[];
321
- pin1?: string | string[] | readonly string[];
322
- pin2?: string | string[] | readonly string[];
323
- pos?: string | string[] | readonly string[];
324
- neg?: string | string[] | readonly string[];
325
- };
326
- variant?: "standard" | "schottky" | "zener" | "avalanche" | "photo" | "tvs";
327
- standard?: boolean;
328
- schottky?: boolean;
329
- zener?: boolean;
330
- avalanche?: boolean;
331
- photo?: boolean;
332
- tvs?: boolean;
333
- schOrientation?: SchematicOrientation;
323
+ anode?: string | string[] | readonly string[]
324
+ cathode?: string | string[] | readonly string[]
325
+ pin1?: string | string[] | readonly string[]
326
+ pin2?: string | string[] | readonly string[]
327
+ pos?: string | string[] | readonly string[]
328
+ neg?: string | string[] | readonly string[]
329
+ }
330
+ variant?: "standard" | "schottky" | "zener" | "avalanche" | "photo" | "tvs"
331
+ standard?: boolean
332
+ schottky?: boolean
333
+ zener?: boolean
334
+ avalanche?: boolean
335
+ photo?: boolean
336
+ tvs?: boolean
337
+ schOrientation?: SchematicOrientation
334
338
  }
335
339
  ```
336
340
 
337
341
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/diode.ts)
338
342
 
343
+
339
344
  ### FootprintProps `<footprint />`
340
345
 
341
346
  ```ts
@@ -350,12 +355,13 @@ export interface FootprintProps {
350
355
  * confusion because you have a complex multi-layer footprint. Default is
351
356
  * "top" and this is most intuitive.
352
357
  */
353
- originalLayer?: LayerRef;
358
+ originalLayer?: LayerRef
354
359
  }
355
360
  ```
356
361
 
357
362
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/footprint.ts)
358
363
 
364
+
359
365
  ### FuseProps `<fuse />`
360
366
 
361
367
  ```ts
@@ -364,177 +370,186 @@ export interface FuseProps<PinLabel extends string = string>
364
370
  /**
365
371
  * Current rating of the fuse in amperes
366
372
  */
367
- currentRating: number | string;
373
+ currentRating: number | string
368
374
 
369
375
  /**
370
376
  * Voltage rating of the fuse
371
377
  */
372
- voltageRating?: number | string;
378
+ voltageRating?: number | string
373
379
 
374
380
  /**
375
381
  * Whether to show ratings on schematic
376
382
  */
377
- schShowRatings?: boolean;
383
+ schShowRatings?: boolean
378
384
 
379
- schOrientation?: SchematicOrientation;
385
+ schOrientation?: SchematicOrientation
380
386
 
381
387
  /**
382
388
  * Connections to other components
383
389
  */
384
- connections?: Connections<PinLabel>;
390
+ connections?: Connections<PinLabel>
385
391
  }
386
392
  ```
387
393
 
388
394
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/fuse.ts)
389
395
 
396
+
390
397
  ### BaseGroupProps
391
398
 
392
399
  ```ts
393
400
  export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {
394
- name?: string;
395
- key?: any;
396
- children?: any;
401
+ name?: string
402
+ key?: any
403
+ children?: any
397
404
 
398
405
  /**
399
406
  * Title to display above this group in the schematic view
400
407
  */
401
- schTitle?: string;
408
+ schTitle?: string
402
409
 
403
- pcbWidth?: Distance;
404
- pcbHeight?: Distance;
405
- schWidth?: Distance;
406
- schHeight?: Distance;
410
+ pcbWidth?: Distance
411
+ pcbHeight?: Distance
412
+ schWidth?: Distance
413
+ schHeight?: Distance
407
414
 
408
- pcbLayout?: LayoutConfig;
409
- schLayout?: LayoutConfig;
410
- cellBorder?: Border | null;
411
- border?: Border | null;
412
- schPadding?: Distance;
413
- schPaddingLeft?: Distance;
414
- schPaddingRight?: Distance;
415
- schPaddingTop?: Distance;
416
- schPaddingBottom?: Distance;
415
+ pcbLayout?: LayoutConfig
416
+ schLayout?: LayoutConfig
417
+ cellBorder?: Border | null
418
+ border?: Border | null
419
+ schPadding?: Distance
420
+ schPaddingLeft?: Distance
421
+ schPaddingRight?: Distance
422
+ schPaddingTop?: Distance
423
+ schPaddingBottom?: Distance
417
424
  }
418
425
  ```
419
426
 
420
427
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/group.ts)
421
428
 
429
+
422
430
  ### HoleProps `<hole />`
423
431
 
424
432
  ```ts
425
433
  export interface HoleProps extends Omit<PcbLayoutProps, "pcbRotation"> {
426
- name?: string;
427
- diameter?: Distance;
428
- radius?: Distance;
434
+ name?: string
435
+ diameter?: Distance
436
+ radius?: Distance
429
437
  }
430
438
  ```
431
439
 
432
440
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/hole.ts)
433
441
 
442
+
434
443
  ### InductorProps `<inductor />`
435
444
 
436
445
  ```ts
437
446
  export interface InductorProps<PinLabel extends string = string>
438
447
  extends CommonComponentProps<PinLabel> {
439
- inductance: number | string;
440
- maxCurrentRating?: number | string;
441
- schOrientation?: SchematicOrientation;
448
+ inductance: number | string
449
+ maxCurrentRating?: number | string
450
+ schOrientation?: SchematicOrientation
442
451
  }
443
452
  ```
444
453
 
445
454
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/inductor.ts)
446
455
 
456
+
447
457
  ### JumperProps `<jumper />`
448
458
 
449
459
  ```ts
450
460
  export interface JumperProps extends CommonComponentProps {
451
- manufacturerPartNumber?: string;
461
+ manufacturerPartNumber?: string
452
462
  pinLabels?: Record<
453
463
  number | SchematicPinLabel,
454
464
  SchematicPinLabel | SchematicPinLabel[]
455
- >;
456
- schPinStyle?: SchematicPinStyle;
457
- schPinSpacing?: number | string;
458
- schWidth?: number | string;
459
- schHeight?: number | string;
460
- schDirection?: "left" | "right";
461
- schPortArrangement?: SchematicPortArrangement;
465
+ >
466
+ schPinStyle?: SchematicPinStyle
467
+ schPinSpacing?: number | string
468
+ schWidth?: number | string
469
+ schHeight?: number | string
470
+ schDirection?: "left" | "right"
471
+ schPortArrangement?: SchematicPortArrangement
462
472
  /**
463
473
  * Labels for PCB pins
464
474
  */
465
- pcbPinLabels?: Record<string, string>;
475
+ pcbPinLabels?: Record<string, string>
466
476
  /**
467
477
  * Number of pins on the jumper (2 or 3)
468
478
  */
469
- pinCount?: 2 | 3;
479
+ pinCount?: 2 | 3
470
480
  /**
471
481
  * Groups of pins that are internally connected
472
482
  * e.g., [["1","2"], ["2","3"]]
473
483
  */
474
- internallyConnectedPins?: string[][];
484
+ internallyConnectedPins?: string[][]
475
485
  /**
476
486
  * Connections to other components
477
487
  */
478
- connections?: Connections<string>;
488
+ connections?: Connections<string>
479
489
  }
480
490
  ```
481
491
 
482
492
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/jumper.ts)
483
493
 
494
+
484
495
  ### MosfetProps `<mosfet />`
485
496
 
486
497
  ```ts
487
498
  export interface MosfetProps<PinLabel extends string = string>
488
499
  extends CommonComponentProps<PinLabel> {
489
- channelType: "n" | "p";
490
- mosfetMode: "enhancement" | "depletion";
500
+ channelType: "n" | "p"
501
+ mosfetMode: "enhancement" | "depletion"
491
502
  }
492
503
  ```
493
504
 
494
505
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/mosfet.ts)
495
506
 
507
+
496
508
  ### NetProps `<net />`
497
509
 
498
510
  ```ts
499
511
  export interface NetProps {
500
- name: string;
501
- connectsTo?: string | string[];
512
+ name: string
513
+ connectsTo?: string | string[]
502
514
  }
503
515
  ```
504
516
 
505
517
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/net.ts)
506
518
 
519
+
507
520
  ### NetAliasProps `<netalias />`
508
521
 
509
522
  ```ts
510
523
  export interface NetAliasProps {
511
- net?: string;
512
- connection?: string;
513
- schX?: number | string;
514
- schY?: number | string;
515
- schRotation?: number | string;
516
- anchorSide?: "left" | "top" | "right" | "bottom";
524
+ net?: string
525
+ connection?: string
526
+ schX?: number | string
527
+ schY?: number | string
528
+ schRotation?: number | string
529
+ anchorSide?: "left" | "top" | "right" | "bottom"
517
530
  }
518
531
  ```
519
532
 
520
533
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/netalias.ts)
521
534
 
535
+
522
536
  ### NetLabelProps `<netlabel />`
523
537
 
524
538
  ```ts
525
539
  export interface NetLabelProps {
526
- net?: string;
527
- connection?: string;
528
- connectsTo?: string | string[];
529
- schX?: number | string;
530
- schY?: number | string;
531
- schRotation?: number | string;
532
- anchorSide?: "left" | "top" | "right" | "bottom";
540
+ net?: string
541
+ connection?: string
542
+ connectsTo?: string | string[]
543
+ schX?: number | string
544
+ schY?: number | string
545
+ schRotation?: number | string
546
+ anchorSide?: "left" | "top" | "right" | "bottom"
533
547
  }
534
548
  ```
535
549
 
536
550
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/netlabel.ts)
537
551
 
552
+
538
553
  ### PinHeaderProps `<pinheader />`
539
554
 
540
555
  ```ts
@@ -542,206 +557,215 @@ export interface PinHeaderProps extends CommonComponentProps {
542
557
  /**
543
558
  * Number of pins in the header
544
559
  */
545
- pinCount: number;
560
+ pinCount: number
546
561
 
547
562
  /**
548
563
  * Distance between pins
549
564
  */
550
- pitch?: number | string;
565
+ pitch?: number | string
551
566
 
552
567
  /**
553
568
  * Schematic facing direction
554
569
  */
555
- schFacingDirection?: "up" | "down" | "left" | "right";
570
+ schFacingDirection?: "up" | "down" | "left" | "right"
556
571
 
557
572
  /**
558
573
  * Whether the header is male or female
559
574
  */
560
- gender?: "male" | "female";
575
+ gender?: "male" | "female"
561
576
 
562
577
  /**
563
578
  * Whether to show pin labels in silkscreen
564
579
  */
565
- showSilkscreenPinLabels?: boolean;
580
+ showSilkscreenPinLabels?: boolean
566
581
 
567
582
  /**
568
583
  * Labels for PCB pins
569
584
  */
570
- pcbPinLabels?: Record<string, string>;
585
+ pcbPinLabels?: Record<string, string>
571
586
 
572
587
  /**
573
588
  * Whether the header has two rows of pins
574
589
  */
575
- doubleRow?: boolean;
590
+ doubleRow?: boolean
576
591
 
577
592
  /**
578
593
  * Diameter of the through-hole for each pin
579
594
  */
580
- holeDiameter?: number | string;
595
+ holeDiameter?: number | string
581
596
 
582
597
  /**
583
598
  * Diameter of the plated area around each hole
584
599
  */
585
- platedDiameter?: number | string;
600
+ platedDiameter?: number | string
586
601
 
587
602
  /**
588
603
  * Labels for each pin
589
604
  */
590
- pinLabels?: SchematicPinLabel[];
605
+ pinLabels?: SchematicPinLabel[]
591
606
 
592
607
  /**
593
608
  * Connections to other components
594
609
  */
595
- connections?: Connections<string>;
610
+ connections?: Connections<string>
596
611
 
597
612
  /**
598
613
  * Direction the header is facing
599
614
  */
600
- facingDirection?: "left" | "right";
615
+ facingDirection?: "left" | "right"
601
616
 
602
617
  /**
603
618
  * Pin arrangement in schematic view
604
619
  */
605
- schPinArrangement?: SchematicPinArrangement;
620
+ schPinArrangement?: SchematicPinArrangement
606
621
 
607
622
  /**
608
623
  * Schematic pin style (margins, etc)
609
624
  */
610
- schPinStyle?: SchematicPinStyle;
625
+ schPinStyle?: SchematicPinStyle
611
626
 
612
627
  /**
613
628
  * Schematic pin spacing
614
629
  */
615
- schPinSpacing?: number | string;
630
+ schPinSpacing?: number | string
616
631
 
617
632
  /**
618
633
  * Schematic width
619
634
  */
620
- schWidth?: number | string;
635
+ schWidth?: number | string
621
636
 
622
637
  /**
623
638
  * Schematic height
624
639
  */
625
- schHeight?: number | string;
640
+ schHeight?: number | string
626
641
  }
627
642
  ```
628
643
 
629
644
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/pin-header.ts)
630
645
 
646
+
631
647
  ### CirclePlatedHoleProps `<platedhole />`
632
648
 
633
649
  ```ts
634
650
  export interface CirclePlatedHoleProps
635
651
  extends Omit<PcbLayoutProps, "pcbRotation" | "layer"> {
636
- name?: string;
637
- connectsTo?: string | string[];
638
- shape: "circle";
639
- holeDiameter: number | string;
640
- outerDiameter: number | string;
641
- portHints?: PortHints;
652
+ name?: string
653
+ connectsTo?: string | string[]
654
+ shape: "circle"
655
+ holeDiameter: number | string
656
+ outerDiameter: number | string
657
+ portHints?: PortHints
642
658
  }
643
659
  ```
644
660
 
645
661
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/platedhole.ts)
646
662
 
663
+
647
664
  ### PotentiometerProps `<potentiometer />`
648
665
 
649
666
  ```ts
650
667
  export interface PotentiometerProps extends CommonComponentProps {
651
- maxResistance: number | string;
652
- pinVariant?: PotentiometerPinVariant;
668
+ maxResistance: number | string
669
+ pinVariant?: PotentiometerPinVariant
653
670
  }
654
671
  ```
655
672
 
656
673
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/potentiometer.ts)
657
674
 
675
+
658
676
  ### ResistorProps `<resistor />`
659
677
 
660
678
  ```ts
661
679
  export interface ResistorProps<PinLabel extends string = string>
662
680
  extends CommonComponentProps<PinLabel> {
663
- resistance: number | string;
664
- pullupFor?: string;
665
- pullupTo?: string;
666
- pulldownFor?: string;
667
- pulldownTo?: string;
668
- schOrientation?: SchematicOrientation;
669
- connections?: Connections<ResistorPinLabels>;
681
+ resistance: number | string
682
+ pullupFor?: string
683
+ pullupTo?: string
684
+ pulldownFor?: string
685
+ pulldownTo?: string
686
+ schOrientation?: SchematicOrientation
687
+ connections?: Connections<ResistorPinLabels>
670
688
  }
671
689
  ```
672
690
 
673
691
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/resistor.ts)
674
692
 
693
+
675
694
  ### ResonatorProps `<resonator />`
676
695
 
677
696
  ```ts
678
697
  export interface ResonatorProps extends CommonComponentProps {
679
- frequency: number | string;
680
- loadCapacitance: number | string;
681
- pinVariant?: ResonatorPinVariant;
698
+ frequency: number | string
699
+ loadCapacitance: number | string
700
+ pinVariant?: ResonatorPinVariant
682
701
  }
683
702
  ```
684
703
 
685
704
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/resonator.ts)
686
705
 
706
+
687
707
  ### SchematicCellProps `<schematiccell />`
688
708
 
689
709
  ```ts
690
710
  export interface SchematicCellProps {
691
- children?: string;
692
- horizontalAlign?: "left" | "center" | "right";
693
- verticalAlign?: "top" | "middle" | "bottom";
694
- fontSize?: number | string;
695
- rowSpan?: number;
696
- colSpan?: number;
697
- width?: number | string;
698
- text?: string;
711
+ children?: string
712
+ horizontalAlign?: "left" | "center" | "right"
713
+ verticalAlign?: "top" | "middle" | "bottom"
714
+ fontSize?: number | string
715
+ rowSpan?: number
716
+ colSpan?: number
717
+ width?: number | string
718
+ text?: string
699
719
  }
700
720
  ```
701
721
 
702
722
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-cell.ts)
703
723
 
724
+
704
725
  ### SchematicRowProps `<schematicrow />`
705
726
 
706
727
  ```ts
707
728
  export interface SchematicRowProps {
708
- children?: any;
709
- height?: number | string;
729
+ children?: any
730
+ height?: number | string
710
731
  }
711
732
  ```
712
733
 
713
734
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-row.ts)
714
735
 
736
+
715
737
  ### SchematicTableProps `<schematictable />`
716
738
 
717
739
  ```ts
718
740
  export interface SchematicTableProps {
719
- schX?: number | string;
720
- schY?: number | string;
721
- children?: any;
722
- cellPadding?: number | string;
723
- borderWidth?: number | string;
724
- anchor?: z.infer<typeof ninePointAnchor>;
725
- fontSize?: number | string;
741
+ schX?: number | string
742
+ schY?: number | string
743
+ children?: any
744
+ cellPadding?: number | string
745
+ borderWidth?: number | string
746
+ anchor?: z.infer<typeof ninePointAnchor>
747
+ fontSize?: number | string
726
748
  }
727
749
  ```
728
750
 
729
751
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-table.ts)
730
752
 
753
+
731
754
  ### RectSmtPadProps `<smtpad />`
732
755
 
733
756
  ```ts
734
757
  export interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
735
- name?: string;
736
- shape: "rect";
737
- width: Distance;
738
- height: Distance;
739
- portHints?: PortHints;
758
+ name?: string
759
+ shape: "rect"
760
+ width: Distance
761
+ height: Distance
762
+ portHints?: PortHints
740
763
  }
741
764
  ```
742
765
 
743
766
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/smtpad.ts)
744
767
 
768
+
745
769
  ### SolderJumperProps `<solderjumper />`
746
770
 
747
771
  ```ts
@@ -749,63 +773,67 @@ export interface SolderJumperProps extends JumperProps {
749
773
  /**
750
774
  * Pins that are bridged with solder by default
751
775
  */
752
- bridgedPins?: string[][];
776
+ bridgedPins?: string[][]
753
777
  /**
754
778
  * If true, all pins are connected with cuttable traces
755
779
  */
756
- bridged?: boolean;
780
+ bridged?: boolean
757
781
  }
758
782
  ```
759
783
 
760
784
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/solderjumper.ts)
761
785
 
786
+
762
787
  ### RectSolderPasteProps `<solderpaste />`
763
788
 
764
789
  ```ts
765
790
  export interface RectSolderPasteProps
766
791
  extends Omit<PcbLayoutProps, "pcbRotation"> {
767
- shape: "rect";
768
- width: Distance;
769
- height: Distance;
792
+ shape: "rect"
793
+ width: Distance
794
+ height: Distance
770
795
  }
771
796
  ```
772
797
 
773
798
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/solderpaste.ts)
774
799
 
800
+
775
801
  ### StampboardProps `<stampboard />`
776
802
 
777
803
  ```ts
778
804
  export interface StampboardProps extends BoardProps {
779
- leftPinCount?: number;
780
- rightPinCount?: number;
781
- topPinCount?: number;
782
- bottomPinCount?: number;
783
- leftPins?: string[];
784
- rightPins?: string[];
785
- topPins?: string[];
786
- bottomPins?: string[];
787
- pinPitch?: number | string;
788
- innerHoles?: boolean;
805
+ leftPinCount?: number
806
+ rightPinCount?: number
807
+ topPinCount?: number
808
+ bottomPinCount?: number
809
+ leftPins?: string[]
810
+ rightPins?: string[]
811
+ topPins?: string[]
812
+ bottomPins?: string[]
813
+ pinPitch?: number | string
814
+ innerHoles?: boolean
789
815
  }
790
816
  ```
791
817
 
792
818
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/stampboard.ts)
793
819
 
820
+
794
821
  ### SwitchProps `<switch />`
795
822
 
796
823
  ```ts
797
824
  export interface SwitchProps extends CommonComponentProps {
798
- type?: "spst" | "spdt" | "dpst" | "dpdt";
799
- isNormallyClosed?: boolean;
800
- spdt?: boolean;
801
- spst?: boolean;
802
- dpst?: boolean;
803
- dpdt?: boolean;
825
+ type?: "spst" | "spdt" | "dpst" | "dpdt"
826
+ isNormallyClosed?: boolean
827
+ spdt?: boolean
828
+ spst?: boolean
829
+ dpst?: boolean
830
+ dpdt?: boolean
804
831
  }
805
832
  ```
806
833
 
807
834
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/switch.ts)
808
835
 
836
+
809
837
  ### TestpointProps `<testpoint />`
810
838
 
811
839
  ```ts
@@ -813,53 +841,56 @@ export interface TestpointProps extends CommonComponentProps {
813
841
  /**
814
842
  * The footprint variant of the testpoint either a surface pad or through-hole
815
843
  */
816
- footprintVariant?: "pad" | "through_hole";
844
+ footprintVariant?: "pad" | "through_hole"
817
845
  /**
818
846
  * The shape of the pad if using a pad variant
819
847
  */
820
- padShape?: "rect" | "circle";
848
+ padShape?: "rect" | "circle"
821
849
  /**
822
850
  * Diameter of the copper pad (applies to both SMD pads and plated holes)
823
851
  */
824
- padDiameter?: number | string;
852
+ padDiameter?: number | string
825
853
  /**
826
854
  * Diameter of the hole if using a through-hole testpoint
827
855
  */
828
- holeDiameter?: number | string;
856
+ holeDiameter?: number | string
829
857
  /**
830
858
  * Width of the pad when padShape is rect
831
859
  */
832
- width?: number | string;
860
+ width?: number | string
833
861
  /**
834
862
  * Height of the pad when padShape is rect
835
863
  */
836
- height?: number | string;
864
+ height?: number | string
837
865
  }
838
866
  ```
839
867
 
840
868
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/testpoint.ts)
841
869
 
870
+
842
871
  ### TransistorProps `<transistor />`
843
872
 
844
873
  ```ts
845
874
  export interface TransistorProps<PinLabel extends string = string>
846
875
  extends CommonComponentProps<PinLabel> {
847
- type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt";
876
+ type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt"
877
+ connections?: Connections<transistorPinsLabels>
848
878
  }
849
879
  ```
850
880
 
851
881
  [Source](https://github.com/tscircuit/props/blob/main/lib/components/transistor.ts)
852
882
 
883
+
853
884
  ### ViaProps `<via />`
854
885
 
855
886
  ```ts
856
887
  export interface ViaProps extends CommonLayoutProps {
857
- name?: string;
858
- fromLayer: LayerRefInput;
859
- toLayer: LayerRefInput;
860
- holeDiameter: number | string;
861
- outerDiameter: number | string;
862
- connectsTo?: string | string[];
888
+ name?: string
889
+ fromLayer: LayerRefInput
890
+ toLayer: LayerRefInput
891
+ holeDiameter: number | string
892
+ outerDiameter: number | string
893
+ connectsTo?: string | string[]
863
894
  }
864
895
  ```
865
896
 
@@ -868,32 +899,31 @@ export interface ViaProps extends CommonLayoutProps {
868
899
  <!-- INTERFACE_DEFINITIONS_END -->
869
900
 
870
901
  <!-- PLATFORM_CONFIG_START -->
871
-
872
902
  ## tscircuit Platform Configuration
873
903
 
874
904
  ### PlatformConfig
875
905
 
876
906
  ```ts
877
907
  export interface PlatformConfig {
878
- partsEngine?: PartsEngine;
908
+ partsEngine?: PartsEngine
879
909
 
880
- autorouter?: AutorouterProp;
910
+ autorouter?: AutorouterProp
881
911
 
882
912
  // TODO this follows a subset of the localStorage interface
883
- localCacheEngine?: any;
913
+ localCacheEngine?: any
884
914
 
885
- registryApiUrl?: string;
915
+ registryApiUrl?: string
886
916
 
887
- cloudAutorouterUrl?: string;
917
+ cloudAutorouterUrl?: string
888
918
 
889
- projectName?: string;
890
- version?: string;
891
- url?: string;
892
- printBoardInformationToSilkscreen?: boolean;
919
+ projectName?: string
920
+ version?: string
921
+ url?: string
922
+ printBoardInformationToSilkscreen?: boolean
893
923
 
894
- pcbDisabled?: boolean;
895
- schematicDisabled?: boolean;
896
- partsEngineDisabled?: boolean;
924
+ pcbDisabled?: boolean
925
+ schematicDisabled?: boolean
926
+ partsEngineDisabled?: boolean
897
927
 
898
928
  footprintLibraryMap?: Record<
899
929
  string,
@@ -901,13 +931,12 @@ export interface PlatformConfig {
901
931
  string,
902
932
  | any[]
903
933
  | ((path: string) => Promise<{
904
- footprintCircuitJson: any[];
934
+ footprintCircuitJson: any[]
905
935
  }>)
906
936
  >
907
- >;
937
+ >
908
938
  }
909
939
  ```
910
940
 
911
941
  [Source](https://github.com/tscircuit/props/blob/main/lib/platformConfig.ts)
912
-
913
942
  <!-- PLATFORM_CONFIG_END -->