@tscircuit/props 0.0.435 → 0.0.437

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.
@@ -395,6 +395,8 @@ export const autorouterProp: z.ZodType<AutorouterProp> = z.union([
395
395
  autorouterString,
396
396
  ])
397
397
 
398
+ export const autorouterEffortLevel = z.enum(["1x", "2x", "5x", "10x", "100x"])
399
+
398
400
  export interface SubcircuitGroupProps extends BaseGroupProps {
399
401
  manualEdits?: ManualEditsFileInput
400
402
  routingDisabled?: boolean
@@ -404,6 +406,7 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
404
406
  pcbRouteCache?: PcbRouteCache
405
407
 
406
408
  autorouter?: AutorouterProp
409
+ autorouterEffortLevel?: "1x" | "2x" | "5x" | "10x" | "100x"
407
410
 
408
411
  /**
409
412
  * Serialized circuit JSON describing a precompiled subcircuit
@@ -561,6 +564,7 @@ export const subcircuitGroupProps = baseGroupProps.extend({
561
564
  partsEngine: partsEngine.optional(),
562
565
  pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
563
566
  autorouter: autorouterProp.optional(),
567
+ autorouterEffortLevel: autorouterEffortLevel.optional(),
564
568
  square: z.boolean().optional(),
565
569
  emptyArea: z.string().optional(),
566
570
  filledArea: z.string().optional(),
@@ -1,5 +1,8 @@
1
1
  import { distance, point, rotation } from "circuit-json"
2
2
  import { z } from "zod"
3
+ import { expectTypesMatch } from "lib/typecheck"
4
+ import type { Point } from "lib/common/point"
5
+ import type { Distance } from "lib/common/distance"
3
6
 
4
7
  export const schematicArcProps = z.object({
5
8
  center: point,
@@ -14,4 +17,17 @@ export const schematicArcProps = z.object({
14
17
  isDashed: z.boolean().optional().default(false),
15
18
  })
16
19
 
17
- export type SchematicArcProps = z.input<typeof schematicArcProps>
20
+ export interface SchematicArcProps {
21
+ center: Point
22
+ radius: Distance
23
+ startAngleDegrees: number | string
24
+ endAngleDegrees: number | string
25
+ direction?: "clockwise" | "counterclockwise"
26
+ strokeWidth?: Distance
27
+ color?: string
28
+ isDashed?: boolean
29
+ }
30
+
31
+ export type InferredSchematicArcProps = z.input<typeof schematicArcProps>
32
+
33
+ expectTypesMatch<SchematicArcProps, z.input<typeof schematicArcProps>>(true)
@@ -1,6 +1,8 @@
1
1
  import { distance } from "circuit-json"
2
2
  import { z } from "zod"
3
3
  import { ninePointAnchor } from "lib/common/ninePointAnchor"
4
+ import { expectTypesMatch } from "lib/typecheck"
5
+ import type { Distance } from "lib/common/distance"
4
6
 
5
7
  export const schematicBoxProps = z
6
8
  .object({
@@ -45,4 +47,26 @@ export const schematicBoxProps = z
45
47
  "Cannot provide both `width`/`height` and `overlay` at the same time.",
46
48
  },
47
49
  )
48
- export type SchematicBoxProps = z.input<typeof schematicBoxProps>
50
+
51
+ export interface SchematicBoxProps {
52
+ schX?: Distance
53
+ schY?: Distance
54
+ width?: Distance
55
+ height?: Distance
56
+ overlay?: string[]
57
+ padding?: Distance
58
+ paddingLeft?: Distance
59
+ paddingRight?: Distance
60
+ paddingTop?: Distance
61
+ paddingBottom?: Distance
62
+ title?: string
63
+ titleAlignment?: z.infer<typeof ninePointAnchor>
64
+ titleColor?: string
65
+ titleFontSize?: Distance
66
+ titleInside?: boolean
67
+ strokeStyle?: "solid" | "dashed"
68
+ }
69
+
70
+ export type InferredSchematicBoxProps = z.input<typeof schematicBoxProps>
71
+
72
+ expectTypesMatch<SchematicBoxProps, z.input<typeof schematicBoxProps>>(true)
@@ -1,5 +1,8 @@
1
1
  import { distance, point } from "circuit-json"
2
2
  import { z } from "zod"
3
+ import { expectTypesMatch } from "lib/typecheck"
4
+ import type { Point } from "lib/common/point"
5
+ import type { Distance } from "lib/common/distance"
3
6
 
4
7
  export const schematicCircleProps = z.object({
5
8
  center: point,
@@ -11,4 +14,18 @@ export const schematicCircleProps = z.object({
11
14
  isDashed: z.boolean().optional().default(false),
12
15
  })
13
16
 
14
- export type SchematicCircleProps = z.input<typeof schematicCircleProps>
17
+ export interface SchematicCircleProps {
18
+ center: Point
19
+ radius: Distance
20
+ strokeWidth?: Distance
21
+ color?: string
22
+ isFilled?: boolean
23
+ fillColor?: string
24
+ isDashed?: boolean
25
+ }
26
+
27
+ export type InferredSchematicCircleProps = z.input<typeof schematicCircleProps>
28
+
29
+ expectTypesMatch<SchematicCircleProps, z.input<typeof schematicCircleProps>>(
30
+ true,
31
+ )
@@ -1,5 +1,7 @@
1
1
  import { distance } from "circuit-json"
2
2
  import { z } from "zod"
3
+ import { expectTypesMatch } from "lib/typecheck"
4
+ import type { Distance } from "lib/common/distance"
3
5
 
4
6
  export const schematicLineProps = z.object({
5
7
  x1: distance,
@@ -10,4 +12,17 @@ export const schematicLineProps = z.object({
10
12
  color: z.string().optional(),
11
13
  isDashed: z.boolean().optional().default(false),
12
14
  })
13
- export type SchematicLineProps = z.input<typeof schematicLineProps>
15
+
16
+ export interface SchematicLineProps {
17
+ x1: Distance
18
+ y1: Distance
19
+ x2: Distance
20
+ y2: Distance
21
+ strokeWidth?: Distance
22
+ color?: string
23
+ isDashed?: boolean
24
+ }
25
+
26
+ export type InferredSchematicLineProps = z.input<typeof schematicLineProps>
27
+
28
+ expectTypesMatch<SchematicLineProps, z.input<typeof schematicLineProps>>(true)
@@ -1,9 +1,20 @@
1
1
  import { point } from "circuit-json"
2
2
  import { z } from "zod"
3
+ import { expectTypesMatch } from "lib/typecheck"
4
+ import type { Point } from "lib/common/point"
3
5
 
4
6
  export const schematicPathProps = z.object({
5
7
  points: z.array(point),
6
8
  isFilled: z.boolean().optional().default(false),
7
9
  fillColor: z.enum(["red", "blue"]).optional(),
8
10
  })
9
- export type SchematicPathProps = z.input<typeof schematicPathProps>
11
+
12
+ export interface SchematicPathProps {
13
+ points: Point[]
14
+ isFilled?: boolean
15
+ fillColor?: "red" | "blue"
16
+ }
17
+
18
+ export type InferredSchematicPathProps = z.input<typeof schematicPathProps>
19
+
20
+ expectTypesMatch<SchematicPathProps, z.input<typeof schematicPathProps>>(true)
@@ -1,5 +1,7 @@
1
1
  import { distance, point, rotation } from "circuit-json"
2
2
  import { z } from "zod"
3
+ import { expectTypesMatch } from "lib/typecheck"
4
+ import type { Distance } from "lib/common/distance"
3
5
 
4
6
  export const schematicRectProps = z.object({
5
7
  schX: distance.optional(),
@@ -15,4 +17,20 @@ export const schematicRectProps = z.object({
15
17
  cornerRadius: distance.optional(),
16
18
  })
17
19
 
18
- export type SchematicRectProps = z.input<typeof schematicRectProps>
20
+ export interface SchematicRectProps {
21
+ schX?: Distance
22
+ schY?: Distance
23
+ width: Distance
24
+ height: Distance
25
+ rotation?: number | string
26
+ strokeWidth?: Distance
27
+ color?: string
28
+ isFilled?: boolean
29
+ fillColor?: string
30
+ isDashed?: boolean
31
+ cornerRadius?: Distance
32
+ }
33
+
34
+ export type InferredSchematicRectProps = z.input<typeof schematicRectProps>
35
+
36
+ expectTypesMatch<SchematicRectProps, z.input<typeof schematicRectProps>>(true)
@@ -2,6 +2,8 @@ import { distance, rotation } from "circuit-json"
2
2
  import { z } from "zod"
3
3
  import { ninePointAnchor } from "lib/common/ninePointAnchor"
4
4
  import { fivePointAnchor } from "lib/common/fivePointAnchor"
5
+ import { expectTypesMatch } from "lib/typecheck"
6
+ import type { Distance } from "lib/common/distance"
5
7
 
6
8
  export const schematicTextProps = z.object({
7
9
  schX: distance.optional(),
@@ -14,4 +16,17 @@ export const schematicTextProps = z.object({
14
16
  color: z.string().default("#000000"),
15
17
  schRotation: rotation.default(0),
16
18
  })
17
- export type SchematicTextProps = z.input<typeof schematicTextProps>
19
+
20
+ export interface SchematicTextProps {
21
+ schX?: Distance
22
+ schY?: Distance
23
+ text: string
24
+ fontSize?: number
25
+ anchor?: z.infer<typeof fivePointAnchor> | z.infer<typeof ninePointAnchor>
26
+ color?: string
27
+ schRotation?: number | string
28
+ }
29
+
30
+ export type InferredSchematicTextProps = z.input<typeof schematicTextProps>
31
+
32
+ expectTypesMatch<SchematicTextProps, z.input<typeof schematicTextProps>>(true)
package/package.json CHANGED
@@ -1,6 +1,6 @@
1
1
  {
2
2
  "name": "@tscircuit/props",
3
- "version": "0.0.435",
3
+ "version": "0.0.437",
4
4
  "description": "Props for tscircuit builtin component types",
5
5
  "main": "dist/index.js",
6
6
  "type": "module",