@tscircuit/props 0.0.170 → 0.0.171
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/dist/index.d.ts +13 -1
- package/dist/index.js +194 -172
- package/dist/index.js.map +1 -1
- package/lib/common/connectionsProp.ts +12 -0
- package/lib/components/capacitor.ts +14 -0
- package/lib/components/resistor.ts +8 -0
- package/package.json +1 -1
|
@@ -1,18 +1,24 @@
|
|
|
1
1
|
import { resistance } from "circuit-json"
|
|
2
|
+
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
2
3
|
import {
|
|
3
4
|
type CommonComponentProps,
|
|
4
5
|
commonComponentProps,
|
|
5
6
|
lrPins,
|
|
6
7
|
} from "lib/common/layout"
|
|
7
8
|
import { expectTypesMatch } from "lib/typecheck"
|
|
9
|
+
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
8
10
|
import { z } from "zod"
|
|
9
11
|
|
|
12
|
+
export const resistorPinLabels = ["pin1", "pin2", "pos", "neg"] as const
|
|
13
|
+
export type ResistorPinLabels = (typeof resistorPinLabels)[number]
|
|
14
|
+
|
|
10
15
|
export interface ResistorProps extends CommonComponentProps {
|
|
11
16
|
resistance: number | string
|
|
12
17
|
pullupFor?: string
|
|
13
18
|
pullupTo?: string
|
|
14
19
|
pulldownFor?: string
|
|
15
20
|
pulldownTo?: string
|
|
21
|
+
connections?: Connections<ResistorPinLabels>
|
|
16
22
|
}
|
|
17
23
|
|
|
18
24
|
export const resistorProps = commonComponentProps.extend({
|
|
@@ -23,6 +29,8 @@ export const resistorProps = commonComponentProps.extend({
|
|
|
23
29
|
|
|
24
30
|
pulldownFor: z.string().optional(),
|
|
25
31
|
pulldownTo: z.string().optional(),
|
|
32
|
+
|
|
33
|
+
connections: createConnectionsProp(resistorPinLabels).optional(),
|
|
26
34
|
})
|
|
27
35
|
export const resistorPins = lrPins
|
|
28
36
|
|