@tscircuit/props 0.0.258 → 0.0.259
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 +3 -3
- package/dist/index.d.ts +13 -6
- package/dist/index.js +448 -437
- package/dist/index.js.map +1 -1
- package/lib/common/schematicPinLabel.ts +8 -0
- package/lib/components/chip.ts +12 -5
- package/lib/components/connector.ts +12 -2
- package/lib/components/jumper.ts +12 -2
- package/lib/components/pin-header.ts +6 -2
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/lib/components/chip.ts
CHANGED
|
@@ -13,6 +13,10 @@ import {
|
|
|
13
13
|
type SchematicPinStyle,
|
|
14
14
|
schematicPinStyle,
|
|
15
15
|
} from "lib/common/schematicPinStyle"
|
|
16
|
+
import {
|
|
17
|
+
schematicPinLabel,
|
|
18
|
+
type SchematicPinLabel,
|
|
19
|
+
} from "lib/common/schematicPinLabel"
|
|
16
20
|
import { expectTypesMatch } from "lib/typecheck"
|
|
17
21
|
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
18
22
|
import { z } from "zod"
|
|
@@ -32,10 +36,11 @@ export interface PinCompatibleVariant {
|
|
|
32
36
|
supplierPartNumber?: SupplierPartNumbers
|
|
33
37
|
}
|
|
34
38
|
|
|
35
|
-
export interface ChipPropsSU<
|
|
36
|
-
extends
|
|
39
|
+
export interface ChipPropsSU<
|
|
40
|
+
PinLabel extends SchematicPinLabel = SchematicPinLabel,
|
|
41
|
+
> extends CommonComponentProps<PinLabel> {
|
|
37
42
|
manufacturerPartNumber?: string
|
|
38
|
-
pinLabels?: PinLabelsProp<
|
|
43
|
+
pinLabels?: PinLabelsProp<SchematicPinLabel, PinLabel>
|
|
39
44
|
/**
|
|
40
45
|
* Whether to show pin aliases in the schematic
|
|
41
46
|
*/
|
|
@@ -115,8 +120,10 @@ const connectionsProp = z
|
|
|
115
120
|
.pipe(z.record(z.string(), connectionTarget))
|
|
116
121
|
|
|
117
122
|
export const pinLabelsProp = z.record(
|
|
118
|
-
|
|
119
|
-
|
|
123
|
+
schematicPinLabel,
|
|
124
|
+
schematicPinLabel
|
|
125
|
+
.or(z.array(schematicPinLabel).readonly())
|
|
126
|
+
.or(z.array(schematicPinLabel)),
|
|
120
127
|
)
|
|
121
128
|
|
|
122
129
|
expectTypesMatch<PinLabelsProp, z.input<typeof pinLabelsProp>>(true)
|
|
@@ -11,12 +11,19 @@ import {
|
|
|
11
11
|
type SchematicPinStyle,
|
|
12
12
|
schematicPinStyle,
|
|
13
13
|
} from "lib/common/schematicPinStyle"
|
|
14
|
+
import {
|
|
15
|
+
schematicPinLabel,
|
|
16
|
+
type SchematicPinLabel,
|
|
17
|
+
} from "lib/common/schematicPinLabel"
|
|
14
18
|
import { expectTypesMatch } from "lib/typecheck"
|
|
15
19
|
import { z } from "zod"
|
|
16
20
|
|
|
17
21
|
export interface ConnectorProps extends CommonComponentProps {
|
|
18
22
|
manufacturerPartNumber?: string
|
|
19
|
-
pinLabels?: Record<
|
|
23
|
+
pinLabels?: Record<
|
|
24
|
+
number | SchematicPinLabel,
|
|
25
|
+
SchematicPinLabel | SchematicPinLabel[]
|
|
26
|
+
>
|
|
20
27
|
schPinStyle?: SchematicPinStyle
|
|
21
28
|
schPinSpacing?: number | string
|
|
22
29
|
schWidth?: number | string
|
|
@@ -37,7 +44,10 @@ export interface ConnectorProps extends CommonComponentProps {
|
|
|
37
44
|
export const connectorProps = commonComponentProps.extend({
|
|
38
45
|
manufacturerPartNumber: z.string().optional(),
|
|
39
46
|
pinLabels: z
|
|
40
|
-
.record(
|
|
47
|
+
.record(
|
|
48
|
+
z.number().or(schematicPinLabel),
|
|
49
|
+
schematicPinLabel.or(z.array(schematicPinLabel)),
|
|
50
|
+
)
|
|
41
51
|
.optional(),
|
|
42
52
|
schPinStyle: schematicPinStyle.optional(),
|
|
43
53
|
schPinSpacing: distance.optional(),
|
package/lib/components/jumper.ts
CHANGED
|
@@ -12,13 +12,20 @@ import {
|
|
|
12
12
|
schematicPinStyle,
|
|
13
13
|
} from "lib/common/schematicPinStyle"
|
|
14
14
|
import { connectionTarget } from "lib/common/connectionsProp"
|
|
15
|
+
import {
|
|
16
|
+
schematicPinLabel,
|
|
17
|
+
type SchematicPinLabel,
|
|
18
|
+
} from "lib/common/schematicPinLabel"
|
|
15
19
|
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
16
20
|
import { expectTypesMatch } from "lib/typecheck"
|
|
17
21
|
import { z } from "zod"
|
|
18
22
|
|
|
19
23
|
export interface JumperProps extends CommonComponentProps {
|
|
20
24
|
manufacturerPartNumber?: string
|
|
21
|
-
pinLabels?: Record<
|
|
25
|
+
pinLabels?: Record<
|
|
26
|
+
number | SchematicPinLabel,
|
|
27
|
+
SchematicPinLabel | SchematicPinLabel[]
|
|
28
|
+
>
|
|
22
29
|
schPinStyle?: SchematicPinStyle
|
|
23
30
|
schPinSpacing?: number | string
|
|
24
31
|
schWidth?: number | string
|
|
@@ -47,7 +54,10 @@ export interface JumperProps extends CommonComponentProps {
|
|
|
47
54
|
export const jumperProps = commonComponentProps.extend({
|
|
48
55
|
manufacturerPartNumber: z.string().optional(),
|
|
49
56
|
pinLabels: z
|
|
50
|
-
.record(
|
|
57
|
+
.record(
|
|
58
|
+
z.number().or(schematicPinLabel),
|
|
59
|
+
schematicPinLabel.or(z.array(schematicPinLabel)),
|
|
60
|
+
)
|
|
51
61
|
.optional(),
|
|
52
62
|
schPinStyle: schematicPinStyle.optional(),
|
|
53
63
|
schPinSpacing: distance.optional(),
|
|
@@ -12,6 +12,10 @@ import {
|
|
|
12
12
|
schematicPinStyle,
|
|
13
13
|
} from "lib/common/schematicPinStyle"
|
|
14
14
|
import { connectionTarget } from "lib/common/connectionsProp"
|
|
15
|
+
import {
|
|
16
|
+
schematicPinLabel,
|
|
17
|
+
type SchematicPinLabel,
|
|
18
|
+
} from "lib/common/schematicPinLabel"
|
|
15
19
|
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
16
20
|
import { expectTypesMatch } from "lib/typecheck"
|
|
17
21
|
import { z } from "zod"
|
|
@@ -65,7 +69,7 @@ export interface PinHeaderProps extends CommonComponentProps {
|
|
|
65
69
|
/**
|
|
66
70
|
* Labels for each pin
|
|
67
71
|
*/
|
|
68
|
-
pinLabels?:
|
|
72
|
+
pinLabels?: SchematicPinLabel[]
|
|
69
73
|
|
|
70
74
|
/**
|
|
71
75
|
* Connections to other components
|
|
@@ -113,7 +117,7 @@ export const pinHeaderProps = commonComponentProps.extend({
|
|
|
113
117
|
doubleRow: z.boolean().optional(),
|
|
114
118
|
holeDiameter: distance.optional(),
|
|
115
119
|
platedDiameter: distance.optional(),
|
|
116
|
-
pinLabels: z.array(
|
|
120
|
+
pinLabels: z.array(schematicPinLabel).optional(),
|
|
117
121
|
connections: z
|
|
118
122
|
.custom<Connections>()
|
|
119
123
|
.pipe(z.record(z.string(), connectionTarget))
|
package/lib/index.ts
CHANGED
|
@@ -8,6 +8,7 @@ export * from "./common/schematicOrientation"
|
|
|
8
8
|
export * from "./common/schematicPinDefinitions"
|
|
9
9
|
export * from "./common/schematicPinStyle"
|
|
10
10
|
export * from "./common/cadModel"
|
|
11
|
+
export * from "./common/schematicPinLabel"
|
|
11
12
|
|
|
12
13
|
export * from "./components/board"
|
|
13
14
|
export * from "./components/breakout"
|