@tscircuit/props 0.0.573 → 0.0.575

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,26 @@
1
+ import { expectTypesMatch } from "lib/typecheck"
2
+ import { z } from "zod"
3
+
4
+ /**
5
+ * Defines matched routing constraints for two named traces that form a
6
+ * differential pair. Both connections must refer to trace `name` values.
7
+ */
8
+ export interface DifferentialPairProps {
9
+ name?: string
10
+ /** Name of the trace or pin carrying the positive signal. */
11
+ positiveConnection: string
12
+ /** Name of the trace or pin carrying the negative signal. */
13
+ negativeConnection: string
14
+ /** Maximum permitted routed-length skew, expressed as a ratio from 0 to 1. */
15
+ maxLengthSkew?: number
16
+ }
17
+
18
+ export const differentialPairProps = z.object({
19
+ name: z.string().optional(),
20
+ positiveConnection: z.string(),
21
+ negativeConnection: z.string(),
22
+ maxLengthSkew: z.number().min(0).max(1).optional(),
23
+ })
24
+
25
+ type InferredDifferentialPairProps = z.input<typeof differentialPairProps>
26
+ expectTypesMatch<DifferentialPairProps, InferredDifferentialPairProps>(true)
@@ -21,12 +21,21 @@ export interface MosfetProps<PinLabel extends string = string>
21
21
  extends CommonComponentProps<PinLabel> {
22
22
  channelType: "n" | "p"
23
23
  mosfetMode: "enhancement" | "depletion"
24
+ /** The side of the schematic symbol where the drain port is placed. */
25
+ symbolDrainSide?: "left" | "right" | "top" | "bottom"
26
+ /** The side of the schematic symbol where the source port is placed. */
27
+ symbolSourceSide?: "left" | "right" | "top" | "bottom"
28
+ /** The side of the schematic symbol where the gate port is placed. */
29
+ symbolGateSide?: "left" | "right" | "top" | "bottom"
24
30
  connections?: Connections<MosfetPinLabels>
25
31
  }
26
32
 
27
33
  export const mosfetProps = commonComponentProps.extend({
28
34
  channelType: z.enum(["n", "p"]),
29
35
  mosfetMode: z.enum(["enhancement", "depletion"]),
36
+ symbolDrainSide: z.enum(["left", "right", "top", "bottom"]).optional(),
37
+ symbolSourceSide: z.enum(["left", "right", "top", "bottom"]).optional(),
38
+ symbolGateSide: z.enum(["left", "right", "top", "bottom"]).optional(),
30
39
  connections: createConnectionsProp(mosfetPins).optional(),
31
40
  })
32
41
 
package/lib/index.ts CHANGED
@@ -55,6 +55,7 @@ export * from "./components/smtpad"
55
55
  export * from "./components/solderpaste"
56
56
  export * from "./components/hole"
57
57
  export * from "./components/trace"
58
+ export * from "./components/differentialpair"
58
59
  export * from "./components/footprint"
59
60
  export * from "./components/symbol"
60
61
  export * from "./components/battery"
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.573",
3
+ "version": "0.0.575",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",