@tscircuit/props 0.0.710 → 0.0.711
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 +8 -0
- package/dist/index.d.ts +10 -0
- package/dist/index.js +1 -0
- package/dist/index.js.map +1 -1
- package/lib/components/transistor.ts +9 -0
- package/package.json +1 -1
|
@@ -5,6 +5,7 @@ import {
|
|
|
5
5
|
import { expectTypesMatch } from "lib/typecheck"
|
|
6
6
|
import { z } from "zod"
|
|
7
7
|
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
8
|
+
import { pinLabelsProp, type PinLabelsProp } from "./chip"
|
|
8
9
|
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
9
10
|
|
|
10
11
|
export const transistorPinsLabels = [
|
|
@@ -23,11 +24,19 @@ export type transistorPinsLabels = (typeof transistorPinsLabels)[number]
|
|
|
23
24
|
export interface TransistorProps<PinLabel extends string = string>
|
|
24
25
|
extends CommonComponentProps<PinLabel> {
|
|
25
26
|
type: "npn" | "pnp" | "bjt" | "jfet" | "mosfet" | "igbt"
|
|
27
|
+
/**
|
|
28
|
+
* Physical package pins mapped to semantic terminal names (and optional aliases).
|
|
29
|
+
* For MMBT3904 SOT-23: { pin1: "base", pin2: "emitter", pin3: "collector" }.
|
|
30
|
+
* Use full terminal names to retain schematic and simulation semantics.
|
|
31
|
+
* Omit to retain the symbol's default pin order; no package pinout is inferred.
|
|
32
|
+
*/
|
|
33
|
+
pinLabels?: PinLabelsProp<string, PinLabel>
|
|
26
34
|
connections?: Connections<transistorPinsLabels>
|
|
27
35
|
}
|
|
28
36
|
|
|
29
37
|
export const transistorProps = commonComponentProps.extend({
|
|
30
38
|
type: z.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
39
|
+
pinLabels: pinLabelsProp.optional(),
|
|
31
40
|
connections: createConnectionsProp(transistorPinsLabels).optional(),
|
|
32
41
|
})
|
|
33
42
|
|