@tscircuit/props 0.0.480 → 0.0.482
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/dist/index.d.ts +815 -1328
- package/dist/index.js +36 -8
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +73 -16
- package/package.json +1 -1
package/lib/common/layout.ts
CHANGED
|
@@ -49,6 +49,7 @@ export interface PcbLayoutProps {
|
|
|
49
49
|
pcbRotation?: string | number
|
|
50
50
|
pcbPositionAnchor?: string
|
|
51
51
|
pcbPositionMode?: PcbPositionMode
|
|
52
|
+
shouldBeOnEdgeOfBoard?: boolean
|
|
52
53
|
layer?: LayerRefInput
|
|
53
54
|
pcbMarginTop?: string | number
|
|
54
55
|
pcbMarginRight?: string | number
|
|
@@ -84,6 +85,7 @@ export interface CommonLayoutProps {
|
|
|
84
85
|
pcbRotation?: string | number
|
|
85
86
|
pcbPositionAnchor?: string
|
|
86
87
|
pcbPositionMode?: PcbPositionMode
|
|
88
|
+
shouldBeOnEdgeOfBoard?: boolean
|
|
87
89
|
|
|
88
90
|
pcbMarginTop?: string | number
|
|
89
91
|
pcbMarginRight?: string | number
|
|
@@ -145,6 +147,7 @@ export const pcbLayoutProps = z.object({
|
|
|
145
147
|
"relative_to_component_anchor",
|
|
146
148
|
])
|
|
147
149
|
.optional(),
|
|
150
|
+
shouldBeOnEdgeOfBoard: z.boolean().optional(),
|
|
148
151
|
layer: layer_ref.optional(),
|
|
149
152
|
pcbMarginTop: distance.optional(),
|
|
150
153
|
pcbMarginRight: distance.optional(),
|
|
@@ -179,6 +182,7 @@ export const commonLayoutProps = z.object({
|
|
|
179
182
|
"relative_to_component_anchor",
|
|
180
183
|
])
|
|
181
184
|
.optional(),
|
|
185
|
+
shouldBeOnEdgeOfBoard: z.boolean().optional(),
|
|
182
186
|
pcbMarginTop: distance.optional(),
|
|
183
187
|
pcbMarginRight: distance.optional(),
|
|
184
188
|
pcbMarginBottom: distance.optional(),
|
|
@@ -226,6 +230,35 @@ export const supplierProps = z.object({
|
|
|
226
230
|
expectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)
|
|
227
231
|
|
|
228
232
|
export interface PinAttributeMap {
|
|
233
|
+
capabilities?: Array<
|
|
234
|
+
| "i2c_sda"
|
|
235
|
+
| "i2c_scl"
|
|
236
|
+
| "spi_cs"
|
|
237
|
+
| "spi_sck"
|
|
238
|
+
| "spi_mosi"
|
|
239
|
+
| "spi_miso"
|
|
240
|
+
| "uart_tx"
|
|
241
|
+
| "uart_rx"
|
|
242
|
+
>
|
|
243
|
+
activeCapabilities?: Array<
|
|
244
|
+
| "i2c_sda"
|
|
245
|
+
| "i2c_scl"
|
|
246
|
+
| "spi_cs"
|
|
247
|
+
| "spi_sck"
|
|
248
|
+
| "spi_mosi"
|
|
249
|
+
| "spi_miso"
|
|
250
|
+
| "uart_tx"
|
|
251
|
+
| "uart_rx"
|
|
252
|
+
>
|
|
253
|
+
activeCapability?:
|
|
254
|
+
| "i2c_sda"
|
|
255
|
+
| "i2c_scl"
|
|
256
|
+
| "spi_cs"
|
|
257
|
+
| "spi_sck"
|
|
258
|
+
| "spi_mosi"
|
|
259
|
+
| "spi_miso"
|
|
260
|
+
| "uart_tx"
|
|
261
|
+
| "uart_rx"
|
|
229
262
|
providesPower?: boolean
|
|
230
263
|
requiresPower?: boolean
|
|
231
264
|
providesGround?: boolean
|
|
@@ -236,14 +269,6 @@ export interface PinAttributeMap {
|
|
|
236
269
|
includeInBoardPinout?: boolean
|
|
237
270
|
highlightColor?: string
|
|
238
271
|
mustBeConnected?: boolean
|
|
239
|
-
isI2cSda?: boolean
|
|
240
|
-
isI2cScl?: boolean
|
|
241
|
-
isSpiMosi?: boolean
|
|
242
|
-
isSpiMiso?: boolean
|
|
243
|
-
isSpiSck?: boolean
|
|
244
|
-
isSpiCs?: boolean
|
|
245
|
-
isUartTx?: boolean
|
|
246
|
-
isUartRx?: boolean
|
|
247
272
|
canUseInternalPullup?: boolean
|
|
248
273
|
isUsingInternalPullup?: boolean
|
|
249
274
|
needsExternalPullup?: boolean
|
|
@@ -257,6 +282,46 @@ export interface PinAttributeMap {
|
|
|
257
282
|
}
|
|
258
283
|
|
|
259
284
|
export const pinAttributeMap = z.object({
|
|
285
|
+
capabilities: z
|
|
286
|
+
.array(
|
|
287
|
+
z.enum([
|
|
288
|
+
"i2c_sda",
|
|
289
|
+
"i2c_scl",
|
|
290
|
+
"spi_cs",
|
|
291
|
+
"spi_sck",
|
|
292
|
+
"spi_mosi",
|
|
293
|
+
"spi_miso",
|
|
294
|
+
"uart_tx",
|
|
295
|
+
"uart_rx",
|
|
296
|
+
]),
|
|
297
|
+
)
|
|
298
|
+
.optional(),
|
|
299
|
+
activeCapabilities: z
|
|
300
|
+
.array(
|
|
301
|
+
z.enum([
|
|
302
|
+
"i2c_sda",
|
|
303
|
+
"i2c_scl",
|
|
304
|
+
"spi_cs",
|
|
305
|
+
"spi_sck",
|
|
306
|
+
"spi_mosi",
|
|
307
|
+
"spi_miso",
|
|
308
|
+
"uart_tx",
|
|
309
|
+
"uart_rx",
|
|
310
|
+
]),
|
|
311
|
+
)
|
|
312
|
+
.optional(),
|
|
313
|
+
activeCapability: z
|
|
314
|
+
.enum([
|
|
315
|
+
"i2c_sda",
|
|
316
|
+
"i2c_scl",
|
|
317
|
+
"spi_cs",
|
|
318
|
+
"spi_sck",
|
|
319
|
+
"spi_mosi",
|
|
320
|
+
"spi_miso",
|
|
321
|
+
"uart_tx",
|
|
322
|
+
"uart_rx",
|
|
323
|
+
])
|
|
324
|
+
.optional(),
|
|
260
325
|
providesPower: z.boolean().optional(),
|
|
261
326
|
requiresPower: z.boolean().optional(),
|
|
262
327
|
providesGround: z.boolean().optional(),
|
|
@@ -267,14 +332,6 @@ export const pinAttributeMap = z.object({
|
|
|
267
332
|
includeInBoardPinout: z.boolean().optional(),
|
|
268
333
|
highlightColor: z.string().optional(),
|
|
269
334
|
mustBeConnected: z.boolean().optional(),
|
|
270
|
-
isI2cSda: z.boolean().optional(),
|
|
271
|
-
isI2cScl: z.boolean().optional(),
|
|
272
|
-
isSpiMosi: z.boolean().optional(),
|
|
273
|
-
isSpiMiso: z.boolean().optional(),
|
|
274
|
-
isSpiSck: z.boolean().optional(),
|
|
275
|
-
isSpiCs: z.boolean().optional(),
|
|
276
|
-
isUartTx: z.boolean().optional(),
|
|
277
|
-
isUartRx: z.boolean().optional(),
|
|
278
335
|
canUseInternalPullup: z.boolean().optional(),
|
|
279
336
|
isUsingInternalPullup: z.boolean().optional(),
|
|
280
337
|
needsExternalPullup: z.boolean().optional(),
|