@tscircuit/props 0.0.499 → 0.0.501
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 +249 -51
- package/dist/index.js +165 -175
- package/dist/index.js.map +1 -1
- package/lib/components/connector.ts +3 -51
- package/lib/components/group.ts +13 -1
- package/package.json +2 -2
|
@@ -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
|
@@ -1,4 +1,9 @@
|
|
|
1
|
-
import {
|
|
1
|
+
import {
|
|
2
|
+
layer_ref,
|
|
3
|
+
length,
|
|
4
|
+
distance,
|
|
5
|
+
type AnyCircuitElement,
|
|
6
|
+
} from "circuit-json"
|
|
2
7
|
import type { AutocompleteString } from "lib/common/autocomplete"
|
|
3
8
|
import type { Distance } from "lib/common/distance"
|
|
4
9
|
import {
|
|
@@ -289,6 +294,13 @@ export type PartsEngine = {
|
|
|
289
294
|
sourceComponent: AnySourceComponent
|
|
290
295
|
footprinterString?: string
|
|
291
296
|
}) => Promise<SupplierPartNumbers> | SupplierPartNumbers
|
|
297
|
+
fetchPartCircuitJson?: (params: {
|
|
298
|
+
supplierPartNumber?: string
|
|
299
|
+
manufacturerPartNumber?: string
|
|
300
|
+
}) =>
|
|
301
|
+
| Promise<AnyCircuitElement[] | undefined>
|
|
302
|
+
| AnyCircuitElement[]
|
|
303
|
+
| undefined
|
|
292
304
|
}
|
|
293
305
|
|
|
294
306
|
export interface PcbRouteCache {
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/props",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.501",
|
|
4
4
|
"description": "Props for tscircuit builtin component types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -31,7 +31,7 @@
|
|
|
31
31
|
"@types/node": "^20.12.11",
|
|
32
32
|
"@types/react": "^18.3.2",
|
|
33
33
|
"ava": "^6.1.3",
|
|
34
|
-
"circuit-json": "^0.0.
|
|
34
|
+
"circuit-json": "^0.0.406",
|
|
35
35
|
"expect-type": "^1.3.0",
|
|
36
36
|
"glob": "^11.0.0",
|
|
37
37
|
"madge": "^8.0.0",
|