@tscircuit/props 0.0.305 → 0.0.307

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.
@@ -0,0 +1,12 @@
1
+ import { expectTypesMatch } from "lib/typecheck"
2
+ import { z } from "zod"
3
+
4
+ export const pcbOrientation = z
5
+ .enum(["vertical", "horizontal"])
6
+ .describe(
7
+ "vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward",
8
+ )
9
+
10
+ export type PcbOrientation = "vertical" | "horizontal"
11
+
12
+ expectTypesMatch<PcbOrientation, z.infer<typeof pcbOrientation>>(true)
@@ -16,6 +16,10 @@ import {
16
16
  schematicPinLabel,
17
17
  type SchematicPinLabel,
18
18
  } from "lib/common/schematicPinLabel"
19
+ import {
20
+ pcbOrientation as pcbOrientationProp,
21
+ type PcbOrientation,
22
+ } from "lib/common/pcbOrientation"
19
23
  import type { Connections } from "lib/utility-types/connections-and-selectors"
20
24
  import { expectTypesMatch } from "lib/typecheck"
21
25
  import { z } from "zod"
@@ -61,6 +65,11 @@ export interface PinHeaderProps extends CommonComponentProps {
61
65
  */
62
66
  rightAngle?: boolean
63
67
 
68
+ /**
69
+ * Orientation of the header on the PCB
70
+ */
71
+ pcbOrientation?: PcbOrientation
72
+
64
73
  /**
65
74
  * Diameter of the through-hole for each pin
66
75
  */
@@ -121,6 +130,7 @@ export const pinHeaderProps = commonComponentProps.extend({
121
130
  pcbPinLabels: z.record(z.string(), z.string()).optional(),
122
131
  doubleRow: z.boolean().optional(),
123
132
  rightAngle: z.boolean().optional(),
133
+ pcbOrientation: pcbOrientationProp.optional(),
124
134
  holeDiameter: distance.optional(),
125
135
  platedDiameter: distance.optional(),
126
136
  pinLabels: z
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.305",
3
+ "version": "0.0.307",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",