@tscircuit/props 0.0.564 → 0.0.566

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.
@@ -15,6 +15,9 @@ export interface AmmeterProps<PinLabel extends string = string>
15
15
  connections: Connections<AmmeterPinLabels>
16
16
  color?: string
17
17
  graphDisplayName?: string
18
+ graphCenter?: number
19
+ graphVerticalOffset?: number | string
20
+ graphCurrentPerDiv?: number | string
18
21
  }
19
22
 
20
23
  const hasAmmeterConnectionPair = (
@@ -33,6 +36,9 @@ export const ammeterProps = commonComponentProps.extend({
33
36
  ),
34
37
  color: z.string().optional(),
35
38
  graphDisplayName: z.string().optional(),
39
+ graphCenter: z.number().optional(),
40
+ graphVerticalOffset: z.number().or(z.string()).optional(),
41
+ graphCurrentPerDiv: z.number().or(z.string()).optional(),
36
42
  })
37
43
 
38
44
  export const ammeterPins = ammeterPinLabels
@@ -9,6 +9,13 @@ import {
9
9
  schematicOrientation,
10
10
  type SchematicOrientation,
11
11
  } from "lib/common/schematicOrientation"
12
+ import { schematicPinLabel } from "lib/common/schematicPinLabel"
13
+
14
+ export const diodePins = lrPolarPins
15
+ export type DiodePinLabels = (typeof diodePins)[number]
16
+ export type DiodePinLabelsProp<PinLabel extends string = string> = Partial<
17
+ Record<DiodePinLabels, PinLabel | PinLabel[] | readonly PinLabel[]>
18
+ >
12
19
 
13
20
  const diodeConnectionKeys = z.enum([
14
21
  "anode",
@@ -26,6 +33,13 @@ const connectionTarget = z
26
33
 
27
34
  const connectionsProp = z.record(diodeConnectionKeys, connectionTarget)
28
35
 
36
+ const diodePinLabelsProp = z.record(
37
+ z.enum(diodePins),
38
+ schematicPinLabel
39
+ .or(z.array(schematicPinLabel).readonly())
40
+ .or(z.array(schematicPinLabel)),
41
+ )
42
+
29
43
  const diodeVariant = z.enum([
30
44
  "standard",
31
45
  "schottky",
@@ -46,6 +60,7 @@ export const diodeProps = commonComponentProps
46
60
  photo: z.boolean().optional(),
47
61
  tvs: z.boolean().optional(),
48
62
  schOrientation: schematicOrientation.optional(),
63
+ pinLabels: diodePinLabelsProp.optional(),
49
64
  })
50
65
  .superRefine((data, ctx) => {
51
66
  // Check if multiple boolean flags are set directly
@@ -112,11 +127,9 @@ export const diodeProps = commonComponentProps
112
127
  return result
113
128
  })
114
129
 
115
- export const diodePins = lrPolarPins
116
- export type DiodePinLabels = (typeof diodePins)[number]
117
-
118
130
  export interface DiodeProps<PinLabel extends string = string>
119
131
  extends CommonComponentProps<PinLabel> {
132
+ pinLabels?: DiodePinLabelsProp<PinLabel>
120
133
  connections?: {
121
134
  anode?: string | string[] | readonly string[]
122
135
  cathode?: string | string[] | readonly string[]
@@ -11,6 +11,9 @@ export interface VoltageProbeProps extends Omit<CommonComponentProps, "name"> {
11
11
  referenceTo?: string
12
12
  color?: string
13
13
  graphDisplayName?: string
14
+ graphCenter?: number
15
+ graphVerticalOffset?: number | string
16
+ graphVoltagePerDiv?: number | string
14
17
  }
15
18
 
16
19
  export const voltageProbeProps = commonComponentProps
@@ -21,6 +24,9 @@ export const voltageProbeProps = commonComponentProps
21
24
  referenceTo: z.string().optional(),
22
25
  color: z.string().optional(),
23
26
  graphDisplayName: z.string().optional(),
27
+ graphCenter: z.number().optional(),
28
+ graphVerticalOffset: z.number().or(z.string()).optional(),
29
+ graphVoltagePerDiv: z.number().or(z.string()).optional(),
24
30
  })
25
31
 
26
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.564",
3
+ "version": "0.0.566",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",