@tscircuit/props 0.0.500 → 0.0.502
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 +1 -17
- package/dist/index.d.ts +269 -75
- package/dist/index.js +162 -175
- package/dist/index.js.map +1 -1
- package/lib/components/connector.ts +3 -51
- package/lib/components/group.ts +4 -2
- package/package.json +1 -1
|
@@ -1,63 +1,15 @@
|
|
|
1
|
-
import {
|
|
2
|
-
import {
|
|
3
|
-
type CommonComponentProps,
|
|
4
|
-
commonComponentProps,
|
|
5
|
-
} from "lib/common/layout"
|
|
6
|
-
import {
|
|
7
|
-
type SchematicPortArrangement,
|
|
8
|
-
schematicPortArrangement,
|
|
9
|
-
} from "lib/common/schematicPinDefinitions"
|
|
10
|
-
import {
|
|
11
|
-
type SchematicPinStyle,
|
|
12
|
-
schematicPinStyle,
|
|
13
|
-
} from "lib/common/schematicPinStyle"
|
|
14
|
-
import {
|
|
15
|
-
schematicPinLabel,
|
|
16
|
-
type SchematicPinLabel,
|
|
17
|
-
} from "lib/common/schematicPinLabel"
|
|
1
|
+
import { chipProps, type ChipPropsSU } from "./chip"
|
|
18
2
|
import { expectTypesMatch } from "lib/typecheck"
|
|
19
3
|
import { z } from "zod"
|
|
20
4
|
|
|
21
|
-
export interface ConnectorProps extends
|
|
22
|
-
manufacturerPartNumber?: string
|
|
23
|
-
pinLabels?: Record<
|
|
24
|
-
number | SchematicPinLabel,
|
|
25
|
-
SchematicPinLabel | SchematicPinLabel[]
|
|
26
|
-
>
|
|
27
|
-
schPinStyle?: SchematicPinStyle
|
|
28
|
-
schPinSpacing?: number | string
|
|
29
|
-
schWidth?: number | string
|
|
30
|
-
schHeight?: number | string
|
|
31
|
-
schDirection?: "left" | "right"
|
|
32
|
-
schPortArrangement?: SchematicPortArrangement
|
|
33
|
-
/**
|
|
34
|
-
* Groups of pins that are internally connected
|
|
35
|
-
* e.g., [["1","2"], ["2","3"]]
|
|
36
|
-
*/
|
|
37
|
-
internallyConnectedPins?: (string | number)[][]
|
|
5
|
+
export interface ConnectorProps extends ChipPropsSU {
|
|
38
6
|
/**
|
|
39
7
|
* Connector standard, e.g. usb_c, m2
|
|
40
8
|
*/
|
|
41
9
|
standard?: "usb_c" | "m2"
|
|
42
10
|
}
|
|
43
11
|
|
|
44
|
-
export const connectorProps =
|
|
45
|
-
manufacturerPartNumber: z.string().optional(),
|
|
46
|
-
pinLabels: z
|
|
47
|
-
.record(
|
|
48
|
-
z.number().or(schematicPinLabel),
|
|
49
|
-
schematicPinLabel.or(z.array(schematicPinLabel)),
|
|
50
|
-
)
|
|
51
|
-
.optional(),
|
|
52
|
-
schPinStyle: schematicPinStyle.optional(),
|
|
53
|
-
schPinSpacing: distance.optional(),
|
|
54
|
-
schWidth: distance.optional(),
|
|
55
|
-
schHeight: distance.optional(),
|
|
56
|
-
schDirection: z.enum(["left", "right"]).optional(),
|
|
57
|
-
schPortArrangement: schematicPortArrangement.optional(),
|
|
58
|
-
internallyConnectedPins: z
|
|
59
|
-
.array(z.array(z.union([z.string(), z.number()])))
|
|
60
|
-
.optional(),
|
|
12
|
+
export const connectorProps = chipProps.extend({
|
|
61
13
|
standard: z.enum(["usb_c", "m2"]).optional(),
|
|
62
14
|
})
|
|
63
15
|
|
package/lib/components/group.ts
CHANGED
|
@@ -436,7 +436,7 @@ export interface SubcircuitGroupProps extends BaseGroupProps {
|
|
|
436
436
|
|
|
437
437
|
autorouter?: AutorouterProp
|
|
438
438
|
autorouterEffortLevel?: "1x" | "2x" | "5x" | "10x" | "100x"
|
|
439
|
-
autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "latest"
|
|
439
|
+
autorouterVersion?: "v1" | "v2" | "v3" | "v4" | "v5" | "latest"
|
|
440
440
|
|
|
441
441
|
/**
|
|
442
442
|
* Serialized circuit JSON describing a precompiled subcircuit
|
|
@@ -599,7 +599,9 @@ export const subcircuitGroupProps = baseGroupProps.extend({
|
|
|
599
599
|
pcbRouteCache: z.custom<PcbRouteCache>((v) => true).optional(),
|
|
600
600
|
autorouter: autorouterProp.optional(),
|
|
601
601
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
602
|
-
autorouterVersion: z
|
|
602
|
+
autorouterVersion: z
|
|
603
|
+
.enum(["v1", "v2", "v3", "v4", "v5", "latest"])
|
|
604
|
+
.optional(),
|
|
603
605
|
square: z.boolean().optional(),
|
|
604
606
|
emptyArea: z.string().optional(),
|
|
605
607
|
filledArea: z.string().optional(),
|