@tscircuit/props 0.0.583 → 0.0.585

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.
@@ -2,7 +2,6 @@ import { voltage } from "circuit-json"
2
2
  import { z } from "zod"
3
3
  import {
4
4
  commonComponentProps,
5
- lrPins,
6
5
  lrPolarPins,
7
6
  type CommonComponentProps,
8
7
  } from "lib/common/layout"
@@ -10,6 +9,8 @@ import {
10
9
  schematicOrientation,
11
10
  type SchematicOrientation,
12
11
  } from "lib/common/schematicOrientation"
12
+ import { createConnectionsProp } from "lib/common/connectionsProp"
13
+ import type { Connections } from "lib/utility-types/connections-and-selectors"
13
14
  import { expectTypesMatch } from "lib/typecheck"
14
15
 
15
16
  /** @deprecated use battery_capacity from circuit-json when circuit-json is updated */
@@ -29,12 +30,16 @@ const capacity = z
29
30
  })
30
31
  .describe("Battery capacity in mAh")
31
32
 
33
+ export const batteryPins = lrPolarPins
34
+ export type BatteryPinLabels = (typeof batteryPins)[number]
35
+
32
36
  export interface BatteryProps<PinLabel extends string = string>
33
37
  extends CommonComponentProps<PinLabel> {
34
38
  capacity?: number | string
35
39
  voltage?: number | string
36
40
  standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C"
37
41
  schOrientation?: SchematicOrientation
42
+ connections?: Connections<BatteryPinLabels>
38
43
  }
39
44
 
40
45
  export const batteryProps = commonComponentProps.extend({
@@ -42,8 +47,7 @@ export const batteryProps = commonComponentProps.extend({
42
47
  voltage: voltage.optional(),
43
48
  standard: z.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
44
49
  schOrientation: schematicOrientation.optional(),
50
+ connections: createConnectionsProp(batteryPins).optional(),
45
51
  })
46
- export const batteryPins = lrPolarPins
47
- export type BatteryPinLabels = (typeof batteryPins)[number]
48
52
 
49
53
  expectTypesMatch<BatteryProps, z.input<typeof batteryProps>>(true)
@@ -11,7 +11,7 @@ export interface DifferentialPairProps {
11
11
  positiveConnection: string
12
12
  /** Name of the trace or pin carrying the negative signal. */
13
13
  negativeConnection: string
14
- /** Maximum permitted routed-length skew, expressed as a ratio from 0 to 1. */
14
+ /** Maximum permitted routed-length skew in millimeters. */
15
15
  maxLengthSkew?: number
16
16
  }
17
17
 
@@ -19,7 +19,7 @@ export const differentialPairProps = z.object({
19
19
  name: z.string().optional(),
20
20
  positiveConnection: z.string(),
21
21
  negativeConnection: z.string(),
22
- maxLengthSkew: z.number().min(0).max(1).optional(),
22
+ maxLengthSkew: z.number().min(0).finite().optional(),
23
23
  })
24
24
 
25
25
  type InferredDifferentialPairProps = z.input<typeof differentialPairProps>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.583",
3
+ "version": "0.0.585",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",