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