@tscircuit/props 0.0.662 → 0.0.664
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 +8474 -808
- package/dist/index.js +1289 -1270
- package/dist/index.js.map +1 -1
- package/lib/assembly/cadassembly.ts +9 -0
- package/lib/assembly/index.ts +6 -0
- package/lib/assembly/subassembly.ts +30 -0
- package/package.json +1 -1
|
@@ -0,0 +1,9 @@
|
|
|
1
|
+
import { assemblySubassemblyProps } from "./subassembly"
|
|
2
|
+
|
|
3
|
+
/** Exact alias of assembly.subassembly; parsed props are identical. */
|
|
4
|
+
export const assemblyCadAssemblyProps = assemblySubassemblyProps
|
|
5
|
+
|
|
6
|
+
export type {
|
|
7
|
+
AssemblySubassemblyProps as AssemblyCadAssemblyProps,
|
|
8
|
+
AssemblySubassemblyPropsInput as AssemblyCadAssemblyPropsInput,
|
|
9
|
+
} from "./subassembly"
|
package/lib/assembly/index.ts
CHANGED
|
@@ -1,10 +1,16 @@
|
|
|
1
|
+
import { assemblyCadAssemblyProps } from "./cadassembly"
|
|
1
2
|
import { assemblyDeviceProps } from "./device"
|
|
2
3
|
import { assemblyScreenProps } from "./screen"
|
|
4
|
+
import { assemblySubassemblyProps } from "./subassembly"
|
|
3
5
|
|
|
4
6
|
export * from "./device"
|
|
5
7
|
export * from "./screen"
|
|
8
|
+
export * from "./subassembly"
|
|
9
|
+
export * from "./cadassembly"
|
|
6
10
|
|
|
7
11
|
export const assemblyProps = {
|
|
8
12
|
device: assemblyDeviceProps,
|
|
9
13
|
screen: assemblyScreenProps,
|
|
14
|
+
subassembly: assemblySubassemblyProps,
|
|
15
|
+
cadassembly: assemblyCadAssemblyProps,
|
|
10
16
|
} as const
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
import { type CadModelProp, cadModelProp } from "lib/common/cadModel"
|
|
2
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
3
|
+
import type { ReactNode } from "react"
|
|
4
|
+
import { z } from "zod"
|
|
5
|
+
|
|
6
|
+
export interface AssemblySubassemblyProps {
|
|
7
|
+
/** Stable identity used by selectors from other assembly elements. */
|
|
8
|
+
name: string
|
|
9
|
+
/** Human-facing alternate to the stable name. */
|
|
10
|
+
displayName?: string
|
|
11
|
+
/** Optional CAD geometry using the existing component cadModel formats. */
|
|
12
|
+
cadModel?: CadModelProp
|
|
13
|
+
/** Nested assembly elements or CAD geometry; preserved without parsing. */
|
|
14
|
+
children?: ReactNode
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const assemblySubassemblyProps = z.object({
|
|
18
|
+
name: z.string().refine((value) => value.trim().length > 0, {
|
|
19
|
+
message: "name cannot be empty",
|
|
20
|
+
}),
|
|
21
|
+
displayName: z.string().optional(),
|
|
22
|
+
cadModel: cadModelProp.optional(),
|
|
23
|
+
children: z.custom<ReactNode>().optional(),
|
|
24
|
+
})
|
|
25
|
+
|
|
26
|
+
export type AssemblySubassemblyPropsInput = z.input<
|
|
27
|
+
typeof assemblySubassemblyProps
|
|
28
|
+
>
|
|
29
|
+
|
|
30
|
+
expectTypesMatch<AssemblySubassemblyProps, AssemblySubassemblyPropsInput>(true)
|