@tscircuit/props 0.0.250 → 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 +300 -335
- package/package.json +2 -1
package/README.md
CHANGED
|
@@ -7,335 +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
|
-
| `<schematiccell />`
|
|
49
|
-
| `<schematicrow />`
|
|
50
|
-
| `<schematictable />`
|
|
51
|
-
| `<smtpad />`
|
|
52
|
-
| `<solderjumper />`
|
|
53
|
-
| `<solderpaste />`
|
|
54
|
-
| `<stampboard />`
|
|
55
|
-
| `<switch />`
|
|
56
|
-
| `<testpoint />`
|
|
57
|
-
| `<transistor />`
|
|
58
|
-
| `<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
|
|
225
|
-
schPinArrangement?: SchematicPortArrangement
|
|
221
|
+
showPinAliases?: boolean;
|
|
222
|
+
schPinArrangement?: SchematicPortArrangement;
|
|
226
223
|
/** @deprecated Use schPinArrangement instead. */
|
|
227
|
-
schPortArrangement?: SchematicPortArrangement
|
|
228
|
-
pinCompatibleVariants?: PinCompatibleVariant[]
|
|
229
|
-
schPinStyle?: SchematicPinStyle
|
|
230
|
-
schPinSpacing?: Distance
|
|
231
|
-
schWidth?: Distance
|
|
232
|
-
schHeight?: Distance
|
|
233
|
-
noSchematicRepresentation?: boolean
|
|
234
|
-
internallyConnectedPins?: string[][]
|
|
235
|
-
externallyConnectedPins?: string[][]
|
|
236
|
-
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>;
|
|
237
234
|
}
|
|
238
235
|
```
|
|
239
236
|
|
|
240
237
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/chip.ts)
|
|
241
238
|
|
|
242
|
-
|
|
243
239
|
### ConnectorProps `<connector />`
|
|
244
240
|
|
|
245
241
|
```ts
|
|
246
242
|
export interface ConnectorProps extends CommonComponentProps {
|
|
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
|
|
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;
|
|
255
251
|
/**
|
|
256
252
|
* Groups of pins that are internally connected
|
|
257
253
|
* e.g., [["1","2"], ["2","3"]]
|
|
258
254
|
*/
|
|
259
|
-
internallyConnectedPins?: string[][]
|
|
255
|
+
internallyConnectedPins?: string[][];
|
|
260
256
|
/**
|
|
261
257
|
* Connector standard, e.g. usb_c, m2
|
|
262
258
|
*/
|
|
263
|
-
standard?: "usb_c" | "m2"
|
|
259
|
+
standard?: "usb_c" | "m2";
|
|
264
260
|
}
|
|
265
261
|
```
|
|
266
262
|
|
|
267
263
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/connector.ts)
|
|
268
264
|
|
|
269
|
-
|
|
270
265
|
### ConstrainedLayoutProps `<constrainedlayout />`
|
|
271
266
|
|
|
272
267
|
```ts
|
|
273
268
|
export interface ConstrainedLayoutProps {
|
|
274
|
-
name?: string
|
|
275
|
-
pcbOnly?: boolean
|
|
276
|
-
schOnly?: boolean
|
|
269
|
+
name?: string;
|
|
270
|
+
pcbOnly?: boolean;
|
|
271
|
+
schOnly?: boolean;
|
|
277
272
|
}
|
|
278
273
|
```
|
|
279
274
|
|
|
280
275
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/constrainedlayout.ts)
|
|
281
276
|
|
|
282
|
-
|
|
283
277
|
### CrystalProps `<crystal />`
|
|
284
278
|
|
|
285
279
|
```ts
|
|
286
280
|
export interface CrystalProps<PinLabel extends string = string>
|
|
287
281
|
extends CommonComponentProps<PinLabel> {
|
|
288
|
-
frequency: number | string
|
|
289
|
-
loadCapacitance: number | string
|
|
290
|
-
pinVariant?: PinVariant
|
|
291
|
-
schOrientation?: SchematicOrientation
|
|
282
|
+
frequency: number | string;
|
|
283
|
+
loadCapacitance: number | string;
|
|
284
|
+
pinVariant?: PinVariant;
|
|
285
|
+
schOrientation?: SchematicOrientation;
|
|
292
286
|
}
|
|
293
287
|
```
|
|
294
288
|
|
|
295
289
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/crystal.ts)
|
|
296
290
|
|
|
297
|
-
|
|
298
291
|
### RectCutoutProps `<cutout />`
|
|
299
292
|
|
|
300
293
|
```ts
|
|
301
294
|
export interface RectCutoutProps
|
|
302
295
|
extends Omit<PcbLayoutProps, "layer" | "pcbRotation"> {
|
|
303
|
-
name?: string
|
|
304
|
-
shape: "rect"
|
|
305
|
-
width: Distance
|
|
306
|
-
height: Distance
|
|
296
|
+
name?: string;
|
|
297
|
+
shape: "rect";
|
|
298
|
+
width: Distance;
|
|
299
|
+
height: Distance;
|
|
307
300
|
}
|
|
308
301
|
```
|
|
309
302
|
|
|
310
303
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/cutout.ts)
|
|
311
304
|
|
|
312
|
-
|
|
313
305
|
### DiodeProps `<diode />`
|
|
314
306
|
|
|
315
307
|
```ts
|
|
316
308
|
export interface DiodeProps<PinLabel extends string = string>
|
|
317
309
|
extends CommonComponentProps<PinLabel> {
|
|
318
310
|
connections?: {
|
|
319
|
-
anode?: string | string[] | readonly string[]
|
|
320
|
-
cathode?: string | string[] | readonly string[]
|
|
321
|
-
pin1?: string | string[] | readonly string[]
|
|
322
|
-
pin2?: string | string[] | readonly string[]
|
|
323
|
-
pos?: string | string[] | readonly string[]
|
|
324
|
-
neg?: string | string[] | readonly string[]
|
|
325
|
-
}
|
|
326
|
-
variant?: "standard" | "schottky" | "zener" | "photo" | "tvs"
|
|
327
|
-
standard?: boolean
|
|
328
|
-
schottky?: boolean
|
|
329
|
-
zener?: boolean
|
|
330
|
-
photo?: boolean
|
|
331
|
-
tvs?: boolean
|
|
332
|
-
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;
|
|
333
325
|
}
|
|
334
326
|
```
|
|
335
327
|
|
|
336
328
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/diode.ts)
|
|
337
329
|
|
|
338
|
-
|
|
339
330
|
### FootprintProps `<footprint />`
|
|
340
331
|
|
|
341
332
|
```ts
|
|
@@ -350,13 +341,12 @@ export interface FootprintProps {
|
|
|
350
341
|
* confusion because you have a complex multi-layer footprint. Default is
|
|
351
342
|
* "top" and this is most intuitive.
|
|
352
343
|
*/
|
|
353
|
-
originalLayer?: LayerRef
|
|
344
|
+
originalLayer?: LayerRef;
|
|
354
345
|
}
|
|
355
346
|
```
|
|
356
347
|
|
|
357
348
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/footprint.ts)
|
|
358
349
|
|
|
359
|
-
|
|
360
350
|
### FuseProps `<fuse />`
|
|
361
351
|
|
|
362
352
|
```ts
|
|
@@ -365,179 +355,170 @@ export interface FuseProps<PinLabel extends string = string>
|
|
|
365
355
|
/**
|
|
366
356
|
* Current rating of the fuse in amperes
|
|
367
357
|
*/
|
|
368
|
-
currentRating: number | string
|
|
358
|
+
currentRating: number | string;
|
|
369
359
|
|
|
370
360
|
/**
|
|
371
361
|
* Voltage rating of the fuse
|
|
372
362
|
*/
|
|
373
|
-
voltageRating?: number | string
|
|
363
|
+
voltageRating?: number | string;
|
|
374
364
|
|
|
375
365
|
/**
|
|
376
366
|
* Whether to show ratings on schematic
|
|
377
367
|
*/
|
|
378
|
-
schShowRatings?: boolean
|
|
368
|
+
schShowRatings?: boolean;
|
|
379
369
|
|
|
380
|
-
schOrientation?: SchematicOrientation
|
|
370
|
+
schOrientation?: SchematicOrientation;
|
|
381
371
|
|
|
382
372
|
/**
|
|
383
373
|
* Connections to other components
|
|
384
374
|
*/
|
|
385
|
-
connections?: Connections<PinLabel
|
|
375
|
+
connections?: Connections<PinLabel>;
|
|
386
376
|
}
|
|
387
377
|
```
|
|
388
378
|
|
|
389
379
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/fuse.ts)
|
|
390
380
|
|
|
391
|
-
|
|
392
381
|
### BaseGroupProps
|
|
393
382
|
|
|
394
383
|
```ts
|
|
395
384
|
export interface BaseGroupProps extends CommonLayoutProps, LayoutConfig {
|
|
396
|
-
name?: string
|
|
397
|
-
key?: any
|
|
398
|
-
children?: any
|
|
385
|
+
name?: string;
|
|
386
|
+
key?: any;
|
|
387
|
+
children?: any;
|
|
399
388
|
|
|
400
389
|
/**
|
|
401
390
|
* Title to display above this group in the schematic view
|
|
402
391
|
*/
|
|
403
|
-
schTitle?: string
|
|
392
|
+
schTitle?: string;
|
|
404
393
|
|
|
405
|
-
pcbWidth?: Distance
|
|
406
|
-
pcbHeight?: Distance
|
|
407
|
-
schWidth?: Distance
|
|
408
|
-
schHeight?: Distance
|
|
394
|
+
pcbWidth?: Distance;
|
|
395
|
+
pcbHeight?: Distance;
|
|
396
|
+
schWidth?: Distance;
|
|
397
|
+
schHeight?: Distance;
|
|
409
398
|
|
|
410
|
-
pcbLayout?: LayoutConfig
|
|
411
|
-
schLayout?: LayoutConfig
|
|
412
|
-
cellBorder?: Border | null
|
|
413
|
-
border?: Border | null
|
|
414
|
-
schPadding?: Distance
|
|
415
|
-
schPaddingLeft?: Distance
|
|
416
|
-
schPaddingRight?: Distance
|
|
417
|
-
schPaddingTop?: Distance
|
|
418
|
-
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;
|
|
419
408
|
}
|
|
420
409
|
```
|
|
421
410
|
|
|
422
411
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/group.ts)
|
|
423
412
|
|
|
424
|
-
|
|
425
413
|
### HoleProps `<hole />`
|
|
426
414
|
|
|
427
415
|
```ts
|
|
428
416
|
export interface HoleProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
429
|
-
name?: string
|
|
430
|
-
diameter?: Distance
|
|
431
|
-
radius?: Distance
|
|
417
|
+
name?: string;
|
|
418
|
+
diameter?: Distance;
|
|
419
|
+
radius?: Distance;
|
|
432
420
|
}
|
|
433
421
|
```
|
|
434
422
|
|
|
435
423
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/hole.ts)
|
|
436
424
|
|
|
437
|
-
|
|
438
425
|
### InductorProps `<inductor />`
|
|
439
426
|
|
|
440
427
|
```ts
|
|
441
428
|
export interface InductorProps<PinLabel extends string = string>
|
|
442
429
|
extends CommonComponentProps<PinLabel> {
|
|
443
|
-
inductance: number | string
|
|
444
|
-
maxCurrentRating?: number | string
|
|
445
|
-
schOrientation?: SchematicOrientation
|
|
430
|
+
inductance: number | string;
|
|
431
|
+
maxCurrentRating?: number | string;
|
|
432
|
+
schOrientation?: SchematicOrientation;
|
|
446
433
|
}
|
|
447
434
|
```
|
|
448
435
|
|
|
449
436
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/inductor.ts)
|
|
450
437
|
|
|
451
|
-
|
|
452
438
|
### JumperProps `<jumper />`
|
|
453
439
|
|
|
454
440
|
```ts
|
|
455
441
|
export interface JumperProps extends CommonComponentProps {
|
|
456
|
-
manufacturerPartNumber?: string
|
|
457
|
-
pinLabels?: Record<number | string, string | string[]
|
|
458
|
-
schPinStyle?: SchematicPinStyle
|
|
459
|
-
schPinSpacing?: number | string
|
|
460
|
-
schWidth?: number | string
|
|
461
|
-
schHeight?: number | string
|
|
462
|
-
schDirection?: "left" | "right"
|
|
463
|
-
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;
|
|
464
450
|
/**
|
|
465
451
|
* Number of pins on the jumper (2 or 3)
|
|
466
452
|
*/
|
|
467
|
-
pinCount?: 2 | 3
|
|
453
|
+
pinCount?: 2 | 3;
|
|
468
454
|
/**
|
|
469
455
|
* Groups of pins that are internally connected
|
|
470
456
|
* e.g., [["1","2"], ["2","3"]]
|
|
471
457
|
*/
|
|
472
|
-
internallyConnectedPins?: string[][]
|
|
458
|
+
internallyConnectedPins?: string[][];
|
|
473
459
|
/**
|
|
474
460
|
* Connections to other components
|
|
475
461
|
*/
|
|
476
|
-
connections?: Connections<string
|
|
462
|
+
connections?: Connections<string>;
|
|
477
463
|
}
|
|
478
464
|
```
|
|
479
465
|
|
|
480
466
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/jumper.ts)
|
|
481
467
|
|
|
482
|
-
|
|
483
468
|
### MosfetProps `<mosfet />`
|
|
484
469
|
|
|
485
470
|
```ts
|
|
486
471
|
export interface MosfetProps<PinLabel extends string = string>
|
|
487
472
|
extends CommonComponentProps<PinLabel> {
|
|
488
|
-
channelType: "n" | "p"
|
|
489
|
-
mosfetMode: "enhancement" | "depletion"
|
|
473
|
+
channelType: "n" | "p";
|
|
474
|
+
mosfetMode: "enhancement" | "depletion";
|
|
490
475
|
}
|
|
491
476
|
```
|
|
492
477
|
|
|
493
478
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/mosfet.ts)
|
|
494
479
|
|
|
495
|
-
|
|
496
480
|
### NetProps `<net />`
|
|
497
481
|
|
|
498
482
|
```ts
|
|
499
483
|
export interface NetProps {
|
|
500
|
-
name: string
|
|
501
|
-
connectsTo?: string | string[]
|
|
484
|
+
name: string;
|
|
485
|
+
connectsTo?: string | string[];
|
|
502
486
|
}
|
|
503
487
|
```
|
|
504
488
|
|
|
505
489
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/net.ts)
|
|
506
490
|
|
|
507
|
-
|
|
508
491
|
### NetAliasProps `<netalias />`
|
|
509
492
|
|
|
510
493
|
```ts
|
|
511
494
|
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"
|
|
495
|
+
net?: string;
|
|
496
|
+
connection?: string;
|
|
497
|
+
schX?: number | string;
|
|
498
|
+
schY?: number | string;
|
|
499
|
+
schRotation?: number | string;
|
|
500
|
+
anchorSide?: "left" | "top" | "right" | "bottom";
|
|
518
501
|
}
|
|
519
502
|
```
|
|
520
503
|
|
|
521
504
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/netalias.ts)
|
|
522
505
|
|
|
523
|
-
|
|
524
506
|
### NetLabelProps `<netlabel />`
|
|
525
507
|
|
|
526
508
|
```ts
|
|
527
509
|
export interface NetLabelProps {
|
|
528
|
-
net?: string
|
|
529
|
-
connection?: string
|
|
530
|
-
connectsTo?: string | string[]
|
|
531
|
-
schX?: number | string
|
|
532
|
-
schY?: number | string
|
|
533
|
-
schRotation?: number | string
|
|
534
|
-
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";
|
|
535
517
|
}
|
|
536
518
|
```
|
|
537
519
|
|
|
538
520
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/netlabel.ts)
|
|
539
521
|
|
|
540
|
-
|
|
541
522
|
### PinHeaderProps `<pinheader />`
|
|
542
523
|
|
|
543
524
|
```ts
|
|
@@ -545,208 +526,197 @@ export interface PinHeaderProps extends CommonComponentProps {
|
|
|
545
526
|
/**
|
|
546
527
|
* Number of pins in the header
|
|
547
528
|
*/
|
|
548
|
-
pinCount: number
|
|
529
|
+
pinCount: number;
|
|
549
530
|
|
|
550
531
|
/**
|
|
551
532
|
* Distance between pins
|
|
552
533
|
*/
|
|
553
|
-
pitch?: number | string
|
|
534
|
+
pitch?: number | string;
|
|
554
535
|
|
|
555
536
|
/**
|
|
556
537
|
* Schematic facing direction
|
|
557
538
|
*/
|
|
558
|
-
schFacingDirection?: "up" | "down" | "left" | "right"
|
|
539
|
+
schFacingDirection?: "up" | "down" | "left" | "right";
|
|
559
540
|
|
|
560
541
|
/**
|
|
561
542
|
* Whether the header is male or female
|
|
562
543
|
*/
|
|
563
|
-
gender?: "male" | "female"
|
|
544
|
+
gender?: "male" | "female";
|
|
564
545
|
|
|
565
546
|
/**
|
|
566
547
|
* Whether to show pin labels in silkscreen
|
|
567
548
|
*/
|
|
568
|
-
showSilkscreenPinLabels?: boolean
|
|
549
|
+
showSilkscreenPinLabels?: boolean;
|
|
569
550
|
|
|
570
551
|
/**
|
|
571
552
|
* Whether the header has two rows of pins
|
|
572
553
|
*/
|
|
573
|
-
doubleRow?: boolean
|
|
554
|
+
doubleRow?: boolean;
|
|
574
555
|
|
|
575
556
|
/**
|
|
576
557
|
* Diameter of the through-hole for each pin
|
|
577
558
|
*/
|
|
578
|
-
holeDiameter?: number | string
|
|
559
|
+
holeDiameter?: number | string;
|
|
579
560
|
|
|
580
561
|
/**
|
|
581
562
|
* Diameter of the plated area around each hole
|
|
582
563
|
*/
|
|
583
|
-
platedDiameter?: number | string
|
|
564
|
+
platedDiameter?: number | string;
|
|
584
565
|
|
|
585
566
|
/**
|
|
586
567
|
* Labels for each pin
|
|
587
568
|
*/
|
|
588
|
-
pinLabels?: string[]
|
|
569
|
+
pinLabels?: string[];
|
|
589
570
|
|
|
590
571
|
/**
|
|
591
572
|
* Connections to other components
|
|
592
573
|
*/
|
|
593
|
-
connections?: Connections<string
|
|
574
|
+
connections?: Connections<string>;
|
|
594
575
|
|
|
595
576
|
/**
|
|
596
577
|
* Direction the header is facing
|
|
597
578
|
*/
|
|
598
|
-
facingDirection?: "left" | "right"
|
|
579
|
+
facingDirection?: "left" | "right";
|
|
599
580
|
|
|
600
581
|
/**
|
|
601
582
|
* Pin arrangement in schematic view
|
|
602
583
|
*/
|
|
603
|
-
schPinArrangement?: SchematicPinArrangement
|
|
584
|
+
schPinArrangement?: SchematicPinArrangement;
|
|
604
585
|
|
|
605
586
|
/**
|
|
606
587
|
* Schematic pin style (margins, etc)
|
|
607
588
|
*/
|
|
608
|
-
schPinStyle?: SchematicPinStyle
|
|
589
|
+
schPinStyle?: SchematicPinStyle;
|
|
609
590
|
|
|
610
591
|
/**
|
|
611
592
|
* Schematic pin spacing
|
|
612
593
|
*/
|
|
613
|
-
schPinSpacing?: number | string
|
|
594
|
+
schPinSpacing?: number | string;
|
|
614
595
|
|
|
615
596
|
/**
|
|
616
597
|
* Schematic width
|
|
617
598
|
*/
|
|
618
|
-
schWidth?: number | string
|
|
599
|
+
schWidth?: number | string;
|
|
619
600
|
|
|
620
601
|
/**
|
|
621
602
|
* Schematic height
|
|
622
603
|
*/
|
|
623
|
-
schHeight?: number | string
|
|
604
|
+
schHeight?: number | string;
|
|
624
605
|
}
|
|
625
606
|
```
|
|
626
607
|
|
|
627
608
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/pin-header.ts)
|
|
628
609
|
|
|
629
|
-
|
|
630
610
|
### CirclePlatedHoleProps `<platedhole />`
|
|
631
611
|
|
|
632
612
|
```ts
|
|
633
613
|
export interface CirclePlatedHoleProps
|
|
634
614
|
extends Omit<PcbLayoutProps, "pcbRotation" | "layer"> {
|
|
635
|
-
name?: string
|
|
636
|
-
connectsTo?: string | string[]
|
|
637
|
-
shape: "circle"
|
|
638
|
-
holeDiameter: number | string
|
|
639
|
-
outerDiameter: number | string
|
|
640
|
-
portHints?: PortHints
|
|
615
|
+
name?: string;
|
|
616
|
+
connectsTo?: string | string[];
|
|
617
|
+
shape: "circle";
|
|
618
|
+
holeDiameter: number | string;
|
|
619
|
+
outerDiameter: number | string;
|
|
620
|
+
portHints?: PortHints;
|
|
641
621
|
}
|
|
642
622
|
```
|
|
643
623
|
|
|
644
624
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/platedhole.ts)
|
|
645
625
|
|
|
646
|
-
|
|
647
626
|
### PotentiometerProps `<potentiometer />`
|
|
648
627
|
|
|
649
628
|
```ts
|
|
650
629
|
export interface PotentiometerProps extends CommonComponentProps {
|
|
651
|
-
maxResistance: number | string
|
|
652
|
-
pinVariant?: PotentiometerPinVariant
|
|
630
|
+
maxResistance: number | string;
|
|
631
|
+
pinVariant?: PotentiometerPinVariant;
|
|
653
632
|
}
|
|
654
633
|
```
|
|
655
634
|
|
|
656
635
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/potentiometer.ts)
|
|
657
636
|
|
|
658
|
-
|
|
659
637
|
### ResistorProps `<resistor />`
|
|
660
638
|
|
|
661
639
|
```ts
|
|
662
640
|
export interface ResistorProps<PinLabel extends string = string>
|
|
663
641
|
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
|
|
642
|
+
resistance: number | string;
|
|
643
|
+
pullupFor?: string;
|
|
644
|
+
pullupTo?: string;
|
|
645
|
+
pulldownFor?: string;
|
|
646
|
+
pulldownTo?: string;
|
|
647
|
+
schOrientation?: SchematicOrientation;
|
|
648
|
+
connections?: Connections<ResistorPinLabels>;
|
|
671
649
|
}
|
|
672
650
|
```
|
|
673
651
|
|
|
674
652
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/resistor.ts)
|
|
675
653
|
|
|
676
|
-
|
|
677
654
|
### ResonatorProps `<resonator />`
|
|
678
655
|
|
|
679
656
|
```ts
|
|
680
657
|
export interface ResonatorProps extends CommonComponentProps {
|
|
681
|
-
frequency: number | string
|
|
682
|
-
loadCapacitance: number | string
|
|
683
|
-
pinVariant?: ResonatorPinVariant
|
|
658
|
+
frequency: number | string;
|
|
659
|
+
loadCapacitance: number | string;
|
|
660
|
+
pinVariant?: ResonatorPinVariant;
|
|
684
661
|
}
|
|
685
662
|
```
|
|
686
663
|
|
|
687
664
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/resonator.ts)
|
|
688
665
|
|
|
689
|
-
|
|
690
666
|
### SchematicCellProps `<schematiccell />`
|
|
691
667
|
|
|
692
668
|
```ts
|
|
693
669
|
export interface SchematicCellProps {
|
|
694
|
-
children: string
|
|
695
|
-
horizontalAlign?: "left" | "center" | "right"
|
|
696
|
-
verticalAlign?: "top" | "middle" | "bottom"
|
|
697
|
-
fontSize?: number | string
|
|
670
|
+
children: string;
|
|
671
|
+
horizontalAlign?: "left" | "center" | "right";
|
|
672
|
+
verticalAlign?: "top" | "middle" | "bottom";
|
|
673
|
+
fontSize?: number | string;
|
|
698
674
|
}
|
|
699
675
|
```
|
|
700
676
|
|
|
701
677
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-cell.ts)
|
|
702
678
|
|
|
703
|
-
|
|
704
679
|
### SchematicRowProps `<schematicrow />`
|
|
705
680
|
|
|
706
681
|
```ts
|
|
707
682
|
export interface SchematicRowProps {
|
|
708
|
-
children?: any
|
|
709
|
-
height?: number | string
|
|
683
|
+
children?: any;
|
|
684
|
+
height?: number | string;
|
|
710
685
|
}
|
|
711
686
|
```
|
|
712
687
|
|
|
713
688
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-row.ts)
|
|
714
689
|
|
|
715
|
-
|
|
716
690
|
### SchematicTableProps `<schematictable />`
|
|
717
691
|
|
|
718
692
|
```ts
|
|
719
693
|
export interface SchematicTableProps {
|
|
720
|
-
schX?: number | string
|
|
721
|
-
schY?: number | string
|
|
722
|
-
children?: any
|
|
723
|
-
|
|
724
|
-
|
|
725
|
-
|
|
726
|
-
|
|
727
|
-
anchor?: z.infer<typeof ninePointAnchor>
|
|
728
|
-
fontSize?: number | string
|
|
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;
|
|
729
701
|
}
|
|
730
702
|
```
|
|
731
703
|
|
|
732
704
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/schematic-table.ts)
|
|
733
705
|
|
|
734
|
-
|
|
735
706
|
### RectSmtPadProps `<smtpad />`
|
|
736
707
|
|
|
737
708
|
```ts
|
|
738
709
|
export interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
739
|
-
name?: string
|
|
740
|
-
shape: "rect"
|
|
741
|
-
width: Distance
|
|
742
|
-
height: Distance
|
|
743
|
-
portHints?: PortHints
|
|
710
|
+
name?: string;
|
|
711
|
+
shape: "rect";
|
|
712
|
+
width: Distance;
|
|
713
|
+
height: Distance;
|
|
714
|
+
portHints?: PortHints;
|
|
744
715
|
}
|
|
745
716
|
```
|
|
746
717
|
|
|
747
718
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/smtpad.ts)
|
|
748
719
|
|
|
749
|
-
|
|
750
720
|
### SolderJumperProps `<solderjumper />`
|
|
751
721
|
|
|
752
722
|
```ts
|
|
@@ -754,67 +724,63 @@ export interface SolderJumperProps extends JumperProps {
|
|
|
754
724
|
/**
|
|
755
725
|
* Pins that are bridged with solder by default
|
|
756
726
|
*/
|
|
757
|
-
bridgedPins?: string[][]
|
|
727
|
+
bridgedPins?: string[][];
|
|
758
728
|
/**
|
|
759
729
|
* If true, all pins are connected with cuttable traces
|
|
760
730
|
*/
|
|
761
|
-
bridged?: boolean
|
|
731
|
+
bridged?: boolean;
|
|
762
732
|
}
|
|
763
733
|
```
|
|
764
734
|
|
|
765
735
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/solderjumper.ts)
|
|
766
736
|
|
|
767
|
-
|
|
768
737
|
### RectSolderPasteProps `<solderpaste />`
|
|
769
738
|
|
|
770
739
|
```ts
|
|
771
740
|
export interface RectSolderPasteProps
|
|
772
741
|
extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
773
|
-
shape: "rect"
|
|
774
|
-
width: Distance
|
|
775
|
-
height: Distance
|
|
742
|
+
shape: "rect";
|
|
743
|
+
width: Distance;
|
|
744
|
+
height: Distance;
|
|
776
745
|
}
|
|
777
746
|
```
|
|
778
747
|
|
|
779
748
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/solderpaste.ts)
|
|
780
749
|
|
|
781
|
-
|
|
782
750
|
### StampboardProps `<stampboard />`
|
|
783
751
|
|
|
784
752
|
```ts
|
|
785
753
|
export interface StampboardProps extends BoardProps {
|
|
786
|
-
leftPinCount?: number
|
|
787
|
-
rightPinCount?: number
|
|
788
|
-
topPinCount?: number
|
|
789
|
-
bottomPinCount?: number
|
|
790
|
-
leftPins?: string[]
|
|
791
|
-
rightPins?: string[]
|
|
792
|
-
topPins?: string[]
|
|
793
|
-
bottomPins?: string[]
|
|
794
|
-
pinPitch?: number | string
|
|
795
|
-
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;
|
|
796
764
|
}
|
|
797
765
|
```
|
|
798
766
|
|
|
799
767
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/stampboard.ts)
|
|
800
768
|
|
|
801
|
-
|
|
802
769
|
### SwitchProps `<switch />`
|
|
803
770
|
|
|
804
771
|
```ts
|
|
805
772
|
export interface SwitchProps extends CommonComponentProps {
|
|
806
|
-
type?: "spst" | "spdt" | "dpst" | "dpdt"
|
|
807
|
-
isNormallyClosed?: boolean
|
|
808
|
-
spdt?: boolean
|
|
809
|
-
spst?: boolean
|
|
810
|
-
dpst?: boolean
|
|
811
|
-
dpdt?: boolean
|
|
773
|
+
type?: "spst" | "spdt" | "dpst" | "dpdt";
|
|
774
|
+
isNormallyClosed?: boolean;
|
|
775
|
+
spdt?: boolean;
|
|
776
|
+
spst?: boolean;
|
|
777
|
+
dpst?: boolean;
|
|
778
|
+
dpdt?: boolean;
|
|
812
779
|
}
|
|
813
780
|
```
|
|
814
781
|
|
|
815
782
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/switch.ts)
|
|
816
783
|
|
|
817
|
-
|
|
818
784
|
### TestpointProps `<testpoint />`
|
|
819
785
|
|
|
820
786
|
```ts
|
|
@@ -822,55 +788,53 @@ export interface TestpointProps extends CommonComponentProps {
|
|
|
822
788
|
/**
|
|
823
789
|
* The footprint variant of the testpoint either a surface pad or through-hole
|
|
824
790
|
*/
|
|
825
|
-
footprintVariant?: "pad" | "through_hole"
|
|
791
|
+
footprintVariant?: "pad" | "through_hole";
|
|
826
792
|
/**
|
|
827
793
|
* The shape of the pad if using a pad variant
|
|
828
794
|
*/
|
|
829
|
-
padShape?: "rect" | "circle"
|
|
795
|
+
padShape?: "rect" | "circle";
|
|
830
796
|
/**
|
|
831
797
|
* Diameter of the copper pad (applies to both SMD pads and plated holes)
|
|
832
798
|
*/
|
|
833
|
-
padDiameter?: number | string
|
|
799
|
+
padDiameter?: number | string;
|
|
834
800
|
/**
|
|
835
801
|
* Diameter of the hole if using a through-hole testpoint
|
|
836
802
|
*/
|
|
837
|
-
holeDiameter?: number | string
|
|
803
|
+
holeDiameter?: number | string;
|
|
838
804
|
/**
|
|
839
805
|
* Width of the pad when padShape is rect
|
|
840
806
|
*/
|
|
841
|
-
width?: number | string
|
|
807
|
+
width?: number | string;
|
|
842
808
|
/**
|
|
843
809
|
* Height of the pad when padShape is rect
|
|
844
810
|
*/
|
|
845
|
-
height?: number | string
|
|
811
|
+
height?: number | string;
|
|
846
812
|
}
|
|
847
813
|
```
|
|
848
814
|
|
|
849
815
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/testpoint.ts)
|
|
850
816
|
|
|
851
|
-
|
|
852
817
|
### TransistorProps `<transistor />`
|
|
853
818
|
|
|
854
819
|
```ts
|
|
855
820
|
export interface TransistorProps<PinLabel extends string = string>
|
|
856
821
|
extends CommonComponentProps<PinLabel> {
|
|
857
|
-
type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt"
|
|
822
|
+
type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt";
|
|
858
823
|
}
|
|
859
824
|
```
|
|
860
825
|
|
|
861
826
|
[Source](https://github.com/tscircuit/props/blob/main/lib/components/transistor.ts)
|
|
862
827
|
|
|
863
|
-
|
|
864
828
|
### ViaProps `<via />`
|
|
865
829
|
|
|
866
830
|
```ts
|
|
867
831
|
export interface ViaProps extends CommonLayoutProps {
|
|
868
|
-
name?: string
|
|
869
|
-
fromLayer: LayerRefInput
|
|
870
|
-
toLayer: LayerRefInput
|
|
871
|
-
holeDiameter: number | string
|
|
872
|
-
outerDiameter: number | string
|
|
873
|
-
connectsTo?: string | string[]
|
|
832
|
+
name?: string;
|
|
833
|
+
fromLayer: LayerRefInput;
|
|
834
|
+
toLayer: LayerRefInput;
|
|
835
|
+
holeDiameter: number | string;
|
|
836
|
+
outerDiameter: number | string;
|
|
837
|
+
connectsTo?: string | string[];
|
|
874
838
|
}
|
|
875
839
|
```
|
|
876
840
|
|
|
@@ -878,33 +842,33 @@ export interface ViaProps extends CommonLayoutProps {
|
|
|
878
842
|
|
|
879
843
|
<!-- INTERFACE_DEFINITIONS_END -->
|
|
880
844
|
|
|
881
|
-
|
|
882
845
|
<!-- PLATFORM_CONFIG_START -->
|
|
846
|
+
|
|
883
847
|
## tscircuit Platform Configuration
|
|
884
848
|
|
|
885
849
|
### PlatformConfig
|
|
886
850
|
|
|
887
851
|
```ts
|
|
888
852
|
export interface PlatformConfig {
|
|
889
|
-
partsEngine?: PartsEngine
|
|
853
|
+
partsEngine?: PartsEngine;
|
|
890
854
|
|
|
891
|
-
autorouter?: AutorouterProp
|
|
855
|
+
autorouter?: AutorouterProp;
|
|
892
856
|
|
|
893
857
|
// TODO this follows a subset of the localStorage interface
|
|
894
|
-
localCacheEngine?: any
|
|
858
|
+
localCacheEngine?: any;
|
|
895
859
|
|
|
896
|
-
registryApiUrl?: string
|
|
860
|
+
registryApiUrl?: string;
|
|
897
861
|
|
|
898
|
-
cloudAutorouterUrl?: string
|
|
862
|
+
cloudAutorouterUrl?: string;
|
|
899
863
|
|
|
900
|
-
projectName?: string
|
|
901
|
-
version?: string
|
|
902
|
-
url?: string
|
|
903
|
-
printBoardInformationToSilkscreen?: boolean
|
|
864
|
+
projectName?: string;
|
|
865
|
+
version?: string;
|
|
866
|
+
url?: string;
|
|
867
|
+
printBoardInformationToSilkscreen?: boolean;
|
|
904
868
|
|
|
905
|
-
pcbDisabled?: boolean
|
|
906
|
-
schematicDisabled?: boolean
|
|
907
|
-
partsEngineDisabled?: boolean
|
|
869
|
+
pcbDisabled?: boolean;
|
|
870
|
+
schematicDisabled?: boolean;
|
|
871
|
+
partsEngineDisabled?: boolean;
|
|
908
872
|
|
|
909
873
|
footprintLibraryMap?: Record<
|
|
910
874
|
string,
|
|
@@ -912,12 +876,13 @@ export interface PlatformConfig {
|
|
|
912
876
|
string,
|
|
913
877
|
| any[]
|
|
914
878
|
| ((path: string) => Promise<{
|
|
915
|
-
footprintCircuitJson: any[]
|
|
879
|
+
footprintCircuitJson: any[];
|
|
916
880
|
}>)
|
|
917
881
|
>
|
|
918
|
-
|
|
882
|
+
>;
|
|
919
883
|
}
|
|
920
884
|
```
|
|
921
885
|
|
|
922
886
|
[Source](https://github.com/tscircuit/props/blob/main/lib/platformConfig.ts)
|
|
887
|
+
|
|
923
888
|
<!-- PLATFORM_CONFIG_END -->
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/props",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.251",
|
|
4
4
|
"description": "Props for tscircuit builtin component types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -35,6 +35,7 @@
|
|
|
35
35
|
"expect-type": "^0.20.0",
|
|
36
36
|
"glob": "^11.0.0",
|
|
37
37
|
"madge": "^8.0.0",
|
|
38
|
+
"prettier": "^3.3.3",
|
|
38
39
|
"react": "^18.3.1",
|
|
39
40
|
"ts-expect": "^1.3.0",
|
|
40
41
|
"tsup": "^8.0.2",
|