@tscircuit/props 0.0.582 → 0.0.584
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 -1
- package/dist/index.d.ts +1467 -1463
- package/dist/index.js +5 -3
- package/dist/index.js.map +1 -1
- package/lib/components/battery.ts +7 -3
- package/lib/components/board.ts +2 -1
- package/package.json +2 -2
|
@@ -2,7 +2,6 @@ import { voltage } from "circuit-json"
|
|
|
2
2
|
import { z } from "zod"
|
|
3
3
|
import {
|
|
4
4
|
commonComponentProps,
|
|
5
|
-
lrPins,
|
|
6
5
|
lrPolarPins,
|
|
7
6
|
type CommonComponentProps,
|
|
8
7
|
} from "lib/common/layout"
|
|
@@ -10,6 +9,8 @@ import {
|
|
|
10
9
|
schematicOrientation,
|
|
11
10
|
type SchematicOrientation,
|
|
12
11
|
} from "lib/common/schematicOrientation"
|
|
12
|
+
import { createConnectionsProp } from "lib/common/connectionsProp"
|
|
13
|
+
import type { Connections } from "lib/utility-types/connections-and-selectors"
|
|
13
14
|
import { expectTypesMatch } from "lib/typecheck"
|
|
14
15
|
|
|
15
16
|
/** @deprecated use battery_capacity from circuit-json when circuit-json is updated */
|
|
@@ -29,12 +30,16 @@ const capacity = z
|
|
|
29
30
|
})
|
|
30
31
|
.describe("Battery capacity in mAh")
|
|
31
32
|
|
|
33
|
+
export const batteryPins = lrPolarPins
|
|
34
|
+
export type BatteryPinLabels = (typeof batteryPins)[number]
|
|
35
|
+
|
|
32
36
|
export interface BatteryProps<PinLabel extends string = string>
|
|
33
37
|
extends CommonComponentProps<PinLabel> {
|
|
34
38
|
capacity?: number | string
|
|
35
39
|
voltage?: number | string
|
|
36
40
|
standard?: "AA" | "AAA" | "9V" | "CR2032" | "18650" | "C"
|
|
37
41
|
schOrientation?: SchematicOrientation
|
|
42
|
+
connections?: Connections<BatteryPinLabels>
|
|
38
43
|
}
|
|
39
44
|
|
|
40
45
|
export const batteryProps = commonComponentProps.extend({
|
|
@@ -42,8 +47,7 @@ export const batteryProps = commonComponentProps.extend({
|
|
|
42
47
|
voltage: voltage.optional(),
|
|
43
48
|
standard: z.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
44
49
|
schOrientation: schematicOrientation.optional(),
|
|
50
|
+
connections: createConnectionsProp(batteryPins).optional(),
|
|
45
51
|
})
|
|
46
|
-
export const batteryPins = lrPolarPins
|
|
47
|
-
export type BatteryPinLabels = (typeof batteryPins)[number]
|
|
48
52
|
|
|
49
53
|
expectTypesMatch<BatteryProps, z.input<typeof batteryProps>>(true)
|
package/lib/components/board.ts
CHANGED
|
@@ -28,7 +28,7 @@ export interface BoardProps
|
|
|
28
28
|
title?: string
|
|
29
29
|
material?: "fr4" | "fr1" | "flex"
|
|
30
30
|
/** Number of layers for the PCB */
|
|
31
|
-
layers?: 1 | 2 | 4 | 6 | 8
|
|
31
|
+
layers?: 1 | 2 | 4 | 6 | 8 | 10
|
|
32
32
|
borderRadius?: Distance
|
|
33
33
|
thickness?: Distance
|
|
34
34
|
boardAnchorPosition?: Point
|
|
@@ -63,6 +63,7 @@ export const boardProps = subcircuitGroupProps
|
|
|
63
63
|
z.literal(4),
|
|
64
64
|
z.literal(6),
|
|
65
65
|
z.literal(8),
|
|
66
|
+
z.literal(10),
|
|
66
67
|
])
|
|
67
68
|
.default(2),
|
|
68
69
|
borderRadius: distance.optional(),
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "@tscircuit/props",
|
|
3
|
-
"version": "0.0.
|
|
3
|
+
"version": "0.0.584",
|
|
4
4
|
"description": "Props for tscircuit builtin component types",
|
|
5
5
|
"main": "dist/index.js",
|
|
6
6
|
"type": "module",
|
|
@@ -32,7 +32,7 @@
|
|
|
32
32
|
"@types/node": "^20.12.11",
|
|
33
33
|
"@types/react": "^18.3.2",
|
|
34
34
|
"ava": "^6.1.3",
|
|
35
|
-
"circuit-json": "^0.0.
|
|
35
|
+
"circuit-json": "^0.0.450",
|
|
36
36
|
"expect-type": "^1.3.0",
|
|
37
37
|
"glob": "^11.0.0",
|
|
38
38
|
"madge": "^8.0.0",
|