@tscircuit/props 0.0.330 → 0.0.331
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 +145 -1
- package/dist/index.js +183 -135
- package/dist/index.js.map +1 -1
- package/lib/components/schematic-arc.ts +17 -0
- package/lib/components/schematic-circle.ts +14 -0
- package/lib/components/schematic-line.ts +3 -0
- package/lib/components/schematic-rect.ts +16 -0
- package/lib/index.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,17 @@
|
|
|
1
|
+
import { distance, point, rotation } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const schematicArcProps = z.object({
|
|
5
|
+
center: point,
|
|
6
|
+
radius: distance,
|
|
7
|
+
startAngleDegrees: rotation,
|
|
8
|
+
endAngleDegrees: rotation,
|
|
9
|
+
direction: z
|
|
10
|
+
.enum(["clockwise", "counterclockwise"])
|
|
11
|
+
.default("counterclockwise"),
|
|
12
|
+
strokeWidth: distance.optional(),
|
|
13
|
+
color: z.string().optional().default("#000000"),
|
|
14
|
+
isDashed: z.boolean().optional().default(false),
|
|
15
|
+
})
|
|
16
|
+
|
|
17
|
+
export type SchematicArcProps = z.input<typeof schematicArcProps>
|
|
@@ -0,0 +1,14 @@
|
|
|
1
|
+
import { distance, point } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const schematicCircleProps = z.object({
|
|
5
|
+
center: point,
|
|
6
|
+
radius: distance,
|
|
7
|
+
strokeWidth: distance.optional(),
|
|
8
|
+
color: z.string().optional().default("#000000"),
|
|
9
|
+
isFilled: z.boolean().optional().default(false),
|
|
10
|
+
fillColor: z.string().optional(),
|
|
11
|
+
isDashed: z.boolean().optional().default(false),
|
|
12
|
+
})
|
|
13
|
+
|
|
14
|
+
export type SchematicCircleProps = z.input<typeof schematicCircleProps>
|
|
@@ -6,5 +6,8 @@ export const schematicLineProps = z.object({
|
|
|
6
6
|
y1: distance,
|
|
7
7
|
x2: distance,
|
|
8
8
|
y2: distance,
|
|
9
|
+
strokeWidth: distance.optional(),
|
|
10
|
+
color: z.string().optional().default("#000000"),
|
|
11
|
+
isDashed: z.boolean().optional().default(false),
|
|
9
12
|
})
|
|
10
13
|
export type SchematicLineProps = z.input<typeof schematicLineProps>
|
|
@@ -0,0 +1,16 @@
|
|
|
1
|
+
import { distance, point, rotation } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export const schematicRectProps = z.object({
|
|
5
|
+
center: point,
|
|
6
|
+
width: distance,
|
|
7
|
+
height: distance,
|
|
8
|
+
rotation: rotation.default(0),
|
|
9
|
+
strokeWidth: distance.optional(),
|
|
10
|
+
color: z.string().optional().default("#000000"),
|
|
11
|
+
isFilled: z.boolean().optional().default(false),
|
|
12
|
+
fillColor: z.string().optional(),
|
|
13
|
+
isDashed: z.boolean().optional().default(false),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export type SchematicRectProps = z.input<typeof schematicRectProps>
|
package/lib/index.ts
CHANGED
|
@@ -65,7 +65,10 @@ export * from "./components/cadassembly"
|
|
|
65
65
|
export * from "./components/cadmodel"
|
|
66
66
|
export * from "./components/power-source"
|
|
67
67
|
export * from "./components/voltagesource"
|
|
68
|
+
export * from "./components/schematic-arc"
|
|
68
69
|
export * from "./components/schematic-box"
|
|
70
|
+
export * from "./components/schematic-circle"
|
|
71
|
+
export * from "./components/schematic-rect"
|
|
69
72
|
export * from "./components/schematic-line"
|
|
70
73
|
export * from "./components/schematic-text"
|
|
71
74
|
export * from "./components/schematic-path"
|