@tscircuit/props 0.0.276 → 0.0.277
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 +284 -283
- package/dist/index.d.ts +6 -2
- package/dist/index.js +3 -2
- package/dist/index.js.map +1 -1
- package/lib/components/crystal.ts +7 -2
- package/package.json +1 -1
|
@@ -4,6 +4,8 @@ import {
|
|
|
4
4
|
commonComponentProps,
|
|
5
5
|
lrPins,
|
|
6
6
|
} from "lib/common/layout"
|
|
7
|
+
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
8
|
+
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
7
9
|
import {
|
|
8
10
|
schematicOrientation,
|
|
9
11
|
type SchematicOrientation,
|
|
@@ -13,12 +15,16 @@ import { z } from "zod"
|
|
|
13
15
|
|
|
14
16
|
export type PinVariant = "two_pin" | "four_pin"
|
|
15
17
|
|
|
18
|
+
export const crystalPins = lrPins
|
|
19
|
+
export type CrystalPinLabels = (typeof crystalPins)[number]
|
|
20
|
+
|
|
16
21
|
export interface CrystalProps<PinLabel extends string = string>
|
|
17
22
|
extends CommonComponentProps<PinLabel> {
|
|
18
23
|
frequency: number | string
|
|
19
24
|
loadCapacitance: number | string
|
|
20
25
|
pinVariant?: PinVariant
|
|
21
26
|
schOrientation?: SchematicOrientation
|
|
27
|
+
connections?: Connections<CrystalPinLabels>
|
|
22
28
|
}
|
|
23
29
|
|
|
24
30
|
export const crystalProps = commonComponentProps.extend({
|
|
@@ -26,9 +32,8 @@ export const crystalProps = commonComponentProps.extend({
|
|
|
26
32
|
loadCapacitance: capacitance,
|
|
27
33
|
pinVariant: z.enum(["two_pin", "four_pin"]).optional(),
|
|
28
34
|
schOrientation: schematicOrientation.optional(),
|
|
35
|
+
connections: createConnectionsProp(crystalPins).optional(),
|
|
29
36
|
})
|
|
30
|
-
export const crystalPins = lrPins
|
|
31
|
-
export type CrystalPinLabels = (typeof crystalPins)[number]
|
|
32
37
|
|
|
33
38
|
type InferredCrystalProps = z.input<typeof crystalProps>
|
|
34
39
|
expectTypesMatch<CrystalProps, InferredCrystalProps>(true)
|