@tscircuit/props 0.0.479 → 0.0.481

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.
@@ -6,9 +6,9 @@ import {
6
6
  supplier_name,
7
7
  } from "circuit-json"
8
8
  import { expectTypesMatch } from "lib/typecheck"
9
- import { pcbCoordinate } from "./distance"
10
9
  import { z } from "zod"
11
10
  import { type CadModelProp, cadModelProp } from "./cadModel"
11
+ import { pcbCoordinate } from "./distance"
12
12
  import { type FootprintProp, footprintProp } from "./footprintProp"
13
13
  import {
14
14
  type KicadFootprintMetadata,
@@ -18,9 +18,9 @@ import {
18
18
  type KicadSymbolMetadata,
19
19
  kicadSymbolMetadata,
20
20
  } from "./kicadSymbolMetadata"
21
- import { pcbStyle, type PcbStyle } from "./pcbStyle"
22
- import { pcbSx, type PcbSx } from "./pcbSx"
23
- import { schStyle, type SchStyle } from "./schStyle"
21
+ import { type PcbStyle, pcbStyle } from "./pcbStyle"
22
+ import { type PcbSx, pcbSx } from "./pcbSx"
23
+ import { type SchStyle, schStyle } from "./schStyle"
24
24
  import { type SymbolProp, symbolProp } from "./symbolProp"
25
25
  import { url } from "./url"
26
26
 
@@ -226,6 +226,35 @@ export const supplierProps = z.object({
226
226
  expectTypesMatch<SupplierProps, z.input<typeof supplierProps>>(true)
227
227
 
228
228
  export interface PinAttributeMap {
229
+ capabilities?: Array<
230
+ | "i2c_sda"
231
+ | "i2c_scl"
232
+ | "spi_cs"
233
+ | "spi_sck"
234
+ | "spi_mosi"
235
+ | "spi_miso"
236
+ | "uart_tx"
237
+ | "uart_rx"
238
+ >
239
+ activeCapabilities?: Array<
240
+ | "i2c_sda"
241
+ | "i2c_scl"
242
+ | "spi_cs"
243
+ | "spi_sck"
244
+ | "spi_mosi"
245
+ | "spi_miso"
246
+ | "uart_tx"
247
+ | "uart_rx"
248
+ >
249
+ activeCapability?:
250
+ | "i2c_sda"
251
+ | "i2c_scl"
252
+ | "spi_cs"
253
+ | "spi_sck"
254
+ | "spi_mosi"
255
+ | "spi_miso"
256
+ | "uart_tx"
257
+ | "uart_rx"
229
258
  providesPower?: boolean
230
259
  requiresPower?: boolean
231
260
  providesGround?: boolean
@@ -236,9 +265,59 @@ export interface PinAttributeMap {
236
265
  includeInBoardPinout?: boolean
237
266
  highlightColor?: string
238
267
  mustBeConnected?: boolean
268
+ canUseInternalPullup?: boolean
269
+ isUsingInternalPullup?: boolean
270
+ needsExternalPullup?: boolean
271
+ canUseInternalPulldown?: boolean
272
+ isUsingInternalPulldown?: boolean
273
+ needsExternalPulldown?: boolean
274
+ canUseOpenDrain?: boolean
275
+ isUsingOpenDrain?: boolean
276
+ canUsePushPull?: boolean
277
+ isUsingPushPull?: boolean
239
278
  }
240
279
 
241
280
  export const pinAttributeMap = z.object({
281
+ capabilities: z
282
+ .array(
283
+ z.enum([
284
+ "i2c_sda",
285
+ "i2c_scl",
286
+ "spi_cs",
287
+ "spi_sck",
288
+ "spi_mosi",
289
+ "spi_miso",
290
+ "uart_tx",
291
+ "uart_rx",
292
+ ]),
293
+ )
294
+ .optional(),
295
+ activeCapabilities: z
296
+ .array(
297
+ z.enum([
298
+ "i2c_sda",
299
+ "i2c_scl",
300
+ "spi_cs",
301
+ "spi_sck",
302
+ "spi_mosi",
303
+ "spi_miso",
304
+ "uart_tx",
305
+ "uart_rx",
306
+ ]),
307
+ )
308
+ .optional(),
309
+ activeCapability: z
310
+ .enum([
311
+ "i2c_sda",
312
+ "i2c_scl",
313
+ "spi_cs",
314
+ "spi_sck",
315
+ "spi_mosi",
316
+ "spi_miso",
317
+ "uart_tx",
318
+ "uart_rx",
319
+ ])
320
+ .optional(),
242
321
  providesPower: z.boolean().optional(),
243
322
  requiresPower: z.boolean().optional(),
244
323
  providesGround: z.boolean().optional(),
@@ -249,6 +328,16 @@ export const pinAttributeMap = z.object({
249
328
  includeInBoardPinout: z.boolean().optional(),
250
329
  highlightColor: z.string().optional(),
251
330
  mustBeConnected: z.boolean().optional(),
331
+ canUseInternalPullup: z.boolean().optional(),
332
+ isUsingInternalPullup: z.boolean().optional(),
333
+ needsExternalPullup: z.boolean().optional(),
334
+ canUseInternalPulldown: z.boolean().optional(),
335
+ isUsingInternalPulldown: z.boolean().optional(),
336
+ needsExternalPulldown: z.boolean().optional(),
337
+ canUseOpenDrain: z.boolean().optional(),
338
+ isUsingOpenDrain: z.boolean().optional(),
339
+ canUsePushPull: z.boolean().optional(),
340
+ isUsingPushPull: z.boolean().optional(),
252
341
  })
253
342
 
254
343
  expectTypesMatch<PinAttributeMap, z.input<typeof pinAttributeMap>>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.479",
3
+ "version": "0.0.481",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",