@tscircuit/props 0.0.205 → 0.0.207
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 +320 -10
- package/dist/index.js +11 -1
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +6 -0
- package/lib/components/smtpad.ts +20 -0
- package/package.json +1 -1
package/lib/components/group.ts
CHANGED
|
@@ -35,6 +35,9 @@ export const layoutConfig = z.object({
|
|
|
35
35
|
flexColumn: z.boolean().optional(),
|
|
36
36
|
gap: z.number().or(z.string()).optional(),
|
|
37
37
|
|
|
38
|
+
width: length.optional(),
|
|
39
|
+
height: length.optional(),
|
|
40
|
+
|
|
38
41
|
matchAdapt: z.boolean().optional(),
|
|
39
42
|
})
|
|
40
43
|
|
|
@@ -58,6 +61,9 @@ export interface LayoutConfig {
|
|
|
58
61
|
flexColumn?: boolean
|
|
59
62
|
gap?: number | string
|
|
60
63
|
|
|
64
|
+
width?: Distance
|
|
65
|
+
height?: Distance
|
|
66
|
+
|
|
61
67
|
matchAdapt?: boolean
|
|
62
68
|
}
|
|
63
69
|
|
package/lib/components/smtpad.ts
CHANGED
|
@@ -6,6 +6,7 @@ import {
|
|
|
6
6
|
import { z } from "zod"
|
|
7
7
|
import { distance, type Distance } from "lib/common/distance"
|
|
8
8
|
import { portHints, type PortHints } from "lib/common/portHints"
|
|
9
|
+
import { point, type Point } from "lib/common/point"
|
|
9
10
|
import { expectTypesMatch } from "lib/typecheck"
|
|
10
11
|
|
|
11
12
|
export interface RectSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
@@ -38,11 +39,19 @@ export interface PillSmtPadProps extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
|
38
39
|
portHints?: PortHints
|
|
39
40
|
}
|
|
40
41
|
|
|
42
|
+
export interface PolygonSmtPadProps
|
|
43
|
+
extends Omit<PcbLayoutProps, "pcbRotation"> {
|
|
44
|
+
shape: "polygon"
|
|
45
|
+
points: Point[]
|
|
46
|
+
portHints?: PortHints
|
|
47
|
+
}
|
|
48
|
+
|
|
41
49
|
export type SmtPadProps =
|
|
42
50
|
| RectSmtPadProps
|
|
43
51
|
| CircleSmtPadProps
|
|
44
52
|
| RotatedRectSmtPadProps
|
|
45
53
|
| PillSmtPadProps
|
|
54
|
+
| PolygonSmtPadProps
|
|
46
55
|
|
|
47
56
|
// ----------------------------------------------------------------------------
|
|
48
57
|
// Zod
|
|
@@ -93,11 +102,22 @@ export const pillSmtPadProps = pcbLayoutProps
|
|
|
93
102
|
type InferredPillSmtPadProps = z.input<typeof pillSmtPadProps>
|
|
94
103
|
expectTypesMatch<InferredPillSmtPadProps, PillSmtPadProps>(true)
|
|
95
104
|
|
|
105
|
+
export const polygonSmtPadProps = pcbLayoutProps
|
|
106
|
+
.omit({ pcbRotation: true })
|
|
107
|
+
.extend({
|
|
108
|
+
shape: z.literal("polygon"),
|
|
109
|
+
points: z.array(point),
|
|
110
|
+
portHints: portHints.optional(),
|
|
111
|
+
})
|
|
112
|
+
type InferredPolygonSmtPadProps = z.input<typeof polygonSmtPadProps>
|
|
113
|
+
expectTypesMatch<InferredPolygonSmtPadProps, PolygonSmtPadProps>(true)
|
|
114
|
+
|
|
96
115
|
export const smtPadProps = z.union([
|
|
97
116
|
circleSmtPadProps,
|
|
98
117
|
rectSmtPadProps,
|
|
99
118
|
rotatedRectSmtPadProps,
|
|
100
119
|
pillSmtPadProps,
|
|
120
|
+
polygonSmtPadProps,
|
|
101
121
|
])
|
|
102
122
|
|
|
103
123
|
export type InferredSmtPadProps = z.input<typeof smtPadProps>
|