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