@tscircuit/props 0.0.620 → 0.0.621
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.
- package/README.md +7 -2
- package/dist/index.d.ts +15 -6
- package/dist/index.js +13 -1
- package/dist/index.js.map +1 -1
- package/lib/components/connector.ts +22 -3
- package/package.json +1 -1
|
@@ -2,15 +2,34 @@ import { chipProps, type ChipPropsSU } from "./chip"
|
|
|
2
2
|
import { expectTypesMatch } from "lib/typecheck"
|
|
3
3
|
import { z } from "zod"
|
|
4
4
|
|
|
5
|
+
export const connectorStandard = z.enum([
|
|
6
|
+
"usb_c",
|
|
7
|
+
"m2",
|
|
8
|
+
"jst_sh",
|
|
9
|
+
"jst_gh",
|
|
10
|
+
"jst_zh",
|
|
11
|
+
"jst_ph",
|
|
12
|
+
"jst_xh",
|
|
13
|
+
"jst_vh",
|
|
14
|
+
])
|
|
15
|
+
|
|
16
|
+
export type ConnectorStandard = z.infer<typeof connectorStandard>
|
|
17
|
+
|
|
5
18
|
export interface ConnectorProps extends ChipPropsSU {
|
|
6
19
|
/**
|
|
7
|
-
* Connector
|
|
20
|
+
* Connector interface or product family, e.g. usb_c, m2, jst_ph
|
|
21
|
+
*/
|
|
22
|
+
standard?: ConnectorStandard
|
|
23
|
+
|
|
24
|
+
/**
|
|
25
|
+
* Number of electrical circuits in the connector
|
|
8
26
|
*/
|
|
9
|
-
|
|
27
|
+
pinCount?: number
|
|
10
28
|
}
|
|
11
29
|
|
|
12
30
|
export const connectorProps = chipProps.extend({
|
|
13
|
-
standard:
|
|
31
|
+
standard: connectorStandard.optional(),
|
|
32
|
+
pinCount: z.number().int().positive().optional(),
|
|
14
33
|
})
|
|
15
34
|
|
|
16
35
|
type InferredConnectorProps = z.input<typeof connectorProps>
|