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