@tscircuit/props 0.0.553 → 0.0.555

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.
@@ -10,18 +10,14 @@ import { z } from "zod"
10
10
  export const ammeterPinLabels = ["pin1", "pin2", "pos", "neg"] as const
11
11
  export type AmmeterPinLabels = (typeof ammeterPinLabels)[number]
12
12
 
13
- export interface AmmeterDisplayOptions {
14
- label?: string
15
- center?: number
16
- offsetDivs?: number
17
- unitsPerDiv?: number
18
- }
19
-
20
13
  export interface AmmeterProps<PinLabel extends string = string>
21
14
  extends CommonComponentProps<PinLabel> {
22
15
  connections: Connections<AmmeterPinLabels>
23
16
  color?: string
24
- display?: AmmeterDisplayOptions
17
+ graphDisplayName?: string
18
+ graphCenter?: number
19
+ graphOffsetDivs?: number
20
+ graphUnitsPerDiv?: number
25
21
  }
26
22
 
27
23
  const hasAmmeterConnectionPair = (
@@ -33,20 +29,16 @@ const hasAmmeterConnectionPair = (
33
29
  )
34
30
  }
35
31
 
36
- export const ammeterDisplayOptions = z.object({
37
- label: z.string().optional(),
38
- center: z.number().optional(),
39
- offsetDivs: z.number().optional(),
40
- unitsPerDiv: z.number().optional(),
41
- })
42
-
43
32
  export const ammeterProps = commonComponentProps.extend({
44
33
  connections: createConnectionsProp(ammeterPinLabels).refine(
45
34
  hasAmmeterConnectionPair,
46
35
  "Ammeter connections must include either pos/neg or pin1/pin2",
47
36
  ),
48
37
  color: z.string().optional(),
49
- display: ammeterDisplayOptions.optional(),
38
+ graphDisplayName: z.string().optional(),
39
+ graphCenter: z.number().optional(),
40
+ graphOffsetDivs: z.number().optional(),
41
+ graphUnitsPerDiv: z.number().optional(),
50
42
  })
51
43
 
52
44
  export const ammeterPins = ammeterPinLabels
@@ -41,6 +41,8 @@ const pcbPath = z.array(z.union([pcbPathPoint, z.string()]))
41
41
 
42
42
  const baseTraceProps = z.object({
43
43
  key: z.string().optional(),
44
+ name: z.string().optional(),
45
+ displayName: z.string().optional(),
44
46
  thickness: distance.optional(),
45
47
  width: distance.optional().describe("Alias for trace thickness"),
46
48
  schematicRouteHints: z.array(point).optional(),
@@ -10,14 +10,10 @@ export interface VoltageProbeProps extends Omit<CommonComponentProps, "name"> {
10
10
  connectsTo: string
11
11
  referenceTo?: string
12
12
  color?: string
13
- display?: VoltageProbeDisplayOptions
14
- }
15
-
16
- export interface VoltageProbeDisplayOptions {
17
- label?: string
18
- center?: number
19
- offsetDivs?: number
20
- unitsPerDiv?: number
13
+ graphDisplayName?: string
14
+ graphCenter?: number
15
+ graphOffsetDivs?: number
16
+ graphUnitsPerDiv?: number
21
17
  }
22
18
 
23
19
  export const voltageProbeProps = commonComponentProps
@@ -27,14 +23,10 @@ export const voltageProbeProps = commonComponentProps
27
23
  connectsTo: z.string(),
28
24
  referenceTo: z.string().optional(),
29
25
  color: z.string().optional(),
30
- display: z
31
- .object({
32
- label: z.string().optional(),
33
- center: z.number().optional(),
34
- offsetDivs: z.number().optional(),
35
- unitsPerDiv: z.number().optional(),
36
- })
37
- .optional(),
26
+ graphDisplayName: z.string().optional(),
27
+ graphCenter: z.number().optional(),
28
+ graphOffsetDivs: z.number().optional(),
29
+ graphUnitsPerDiv: z.number().optional(),
38
30
  })
39
31
 
40
32
  expectTypesMatch<VoltageProbeProps, z.input<typeof voltageProbeProps>>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.553",
3
+ "version": "0.0.555",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",