@tscircuit/props 0.0.569 → 0.0.570

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.
@@ -2,29 +2,33 @@ import {
2
2
  type CommonComponentProps,
3
3
  commonComponentProps,
4
4
  } from "../common/layout"
5
+ import { createConnectionsProp } from "../common/connectionsProp"
5
6
  import { expectTypesMatch } from "../typecheck"
7
+ import type { Connections } from "../utility-types/connections-and-selectors"
6
8
  import { z } from "zod"
7
9
 
10
+ export const mosfetPins = [
11
+ "pin1",
12
+ "drain",
13
+ "pin2",
14
+ "source",
15
+ "pin3",
16
+ "gate",
17
+ ] as const
18
+ export type MosfetPinLabels = (typeof mosfetPins)[number]
19
+
8
20
  export interface MosfetProps<PinLabel extends string = string>
9
21
  extends CommonComponentProps<PinLabel> {
10
22
  channelType: "n" | "p"
11
23
  mosfetMode: "enhancement" | "depletion"
24
+ connections?: Connections<MosfetPinLabels>
12
25
  }
13
26
 
14
27
  export const mosfetProps = commonComponentProps.extend({
15
28
  channelType: z.enum(["n", "p"]),
16
29
  mosfetMode: z.enum(["enhancement", "depletion"]),
30
+ connections: createConnectionsProp(mosfetPins).optional(),
17
31
  })
18
32
 
19
- export const mosfetPins = [
20
- "pin1",
21
- "drain",
22
- "pin2",
23
- "source",
24
- "pin3",
25
- "gate",
26
- ] as const
27
- export type MosfetPinLabels = (typeof mosfetPins)[number]
28
-
29
33
  type InferredMosfetProps = z.input<typeof mosfetProps>
30
34
  expectTypesMatch<MosfetProps, InferredMosfetProps>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.569",
3
+ "version": "0.0.570",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",