@tscircuit/props 0.0.617 → 0.0.619
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 +20 -0
- package/dist/index.d.ts +24127 -144
- package/dist/index.js +41 -5
- package/dist/index.js.map +1 -1
- package/lib/common/cadModel.ts +22 -0
- package/lib/components/footprint.ts +25 -0
- package/lib/components/group.ts +44 -9
- package/lib/enclosure/cutout-aperture.ts +75 -13
- package/lib/enclosure/fdm/box.ts +40 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -63,9 +63,13 @@ var assemblyProps = {
|
|
|
63
63
|
// lib/enclosure/cutout-aperture.ts
|
|
64
64
|
import { z as z5 } from "zod";
|
|
65
65
|
var enclosureCutoutApertureShapes = ["pill", "rect", "circle"];
|
|
66
|
-
var
|
|
67
|
-
margin: distance.optional()
|
|
68
|
-
|
|
66
|
+
var cutoutApertureBaseProps = z5.object({
|
|
67
|
+
margin: distance.optional(),
|
|
68
|
+
widthDimensionOffset: distance.optional(),
|
|
69
|
+
heightDimensionOffset: distance.optional(),
|
|
70
|
+
depth: distance.optional()
|
|
71
|
+
});
|
|
72
|
+
var apertureOnlyProps = cutoutApertureBaseProps.shape;
|
|
69
73
|
var enclosureCutoutApertureProps = z5.discriminatedUnion("shape", [
|
|
70
74
|
pillShapeProps.extend(apertureOnlyProps),
|
|
71
75
|
rectShapeProps.extend(apertureOnlyProps),
|
|
@@ -76,11 +80,19 @@ expectTypesMatch(true);
|
|
|
76
80
|
// lib/enclosure/fdm/box.ts
|
|
77
81
|
import { z as z6 } from "zod";
|
|
78
82
|
var enclosureFdmBoxProps = z6.object({
|
|
83
|
+
name: z6.string().optional(),
|
|
79
84
|
boardRef: z6.string().min(1),
|
|
80
85
|
width: distance.optional(),
|
|
81
86
|
height: distance.optional(),
|
|
82
87
|
depth: distance.optional(),
|
|
83
|
-
wallThickness: distance.default("2mm")
|
|
88
|
+
wallThickness: distance.default("2mm"),
|
|
89
|
+
floorThickness: distance.optional(),
|
|
90
|
+
lidThickness: distance.optional(),
|
|
91
|
+
boardClearance: distance.optional(),
|
|
92
|
+
standoffHeight: distance.optional(),
|
|
93
|
+
topHeadroom: distance.optional(),
|
|
94
|
+
lidLipDepth: distance.optional(),
|
|
95
|
+
disableCutouts: z6.boolean().optional()
|
|
84
96
|
});
|
|
85
97
|
expectTypesMatch(true);
|
|
86
98
|
|
|
@@ -146,6 +158,7 @@ var cadModelBase = z10.object({
|
|
|
146
158
|
rotationOffset: z10.number().or(rotationPoint3).optional(),
|
|
147
159
|
positionOffset: point3.optional(),
|
|
148
160
|
modelOriginPosition: point3.optional(),
|
|
161
|
+
modelBounds: z10.object({ min: point3, max: point3 }).optional(),
|
|
149
162
|
size: point3.optional(),
|
|
150
163
|
modelUnitToMmScale: distance.optional(),
|
|
151
164
|
modelBoardNormalDirection: cadModelAxisDirection.optional(),
|
|
@@ -16408,6 +16421,25 @@ var autorouterProp = z41.union([
|
|
|
16408
16421
|
autorouterString
|
|
16409
16422
|
]);
|
|
16410
16423
|
var autorouterEffortLevel = z41.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
16424
|
+
var knownAutorouterVersion = z41.enum([
|
|
16425
|
+
"beta_pipeline1",
|
|
16426
|
+
"beta_pipeline3",
|
|
16427
|
+
"beta_pipeline4",
|
|
16428
|
+
"beta_pipeline5",
|
|
16429
|
+
"beta_pipeline7",
|
|
16430
|
+
"beta_pipeline9",
|
|
16431
|
+
"latest"
|
|
16432
|
+
]);
|
|
16433
|
+
var autorouterVersion = z41.custom(
|
|
16434
|
+
(value) => typeof value === "string"
|
|
16435
|
+
).transform((value) => {
|
|
16436
|
+
const parsedAutorouterVersion = knownAutorouterVersion.safeParse(value);
|
|
16437
|
+
if (parsedAutorouterVersion.success) return parsedAutorouterVersion.data;
|
|
16438
|
+
console.warn(
|
|
16439
|
+
`Unknown autorouterVersion "${value}", falling back to "latest".`
|
|
16440
|
+
);
|
|
16441
|
+
return "latest";
|
|
16442
|
+
});
|
|
16411
16443
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16412
16444
|
name: z41.string().optional(),
|
|
16413
16445
|
children: z41.any().optional(),
|
|
@@ -16515,7 +16547,7 @@ var subcircuitGroupProps = baseGroupProps.extend({
|
|
|
16515
16547
|
pcbRouteCache: z41.custom((v) => true).optional(),
|
|
16516
16548
|
autorouter: autorouterProp.optional(),
|
|
16517
16549
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16518
|
-
autorouterVersion:
|
|
16550
|
+
autorouterVersion: autorouterVersion.optional(),
|
|
16519
16551
|
square: z41.boolean().optional(),
|
|
16520
16552
|
emptyArea: z41.string().optional(),
|
|
16521
16553
|
filledArea: z41.string().optional(),
|
|
@@ -17464,6 +17496,9 @@ var footprintProps = z73.object({
|
|
|
17464
17496
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17465
17497
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17466
17498
|
"Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
|
|
17499
|
+
),
|
|
17500
|
+
cutoutApertureDirection: footprintInsertionDirection.optional().describe(
|
|
17501
|
+
"Direction the part's enclosure opening faces, in its unrotated orientation. Distinct from insertionDirection: a side-actuated switch is installed from above and actuated from the side. Falls back to insertionDirection when absent."
|
|
17467
17502
|
)
|
|
17468
17503
|
});
|
|
17469
17504
|
expectTypesMatch(true);
|
|
@@ -19125,6 +19160,7 @@ export {
|
|
|
19125
19160
|
currentSourcePins,
|
|
19126
19161
|
currentSourceProps,
|
|
19127
19162
|
customDrcCheckFn,
|
|
19163
|
+
cutoutApertureBaseProps,
|
|
19128
19164
|
cutoutProps,
|
|
19129
19165
|
differentialPairProps,
|
|
19130
19166
|
diodePinLabelsProp,
|