@tscircuit/props 0.0.661 → 0.0.663
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 +8510 -808
- package/dist/index.js +1296 -1266
- 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 +44 -0
- package/lib/components/pcb-keepout.ts +8 -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,44 @@
|
|
|
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
|
+
/**
|
|
12
|
+
* Attachment target selector, resolved within the nearest assembly.device.
|
|
13
|
+
* May select a connector, assembly.screen, assembly.subassembly, or its
|
|
14
|
+
* assembly.cadassembly alias. Omit for an independently placed assembly.
|
|
15
|
+
* This establishes attachment, not a copy of the target's geometry.
|
|
16
|
+
* Target existence, ambiguity, and attachment cycles are checked by core.
|
|
17
|
+
*/
|
|
18
|
+
connectsTo?: string
|
|
19
|
+
/** Optional CAD geometry using the existing component cadModel formats. */
|
|
20
|
+
cadModel?: CadModelProp
|
|
21
|
+
/** Nested assembly elements or CAD geometry; preserved without parsing. */
|
|
22
|
+
children?: ReactNode
|
|
23
|
+
}
|
|
24
|
+
|
|
25
|
+
export const assemblySubassemblyProps = z.object({
|
|
26
|
+
name: z.string().refine((value) => value.trim().length > 0, {
|
|
27
|
+
message: "name cannot be empty",
|
|
28
|
+
}),
|
|
29
|
+
displayName: z.string().optional(),
|
|
30
|
+
connectsTo: z
|
|
31
|
+
.string()
|
|
32
|
+
.refine((value) => value.trim().length > 0, {
|
|
33
|
+
message: "connectsTo cannot be empty",
|
|
34
|
+
})
|
|
35
|
+
.optional(),
|
|
36
|
+
cadModel: cadModelProp.optional(),
|
|
37
|
+
children: z.custom<ReactNode>().optional(),
|
|
38
|
+
})
|
|
39
|
+
|
|
40
|
+
export type AssemblySubassemblyPropsInput = z.input<
|
|
41
|
+
typeof assemblySubassemblyProps
|
|
42
|
+
>
|
|
43
|
+
|
|
44
|
+
expectTypesMatch<AssemblySubassemblyProps, AssemblySubassemblyPropsInput>(true)
|
|
@@ -9,6 +9,10 @@ export const pcbKeepoutProps = z.union([
|
|
|
9
9
|
layers: z.array(layer_ref).optional(),
|
|
10
10
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
11
11
|
warningOnly: z.boolean().optional(),
|
|
12
|
+
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
13
|
+
allowTraces: z.boolean().optional(),
|
|
14
|
+
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
15
|
+
allowPlacements: z.boolean().optional(),
|
|
12
16
|
excludeRefs: z
|
|
13
17
|
.array(z.string())
|
|
14
18
|
.optional()
|
|
@@ -23,6 +27,10 @@ export const pcbKeepoutProps = z.union([
|
|
|
23
27
|
layers: z.array(layer_ref).optional(),
|
|
24
28
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
25
29
|
warningOnly: z.boolean().optional(),
|
|
30
|
+
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
31
|
+
allowTraces: z.boolean().optional(),
|
|
32
|
+
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
33
|
+
allowPlacements: z.boolean().optional(),
|
|
26
34
|
excludeRefs: z
|
|
27
35
|
.array(z.string())
|
|
28
36
|
.optional()
|