@tscircuit/props 0.0.248 → 0.0.250
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/README.md +48 -0
- package/dist/index.d.ts +118 -3
- package/dist/index.js +102 -58
- package/dist/index.js.map +1 -1
- package/lib/components/group.ts +15 -0
- package/lib/components/schematic-cell.ts +19 -0
- package/lib/components/schematic-row.ts +15 -0
- package/lib/components/schematic-table.ts +26 -0
- package/lib/index.ts +3 -0
- package/package.json +1 -1
package/lib/components/group.ts
CHANGED
|
@@ -147,6 +147,12 @@ export interface AutorouterConfig {
|
|
|
147
147
|
groupMode?: "sequential-trace" | "subcircuit"
|
|
148
148
|
local?: boolean
|
|
149
149
|
algorithmFn?: (simpleRouteJson: any) => Promise<any>
|
|
150
|
+
preset?:
|
|
151
|
+
| "sequential-trace"
|
|
152
|
+
| "subcircuit"
|
|
153
|
+
| "auto"
|
|
154
|
+
| "auto-local"
|
|
155
|
+
| "auto-cloud"
|
|
150
156
|
}
|
|
151
157
|
|
|
152
158
|
export type AutorouterProp =
|
|
@@ -170,6 +176,15 @@ export const autorouterConfig = z.object({
|
|
|
170
176
|
(v) => typeof v === "function" || v === undefined,
|
|
171
177
|
)
|
|
172
178
|
.optional(),
|
|
179
|
+
preset: z
|
|
180
|
+
.enum([
|
|
181
|
+
"sequential-trace",
|
|
182
|
+
"subcircuit",
|
|
183
|
+
"auto",
|
|
184
|
+
"auto-local",
|
|
185
|
+
"auto-cloud",
|
|
186
|
+
])
|
|
187
|
+
.optional(),
|
|
173
188
|
local: z.boolean().optional(),
|
|
174
189
|
})
|
|
175
190
|
|
|
@@ -0,0 +1,19 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
4
|
+
|
|
5
|
+
export const schematicCellProps = z.object({
|
|
6
|
+
children: z.string(),
|
|
7
|
+
horizontalAlign: z.enum(["left", "center", "right"]).optional(),
|
|
8
|
+
verticalAlign: z.enum(["top", "middle", "bottom"]).optional(),
|
|
9
|
+
fontSize: distance.optional(),
|
|
10
|
+
})
|
|
11
|
+
|
|
12
|
+
export interface SchematicCellProps {
|
|
13
|
+
children: string
|
|
14
|
+
horizontalAlign?: "left" | "center" | "right"
|
|
15
|
+
verticalAlign?: "top" | "middle" | "bottom"
|
|
16
|
+
fontSize?: number | string
|
|
17
|
+
}
|
|
18
|
+
|
|
19
|
+
expectTypesMatch<SchematicCellProps, z.input<typeof schematicCellProps>>(true)
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
4
|
+
|
|
5
|
+
export const schematicRowProps = z.object({
|
|
6
|
+
children: z.any().optional(),
|
|
7
|
+
height: distance.optional(),
|
|
8
|
+
})
|
|
9
|
+
|
|
10
|
+
export interface SchematicRowProps {
|
|
11
|
+
children?: any
|
|
12
|
+
height?: number | string
|
|
13
|
+
}
|
|
14
|
+
|
|
15
|
+
expectTypesMatch<SchematicRowProps, z.input<typeof schematicRowProps>>(true)
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { distance } from "circuit-json"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
import { ninePointAnchor } from "lib/common/ninePointAnchor"
|
|
4
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
5
|
+
|
|
6
|
+
export const schematicTableProps = z.object({
|
|
7
|
+
schX: distance.optional(),
|
|
8
|
+
schY: distance.optional(),
|
|
9
|
+
children: z.any().optional(),
|
|
10
|
+
cellPadding: distance.optional(),
|
|
11
|
+
borderWidth: distance.optional(),
|
|
12
|
+
anchor: ninePointAnchor.optional(),
|
|
13
|
+
fontSize: distance.optional(),
|
|
14
|
+
})
|
|
15
|
+
|
|
16
|
+
export interface SchematicTableProps {
|
|
17
|
+
schX?: number | string
|
|
18
|
+
schY?: number | string
|
|
19
|
+
children?: any
|
|
20
|
+
cellPadding?: number | string
|
|
21
|
+
borderWidth?: number | string
|
|
22
|
+
anchor?: z.infer<typeof ninePointAnchor>
|
|
23
|
+
fontSize?: number | string
|
|
24
|
+
}
|
|
25
|
+
|
|
26
|
+
expectTypesMatch<SchematicTableProps, z.input<typeof schematicTableProps>>(true)
|
package/lib/index.ts
CHANGED
|
@@ -59,6 +59,9 @@ export * from "./components/schematic-box"
|
|
|
59
59
|
export * from "./components/schematic-line"
|
|
60
60
|
export * from "./components/schematic-text"
|
|
61
61
|
export * from "./components/schematic-path"
|
|
62
|
+
export * from "./components/schematic-table"
|
|
63
|
+
export * from "./components/schematic-row"
|
|
64
|
+
export * from "./components/schematic-cell"
|
|
62
65
|
export * from "./components/silkscreen-text"
|
|
63
66
|
export * from "./components/silkscreen-path"
|
|
64
67
|
export * from "./components/silkscreen-line"
|