@tscircuit/props 0.0.585 → 0.0.587
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 +11 -0
- package/dist/index.d.ts +326 -0
- package/dist/index.js +5 -0
- package/dist/index.js.map +1 -1
- package/lib/components/chip.ts +7 -0
- package/lib/components/schematic-box.ts +15 -1
- package/package.json +1 -1
package/lib/components/chip.ts
CHANGED
|
@@ -68,6 +68,12 @@ export interface ChipPropsSU<
|
|
|
68
68
|
schWidth?: Distance
|
|
69
69
|
schHeight?: Distance
|
|
70
70
|
noSchematicRepresentation?: boolean
|
|
71
|
+
/**
|
|
72
|
+
* Whether to show the components from `internalCircuit` in the schematic.
|
|
73
|
+
* When false, the chip's schematic box is shown instead.
|
|
74
|
+
* @default false
|
|
75
|
+
*/
|
|
76
|
+
schShowInternalCircuit?: boolean
|
|
71
77
|
internallyConnectedPins?: (string | number)[][]
|
|
72
78
|
externallyConnectedPins?: string[][]
|
|
73
79
|
/**
|
|
@@ -184,6 +190,7 @@ export const chipProps = commonComponentProps.extend({
|
|
|
184
190
|
schWidth: distance.optional(),
|
|
185
191
|
schHeight: distance.optional(),
|
|
186
192
|
noSchematicRepresentation: z.boolean().optional(),
|
|
193
|
+
schShowInternalCircuit: z.boolean().optional().default(false),
|
|
187
194
|
noConnect: noConnectProp.optional(),
|
|
188
195
|
connections: connectionsProp.optional(),
|
|
189
196
|
spiceModel: spicemodelElement.optional(),
|
|
@@ -1,11 +1,21 @@
|
|
|
1
1
|
import { distance } from "circuit-json"
|
|
2
|
-
import { z } from "zod"
|
|
3
2
|
import { ninePointAnchor } from "lib/common/ninePointAnchor"
|
|
3
|
+
import {
|
|
4
|
+
type SchematicPinArrangement,
|
|
5
|
+
schematicPinArrangement,
|
|
6
|
+
} from "lib/common/schematicPinDefinitions"
|
|
7
|
+
import { type PinLabelsProp, pinLabelsProp } from "lib/components/chip"
|
|
4
8
|
import { expectTypesMatch } from "lib/typecheck"
|
|
5
9
|
import type { Distance } from "lib/common/distance"
|
|
10
|
+
import { z } from "zod"
|
|
6
11
|
|
|
7
12
|
export const schematicBoxProps = z
|
|
8
13
|
.object({
|
|
14
|
+
name: z.string().optional(),
|
|
15
|
+
chipRef: z.string().optional(),
|
|
16
|
+
pinLabels: pinLabelsProp.optional(),
|
|
17
|
+
schPinArrangement: schematicPinArrangement.optional(),
|
|
18
|
+
|
|
9
19
|
schX: distance.optional(),
|
|
10
20
|
schY: distance.optional(),
|
|
11
21
|
width: distance.optional(),
|
|
@@ -49,6 +59,10 @@ export const schematicBoxProps = z
|
|
|
49
59
|
)
|
|
50
60
|
|
|
51
61
|
export interface SchematicBoxProps {
|
|
62
|
+
name?: string
|
|
63
|
+
chipRef?: string
|
|
64
|
+
pinLabels?: PinLabelsProp
|
|
65
|
+
schPinArrangement?: SchematicPinArrangement
|
|
52
66
|
schX?: Distance
|
|
53
67
|
schY?: Distance
|
|
54
68
|
width?: Distance
|