@tscircuit/props 0.0.188 → 0.0.189

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,56 @@
1
+ import { z } from "zod"
2
+ import {
3
+ type CommonComponentProps,
4
+ commonComponentProps,
5
+ } from "lib/common/layout"
6
+ import type { Connections } from "lib/utility-types/connections-and-selectors"
7
+
8
+ /**
9
+ * Pin labels for fuse component
10
+ */
11
+ export const fusePinLabels = ["pin1", "pin2"] as const
12
+
13
+ export type FusePinLabels = (typeof fusePinLabels)[number]
14
+
15
+ export interface FuseProps extends CommonComponentProps {
16
+ /**
17
+ * Current rating of the fuse in amperes
18
+ */
19
+ currentRating: number | string
20
+
21
+ /**
22
+ * Voltage rating of the fuse
23
+ */
24
+ voltageRating?: number | string
25
+
26
+ /**
27
+ * Whether to show ratings on schematic
28
+ */
29
+ schShowRatings?: boolean
30
+
31
+ /**
32
+ * Connections to other components
33
+ */
34
+ connections?: Connections<FusePinLabels>
35
+ }
36
+
37
+ /**
38
+ * Schema for validating fuse props
39
+ */
40
+ export const fuseProps = commonComponentProps.extend({
41
+ currentRating: z.union([z.number(), z.string()]),
42
+ voltageRating: z.union([z.number(), z.string()]).optional(),
43
+ schShowRatings: z.boolean().optional(),
44
+ connections: z
45
+ .record(
46
+ z.string(),
47
+ z.union([
48
+ z.string(),
49
+ z.array(z.string()).readonly(),
50
+ z.array(z.string()),
51
+ ]),
52
+ )
53
+ .optional(),
54
+ })
55
+
56
+ export type InferredFuseProps = z.input<typeof fuseProps>
package/lib/index.ts CHANGED
@@ -11,6 +11,7 @@ export * from "./common/cadModel"
11
11
  export * from "./components/board"
12
12
  export * from "./components/chip"
13
13
  export * from "./components/jumper"
14
+ export * from "./components/fuse"
14
15
  export * from "./components/platedhole"
15
16
 
16
17
  export * from "./components/resistor"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.188",
3
+ "version": "0.0.189",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",