@tscircuit/props 0.0.455 → 0.0.457
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 +22 -10
- package/dist/index.js +5 -2
- package/dist/index.js.map +1 -1
- package/lib/components/schematic-path.ts +2 -2
- package/lib/components/symbol.ts +8 -1
- package/package.json +1 -1
|
@@ -5,7 +5,7 @@ import type { Distance } from "lib/common/distance"
|
|
|
5
5
|
import type { Point } from "lib/common/point"
|
|
6
6
|
|
|
7
7
|
export const schematicPathProps = z.object({
|
|
8
|
-
points: z.array(point),
|
|
8
|
+
points: z.array(point).optional(),
|
|
9
9
|
svgPath: z.string().optional(),
|
|
10
10
|
strokeWidth: distance.optional(),
|
|
11
11
|
strokeColor: z.string().optional(),
|
|
@@ -14,7 +14,7 @@ export const schematicPathProps = z.object({
|
|
|
14
14
|
})
|
|
15
15
|
|
|
16
16
|
export interface SchematicPathProps {
|
|
17
|
-
points
|
|
17
|
+
points?: Point[]
|
|
18
18
|
svgPath?: string
|
|
19
19
|
strokeWidth?: Distance
|
|
20
20
|
strokeColor?: string
|
package/lib/components/symbol.ts
CHANGED
|
@@ -1,3 +1,4 @@
|
|
|
1
|
+
import { distance } from "lib/common/distance"
|
|
1
2
|
import { expectTypesMatch } from "lib/typecheck"
|
|
2
3
|
import { z } from "zod"
|
|
3
4
|
|
|
@@ -9,6 +10,9 @@ export interface SymbolProps {
|
|
|
9
10
|
* because you have a complex symbol. Default is "right" and this is most intuitive.
|
|
10
11
|
*/
|
|
11
12
|
originalFacingDirection?: "up" | "down" | "left" | "right"
|
|
13
|
+
width?: string | number
|
|
14
|
+
height?: string | number
|
|
15
|
+
name?: string
|
|
12
16
|
}
|
|
13
17
|
|
|
14
18
|
export const symbolProps = z.object({
|
|
@@ -16,8 +20,11 @@ export const symbolProps = z.object({
|
|
|
16
20
|
.enum(["up", "down", "left", "right"])
|
|
17
21
|
.default("right")
|
|
18
22
|
.optional(),
|
|
23
|
+
width: distance.optional(),
|
|
24
|
+
height: distance.optional(),
|
|
25
|
+
name: z.string().optional(),
|
|
19
26
|
})
|
|
20
27
|
|
|
21
28
|
export type SymbolPropsInput = z.input<typeof symbolProps>
|
|
22
|
-
type InferredSymbolProps = z.
|
|
29
|
+
type InferredSymbolProps = z.input<typeof symbolProps>
|
|
23
30
|
expectTypesMatch<InferredSymbolProps, SymbolProps>(true)
|