@tscircuit/props 0.0.637 → 0.0.639
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 +6 -0
- package/dist/index.d.ts +17 -1
- package/dist/index.js +37 -33
- package/dist/index.js.map +1 -1
- package/lib/components/schematic-sheet.ts +13 -0
- package/package.json +1 -1
|
@@ -1,10 +1,20 @@
|
|
|
1
1
|
import { z } from "zod"
|
|
2
|
+
import { distance } from "circuit-json"
|
|
3
|
+
import type { Distance } from "lib/common/distance"
|
|
2
4
|
import { expectTypesMatch } from "lib/typecheck"
|
|
3
5
|
|
|
6
|
+
export type SchematicSheetSize = "A4" | "ANSI_B"
|
|
7
|
+
|
|
4
8
|
export interface SchematicSheetProps {
|
|
5
9
|
name: string
|
|
6
10
|
displayName: string
|
|
7
11
|
sheetIndex?: number
|
|
12
|
+
/** Sheet size used to render the schematic. Defaults to A4. */
|
|
13
|
+
sheetSize?: SchematicSheetSize
|
|
14
|
+
/** Explicit schematic sheet width. Overrides the width from sheetSize. */
|
|
15
|
+
sheetWidth?: Distance
|
|
16
|
+
/** Explicit schematic sheet height. Overrides the height from sheetSize. */
|
|
17
|
+
sheetHeight?: Distance
|
|
8
18
|
children?: any
|
|
9
19
|
}
|
|
10
20
|
|
|
@@ -12,6 +22,9 @@ export const schematicSheetProps = z.object({
|
|
|
12
22
|
name: z.string(),
|
|
13
23
|
displayName: z.string(),
|
|
14
24
|
sheetIndex: z.number().optional(),
|
|
25
|
+
sheetSize: z.enum(["A4", "ANSI_B"]).default("A4"),
|
|
26
|
+
sheetWidth: distance.pipe(z.number().positive()).optional(),
|
|
27
|
+
sheetHeight: distance.pipe(z.number().positive()).optional(),
|
|
15
28
|
children: z.any().optional(),
|
|
16
29
|
})
|
|
17
30
|
|