@tscircuit/props 0.0.643 → 0.0.644
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 +12 -0
- package/dist/index.d.ts +28 -2
- package/dist/index.js +23 -1
- package/dist/index.js.map +1 -1
- package/lib/components/antenna.ts +39 -1
- package/package.json +1 -1
|
@@ -6,8 +6,44 @@ import { type PcbPath, pcbPath } from "lib/common/pcbPath"
|
|
|
6
6
|
import { expectTypesMatch } from "lib/typecheck"
|
|
7
7
|
import { z } from "zod"
|
|
8
8
|
|
|
9
|
-
/**
|
|
9
|
+
/** Band-qualified PCB-trace antenna topologies. */
|
|
10
|
+
export const antennaShapes = [
|
|
11
|
+
"2.4ghz_quarter_wave_monopole",
|
|
12
|
+
"2.4ghz_meandered_monopole",
|
|
13
|
+
"2.4ghz_inverted_f",
|
|
14
|
+
"2.4ghz_meandered_inverted_f",
|
|
15
|
+
"2.4ghz_folded_dipole",
|
|
16
|
+
] as const
|
|
17
|
+
|
|
18
|
+
export type AntennaShape = (typeof antennaShapes)[number]
|
|
19
|
+
export const antennaShape = z.enum(antennaShapes)
|
|
20
|
+
|
|
21
|
+
/** Nominal Wi-Fi and Bluetooth operating-band configurations. */
|
|
22
|
+
export const antennaFrequencyBands = [
|
|
23
|
+
"2.4ghz",
|
|
24
|
+
"5ghz",
|
|
25
|
+
"6ghz",
|
|
26
|
+
"dual_band_2.4ghz_5ghz",
|
|
27
|
+
"tri_band_2.4ghz_5ghz_6ghz",
|
|
28
|
+
] as const
|
|
29
|
+
|
|
30
|
+
export type AntennaFrequencyBand = (typeof antennaFrequencyBands)[number]
|
|
31
|
+
export const antennaFrequencyBand = z.enum(antennaFrequencyBands)
|
|
32
|
+
|
|
33
|
+
/** Props for an antenna component with optional generated or explicit geometry. */
|
|
10
34
|
export interface AntennaProps extends CommonComponentProps {
|
|
35
|
+
/**
|
|
36
|
+
* Band-qualified PCB-trace topology to generate. The encoded band is enough
|
|
37
|
+
* to select the geometry without frequencyBand. No shape is assumed when
|
|
38
|
+
* omitted. An explicit pcbPath takes precedence when both are provided.
|
|
39
|
+
*/
|
|
40
|
+
antennaShape?: AntennaShape
|
|
41
|
+
/**
|
|
42
|
+
* Nominal operating band or multiband configuration. This is redundant when
|
|
43
|
+
* antennaShape is present; the band encoded in antennaShape controls generated
|
|
44
|
+
* geometry.
|
|
45
|
+
*/
|
|
46
|
+
frequencyBand?: AntennaFrequencyBand
|
|
11
47
|
/**
|
|
12
48
|
* Explicit antenna path. Entries use the same selector, point, and via
|
|
13
49
|
* syntax as trace pcbPath entries.
|
|
@@ -16,6 +52,8 @@ export interface AntennaProps extends CommonComponentProps {
|
|
|
16
52
|
}
|
|
17
53
|
|
|
18
54
|
export const antennaProps = commonComponentProps.extend({
|
|
55
|
+
antennaShape: antennaShape.optional(),
|
|
56
|
+
frequencyBand: antennaFrequencyBand.optional(),
|
|
19
57
|
pcbPath: pcbPath.optional(),
|
|
20
58
|
})
|
|
21
59
|
|