@tscircuit/props 0.0.577 → 0.0.579
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 +365 -327
- package/dist/index.js +1026 -1012
- package/dist/index.js.map +1 -1
- package/lib/components/netlabel.ts +9 -17
- package/lib/enclosure/fdm/box.ts +24 -0
- package/lib/enclosure/fdm/index.ts +1 -0
- package/lib/enclosure/index.ts +9 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
|
@@ -13,23 +13,15 @@ export interface NetLabelProps {
|
|
|
13
13
|
anchorSide?: "left" | "top" | "right" | "bottom"
|
|
14
14
|
}
|
|
15
15
|
|
|
16
|
-
export const netLabelProps = z
|
|
17
|
-
.
|
|
18
|
-
|
|
19
|
-
|
|
20
|
-
|
|
21
|
-
|
|
22
|
-
|
|
23
|
-
|
|
24
|
-
|
|
25
|
-
})
|
|
26
|
-
.refine(
|
|
27
|
-
(props) => props.net === undefined || props.connection === undefined,
|
|
28
|
-
{
|
|
29
|
-
message: "net and connection cannot be provided together",
|
|
30
|
-
path: ["connection"],
|
|
31
|
-
},
|
|
32
|
-
)
|
|
16
|
+
export const netLabelProps = z.object({
|
|
17
|
+
net: z.string().optional(),
|
|
18
|
+
connection: z.string().optional(),
|
|
19
|
+
connectsTo: z.string().or(z.array(z.string())).optional(),
|
|
20
|
+
schX: distance.optional(),
|
|
21
|
+
schY: distance.optional(),
|
|
22
|
+
schRotation: rotation.optional(),
|
|
23
|
+
anchorSide: z.enum(["left", "top", "right", "bottom"]).optional(),
|
|
24
|
+
})
|
|
33
25
|
|
|
34
26
|
type InferredNetLabelProps = z.input<typeof netLabelProps>
|
|
35
27
|
expectTypesMatch<NetLabelProps, InferredNetLabelProps>(true)
|
|
@@ -0,0 +1,24 @@
|
|
|
1
|
+
import { type Distance, distance } from "lib/common/distance"
|
|
2
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
3
|
+
import { z } from "zod"
|
|
4
|
+
|
|
5
|
+
export interface EnclosureFdmBoxProps {
|
|
6
|
+
/** The name or selector of the board enclosed by this box. */
|
|
7
|
+
boardRef: string
|
|
8
|
+
width?: Distance
|
|
9
|
+
height?: Distance
|
|
10
|
+
depth?: Distance
|
|
11
|
+
wallThickness?: Distance
|
|
12
|
+
}
|
|
13
|
+
|
|
14
|
+
export const enclosureFdmBoxProps = z.object({
|
|
15
|
+
boardRef: z.string().min(1),
|
|
16
|
+
width: distance.optional(),
|
|
17
|
+
height: distance.optional(),
|
|
18
|
+
depth: distance.optional(),
|
|
19
|
+
wallThickness: distance.default("2mm"),
|
|
20
|
+
})
|
|
21
|
+
|
|
22
|
+
export type EnclosureFdmBoxPropsInput = z.input<typeof enclosureFdmBoxProps>
|
|
23
|
+
|
|
24
|
+
expectTypesMatch<EnclosureFdmBoxProps, EnclosureFdmBoxPropsInput>(true)
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
export * from "./box"
|
package/lib/index.ts
CHANGED