@tscircuit/props 0.0.508 → 0.0.509

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.
@@ -3,6 +3,33 @@ import { expectTypesMatch } from "lib/typecheck"
3
3
  import { z } from "zod"
4
4
  import { type FootprintProp, footprintProp } from "../common/footprintProp"
5
5
 
6
+ export type FootprintInsertionDirection =
7
+ | "from_above"
8
+ | "from_left"
9
+ | "from_right"
10
+ | "from_front"
11
+ | "from_back"
12
+ | "x+"
13
+ | "x-"
14
+ | "y+"
15
+ | "y-"
16
+
17
+ export const footprintInsertionDirection = z.enum([
18
+ "from_above",
19
+ "from_left",
20
+ "from_right",
21
+ "from_front",
22
+ "from_back",
23
+ "x+",
24
+ "x-",
25
+ "y+",
26
+ "y-",
27
+ ])
28
+ expectTypesMatch<
29
+ FootprintInsertionDirection,
30
+ z.infer<typeof footprintInsertionDirection>
31
+ >(true)
32
+
6
33
  export interface FootprintProps {
7
34
  children?: any
8
35
  /**
@@ -24,6 +51,11 @@ export interface FootprintProps {
24
51
  * Can be a footprint or kicad string
25
52
  */
26
53
  src?: FootprintProp
54
+ /**
55
+ * Direction a cable or mating part is inserted into this footprint in its
56
+ * unrotated orientation.
57
+ */
58
+ insertionDirection?: FootprintInsertionDirection
27
59
  }
28
60
 
29
61
  export const footprintProps = z.object({
@@ -31,6 +63,11 @@ export const footprintProps = z.object({
31
63
  originalLayer: layer_ref.default("top").optional(),
32
64
  circuitJson: z.array(z.any()).optional(),
33
65
  src: footprintProp.describe("Can be a footprint or kicad string").optional(),
66
+ insertionDirection: footprintInsertionDirection
67
+ .optional()
68
+ .describe(
69
+ "Direction a cable or mating part is inserted into this footprint in its unrotated orientation.",
70
+ ),
34
71
  })
35
72
 
36
73
  export type FootprintPropsInput = z.input<typeof footprintProps>
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.508",
3
+ "version": "0.0.509",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",