@tscircuit/props 0.0.685 → 0.0.686
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 +46 -1
- package/dist/index.js +1316 -1304
- package/dist/index.js.map +1 -1
- package/lib/assembly/cable.ts +26 -0
- package/lib/assembly/index.ts +3 -0
- package/package.json +1 -1
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
import { expectTypesMatch } from "lib/typecheck"
|
|
2
|
+
import { z } from "zod"
|
|
3
|
+
|
|
4
|
+
export type AssemblyCableStandard = "usb_c"
|
|
5
|
+
|
|
6
|
+
export interface AssemblyCableProps {
|
|
7
|
+
/** Stable assembly identity for the cable. */
|
|
8
|
+
name: string
|
|
9
|
+
/** Start connector selector or named assembly reference, e.g. MOTOR.wireside. */
|
|
10
|
+
from: string
|
|
11
|
+
/** End connector selector or named assembly reference. */
|
|
12
|
+
to: string
|
|
13
|
+
/** Optional USB-C-to-USB-C preset. Omit to infer the cable from its endpoints. */
|
|
14
|
+
standard?: AssemblyCableStandard
|
|
15
|
+
}
|
|
16
|
+
|
|
17
|
+
export const assemblyCableProps = z.object({
|
|
18
|
+
name: z.string().trim().min(1),
|
|
19
|
+
from: z.string().trim().min(1),
|
|
20
|
+
to: z.string().trim().min(1),
|
|
21
|
+
standard: z.literal("usb_c").optional(),
|
|
22
|
+
})
|
|
23
|
+
|
|
24
|
+
export type AssemblyCablePropsInput = z.input<typeof assemblyCableProps>
|
|
25
|
+
|
|
26
|
+
expectTypesMatch<AssemblyCableProps, AssemblyCablePropsInput>(true)
|
package/lib/assembly/index.ts
CHANGED
|
@@ -1,4 +1,5 @@
|
|
|
1
1
|
import { assemblyCadAssemblyProps } from "./cadassembly"
|
|
2
|
+
import { assemblyCableProps } from "./cable"
|
|
2
3
|
import { assemblyDeviceProps } from "./device"
|
|
3
4
|
import { assemblyPrintedPartProps } from "./printedpart"
|
|
4
5
|
import { assemblyMotorProps } from "./motor"
|
|
@@ -6,6 +7,7 @@ import { assemblyScreenProps } from "./screen"
|
|
|
6
7
|
import { assemblySubassemblyProps } from "./subassembly"
|
|
7
8
|
|
|
8
9
|
export * from "./board-mounting"
|
|
10
|
+
export * from "./cable"
|
|
9
11
|
export * from "./device"
|
|
10
12
|
export * from "./motor"
|
|
11
13
|
export * from "./printedpart"
|
|
@@ -14,6 +16,7 @@ export * from "./subassembly"
|
|
|
14
16
|
export * from "./cadassembly"
|
|
15
17
|
|
|
16
18
|
export const assemblyProps = {
|
|
19
|
+
cable: assemblyCableProps,
|
|
17
20
|
device: assemblyDeviceProps,
|
|
18
21
|
motor: assemblyMotorProps,
|
|
19
22
|
printedpart: assemblyPrintedPartProps,
|