@tscircuit/props 0.0.568 → 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.
@@ -1,14 +1,15 @@
1
1
  import { expectTypesMatch } from "lib/typecheck"
2
2
  import { z } from "zod"
3
3
  import {
4
- autorouterProp,
5
- routingTolerances,
6
4
  type AutorouterProp,
7
5
  type RoutingTolerances,
6
+ autorouterProp,
7
+ routingTolerances,
8
8
  } from "./group"
9
9
 
10
10
  export interface AutoroutingPhaseProps extends RoutingTolerances {
11
11
  key?: any
12
+ name?: string
12
13
  autorouter?: AutorouterProp
13
14
  phaseIndex?: number
14
15
  region?: {
@@ -26,6 +27,7 @@ export interface AutoroutingPhaseProps extends RoutingTolerances {
26
27
  export const autoroutingPhaseProps = z
27
28
  .object({
28
29
  key: z.any().optional(),
30
+ name: z.string().optional(),
29
31
  autorouter: autorouterProp.optional(),
30
32
  phaseIndex: z.number().optional(),
31
33
  ...routingTolerances.shape,
@@ -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.568",
3
+ "version": "0.0.570",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",