@tscircuit/props 0.0.712 → 0.0.714
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 +19 -1
- package/dist/index.d.ts +61 -3
- package/dist/index.js +47 -13
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +64 -1
- package/lib/components/symbol.ts +32 -15
- package/package.json +1 -1
package/README.md
CHANGED
|
@@ -442,6 +442,23 @@ export interface AutoroutingPhaseProps extends RoutingTolerances, FanoutProps {
|
|
|
442
442
|
// Reroutes traces selected by region or connection. The simplify autorouter
|
|
443
443
|
// may omit a selector to simplify every existing trace in the phase.
|
|
444
444
|
reroute?: boolean;
|
|
445
|
+
/**
|
|
446
|
+
* Select the test-point autorouter. Requires reroute=true; omitted/false leaves
|
|
447
|
+
* existing routing unchanged. Optional connection(s) select traces, otherwise
|
|
448
|
+
* all routed traces are selected. Conflicts with region, pcbTracePaths,
|
|
449
|
+
* autorouter and algorithmFn. No alias for the unreleased pcbTestPoints object.
|
|
450
|
+
*/
|
|
451
|
+
addTestPoints?: boolean;
|
|
452
|
+
/** Test-point layer; defaults to bottom when addTestPoints is enabled. */
|
|
453
|
+
testPointLayer?: "top" | "bottom";
|
|
454
|
+
/** Probe pad diameter, mm or unit string; defaults to 1 mm. Must be positive. */
|
|
455
|
+
testPointDiameter?: Distance;
|
|
456
|
+
/** Copper edge clearance, mm or unit string; defaults to 0.2 mm. */
|
|
457
|
+
testPointClearance?: Distance;
|
|
458
|
+
/** Minimum probe center spacing, mm or unit string; defaults to 2.54 mm. */
|
|
459
|
+
testPointMinProbeSpacing?: Distance;
|
|
460
|
+
/** Maximum local trace detour, mm or unit string; defaults to 1 mm. */
|
|
461
|
+
testPointMaxDetour?: Distance;
|
|
445
462
|
}
|
|
446
463
|
```
|
|
447
464
|
|
|
@@ -2545,7 +2562,8 @@ export interface SymbolProps {
|
|
|
2545
2562
|
* Source sizing bounds in the local symbol coordinate space (mm, +X right, +Y up).
|
|
2546
2563
|
* With width/height, maps the bounds center to the symbol position; all artwork
|
|
2547
2564
|
* and ports use the same transform. Omitted uses automatic bounds including ports.
|
|
2548
|
-
* maxX must exceed minX and maxY must exceed minY.
|
|
2565
|
+
* maxX must exceed minX and maxY must exceed minY. Other shapes are rejected
|
|
2566
|
+
* with a diagnostic listing the required bounds. No aliases; existing defaults are unchanged.
|
|
2549
2567
|
*/
|
|
2550
2568
|
viewbox?: {
|
|
2551
2569
|
minX: number | string;
|
package/dist/index.d.ts
CHANGED
|
@@ -168287,7 +168287,8 @@ interface SymbolProps {
|
|
|
168287
168287
|
* Source sizing bounds in the local symbol coordinate space (mm, +X right, +Y up).
|
|
168288
168288
|
* With width/height, maps the bounds center to the symbol position; all artwork
|
|
168289
168289
|
* and ports use the same transform. Omitted uses automatic bounds including ports.
|
|
168290
|
-
* maxX must exceed minX and maxY must exceed minY.
|
|
168290
|
+
* maxX must exceed minX and maxY must exceed minY. Other shapes are rejected
|
|
168291
|
+
* with a diagnostic listing the required bounds. No aliases; existing defaults are unchanged.
|
|
168291
168292
|
*/
|
|
168292
168293
|
viewbox?: {
|
|
168293
168294
|
minX: number | string;
|
|
@@ -168302,7 +168303,17 @@ declare const symbolProps: z.ZodObject<{
|
|
|
168302
168303
|
width: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
168303
168304
|
height: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
168304
168305
|
fit: z.ZodOptional<z.ZodEnum<["fill", "contain", "stretch"]>>;
|
|
168305
|
-
viewbox: z.ZodOptional<z.
|
|
168306
|
+
viewbox: z.ZodOptional<z.ZodPipeline<z.ZodType<{
|
|
168307
|
+
minX: string | number;
|
|
168308
|
+
maxX: string | number;
|
|
168309
|
+
minY: string | number;
|
|
168310
|
+
maxY: string | number;
|
|
168311
|
+
}, z.ZodTypeDef, {
|
|
168312
|
+
minX: string | number;
|
|
168313
|
+
maxX: string | number;
|
|
168314
|
+
minY: string | number;
|
|
168315
|
+
maxY: string | number;
|
|
168316
|
+
}>, z.ZodEffects<z.ZodEffects<z.ZodObject<{
|
|
168306
168317
|
minX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
168307
168318
|
maxX: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
168308
168319
|
minY: z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>;
|
|
@@ -168337,7 +168348,7 @@ declare const symbolProps: z.ZodObject<{
|
|
|
168337
168348
|
maxX: string | number;
|
|
168338
168349
|
minY: string | number;
|
|
168339
168350
|
maxY: string | number;
|
|
168340
|
-
}
|
|
168351
|
+
}>>>;
|
|
168341
168352
|
name: z.ZodOptional<z.ZodString>;
|
|
168342
168353
|
}, "strip", z.ZodTypeAny, {
|
|
168343
168354
|
width?: number | undefined;
|
|
@@ -193141,6 +193152,23 @@ interface AutoroutingPhaseProps extends RoutingTolerances, FanoutProps {
|
|
|
193141
193152
|
connection?: string;
|
|
193142
193153
|
connections?: string[];
|
|
193143
193154
|
reroute?: boolean;
|
|
193155
|
+
/**
|
|
193156
|
+
* Select the test-point autorouter. Requires reroute=true; omitted/false leaves
|
|
193157
|
+
* existing routing unchanged. Optional connection(s) select traces, otherwise
|
|
193158
|
+
* all routed traces are selected. Conflicts with region, pcbTracePaths,
|
|
193159
|
+
* autorouter and algorithmFn. No alias for the unreleased pcbTestPoints object.
|
|
193160
|
+
*/
|
|
193161
|
+
addTestPoints?: boolean;
|
|
193162
|
+
/** Test-point layer; defaults to bottom when addTestPoints is enabled. */
|
|
193163
|
+
testPointLayer?: "top" | "bottom";
|
|
193164
|
+
/** Probe pad diameter, mm or unit string; defaults to 1 mm. Must be positive. */
|
|
193165
|
+
testPointDiameter?: Distance;
|
|
193166
|
+
/** Copper edge clearance, mm or unit string; defaults to 0.2 mm. */
|
|
193167
|
+
testPointClearance?: Distance;
|
|
193168
|
+
/** Minimum probe center spacing, mm or unit string; defaults to 2.54 mm. */
|
|
193169
|
+
testPointMinProbeSpacing?: Distance;
|
|
193170
|
+
/** Maximum local trace detour, mm or unit string; defaults to 1 mm. */
|
|
193171
|
+
testPointMaxDetour?: Distance;
|
|
193144
193172
|
}
|
|
193145
193173
|
declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
193146
193174
|
busFanoutDirections: z.ZodOptional<z.ZodRecord<z.ZodString, z.ZodUnion<[z.ZodEnum<["top_left", "top_center", "top_right", "center_left", "center", "center_right", "bottom_left", "bottom_center", "bottom_right"]>, z.ZodEnum<["topside_left", "topside_center", "topside_right", "rightside_top", "rightside_center", "rightside_bottom", "bottomside_right", "bottomside_center", "bottomside_left", "leftside_bottom", "leftside_center", "leftside_top", "center"]>, z.ZodObject<{
|
|
@@ -193206,6 +193234,12 @@ declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
|
193206
193234
|
connection: z.ZodOptional<z.ZodString>;
|
|
193207
193235
|
connections: z.ZodOptional<z.ZodArray<z.ZodString, "many">>;
|
|
193208
193236
|
reroute: z.ZodOptional<z.ZodBoolean>;
|
|
193237
|
+
addTestPoints: z.ZodOptional<z.ZodBoolean>;
|
|
193238
|
+
testPointLayer: z.ZodOptional<z.ZodEnum<["top", "bottom"]>>;
|
|
193239
|
+
testPointDiameter: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>;
|
|
193240
|
+
testPointClearance: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>;
|
|
193241
|
+
testPointMinProbeSpacing: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>;
|
|
193242
|
+
testPointMaxDetour: z.ZodOptional<z.ZodPipeline<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>, z.ZodNumber>>;
|
|
193209
193243
|
minTraceWidth: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
193210
193244
|
minViaHoleEdgeToViaHoleEdgeClearance: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
193211
193245
|
minViaEdgeToPadEdgeClearance: z.ZodOptional<z.ZodEffects<z.ZodUnion<[z.ZodString, z.ZodNumber]>, number, string | number>>;
|
|
@@ -193436,6 +193470,12 @@ declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
|
193436
193470
|
shape?: "rect" | undefined;
|
|
193437
193471
|
} | undefined;
|
|
193438
193472
|
reroute?: boolean | undefined;
|
|
193473
|
+
addTestPoints?: boolean | undefined;
|
|
193474
|
+
testPointLayer?: "top" | "bottom" | undefined;
|
|
193475
|
+
testPointDiameter?: number | undefined;
|
|
193476
|
+
testPointClearance?: number | undefined;
|
|
193477
|
+
testPointMinProbeSpacing?: number | undefined;
|
|
193478
|
+
testPointMaxDetour?: number | undefined;
|
|
193439
193479
|
}, {
|
|
193440
193480
|
name?: string | undefined;
|
|
193441
193481
|
key?: any;
|
|
@@ -193503,6 +193543,12 @@ declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
|
193503
193543
|
shape?: "rect" | undefined;
|
|
193504
193544
|
} | undefined;
|
|
193505
193545
|
reroute?: boolean | undefined;
|
|
193546
|
+
addTestPoints?: boolean | undefined;
|
|
193547
|
+
testPointLayer?: "top" | "bottom" | undefined;
|
|
193548
|
+
testPointDiameter?: string | number | undefined;
|
|
193549
|
+
testPointClearance?: string | number | undefined;
|
|
193550
|
+
testPointMinProbeSpacing?: string | number | undefined;
|
|
193551
|
+
testPointMaxDetour?: string | number | undefined;
|
|
193506
193552
|
}>, {
|
|
193507
193553
|
name?: string | undefined;
|
|
193508
193554
|
key?: any;
|
|
@@ -193560,6 +193606,12 @@ declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
|
193560
193606
|
shape?: "rect" | undefined;
|
|
193561
193607
|
} | undefined;
|
|
193562
193608
|
reroute?: boolean | undefined;
|
|
193609
|
+
addTestPoints?: boolean | undefined;
|
|
193610
|
+
testPointLayer?: "top" | "bottom" | undefined;
|
|
193611
|
+
testPointDiameter?: number | undefined;
|
|
193612
|
+
testPointClearance?: number | undefined;
|
|
193613
|
+
testPointMinProbeSpacing?: number | undefined;
|
|
193614
|
+
testPointMaxDetour?: number | undefined;
|
|
193563
193615
|
}, {
|
|
193564
193616
|
name?: string | undefined;
|
|
193565
193617
|
key?: any;
|
|
@@ -193627,6 +193679,12 @@ declare const autoroutingPhaseProps: z.ZodEffects<z.ZodObject<{
|
|
|
193627
193679
|
shape?: "rect" | undefined;
|
|
193628
193680
|
} | undefined;
|
|
193629
193681
|
reroute?: boolean | undefined;
|
|
193682
|
+
addTestPoints?: boolean | undefined;
|
|
193683
|
+
testPointLayer?: "top" | "bottom" | undefined;
|
|
193684
|
+
testPointDiameter?: string | number | undefined;
|
|
193685
|
+
testPointClearance?: string | number | undefined;
|
|
193686
|
+
testPointMinProbeSpacing?: string | number | undefined;
|
|
193687
|
+
testPointMaxDetour?: string | number | undefined;
|
|
193630
193688
|
}>;
|
|
193631
193689
|
|
|
193632
193690
|
declare const transistorPinsLabels: readonly ["pin1", "pin2", "pin3", "emitter", "collector", "base", "gate", "source", "drain"];
|
package/dist/index.js
CHANGED
|
@@ -18722,23 +18722,29 @@ expectTypesMatch(true);
|
|
|
18722
18722
|
|
|
18723
18723
|
// lib/components/symbol.ts
|
|
18724
18724
|
import { z as z100 } from "zod";
|
|
18725
|
+
var symbolViewboxBounds = z100.object({
|
|
18726
|
+
minX: distance,
|
|
18727
|
+
maxX: distance,
|
|
18728
|
+
minY: distance,
|
|
18729
|
+
maxY: distance
|
|
18730
|
+
}).refine((bounds) => bounds.maxX > bounds.minX, {
|
|
18731
|
+
message: "viewbox maxX must exceed minX",
|
|
18732
|
+
path: ["maxX"]
|
|
18733
|
+
}).refine((bounds) => bounds.maxY > bounds.minY, {
|
|
18734
|
+
message: "viewbox maxY must exceed minY",
|
|
18735
|
+
path: ["maxY"]
|
|
18736
|
+
});
|
|
18725
18737
|
var symbolProps = z100.object({
|
|
18726
18738
|
originalFacingDirection: z100.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
18727
18739
|
width: distance.optional(),
|
|
18728
18740
|
height: distance.optional(),
|
|
18729
18741
|
fit: z100.enum(["fill", "contain", "stretch"]).optional(),
|
|
18730
|
-
viewbox: z100.
|
|
18731
|
-
minX
|
|
18732
|
-
|
|
18733
|
-
|
|
18734
|
-
|
|
18735
|
-
|
|
18736
|
-
message: "viewbox maxX must exceed minX",
|
|
18737
|
-
path: ["maxX"]
|
|
18738
|
-
}).refine((bounds) => bounds.maxY > bounds.minY, {
|
|
18739
|
-
message: "viewbox maxY must exceed minY",
|
|
18740
|
-
path: ["maxY"]
|
|
18741
|
-
}).optional(),
|
|
18742
|
+
viewbox: z100.custom(
|
|
18743
|
+
(bounds) => typeof bounds === "object" && bounds !== null && "minX" in bounds && "maxX" in bounds && "minY" in bounds && "maxY" in bounds,
|
|
18744
|
+
{
|
|
18745
|
+
message: "viewbox requires { minX, maxX, minY, maxY } bounds in the local symbol coordinate space."
|
|
18746
|
+
}
|
|
18747
|
+
).pipe(symbolViewboxBounds).optional(),
|
|
18742
18748
|
name: z100.string().optional()
|
|
18743
18749
|
});
|
|
18744
18750
|
expectTypesMatch(true);
|
|
@@ -19371,15 +19377,43 @@ var autoroutingPhaseProps = z120.object({
|
|
|
19371
19377
|
connection: z120.string().optional(),
|
|
19372
19378
|
connections: z120.array(z120.string()).optional(),
|
|
19373
19379
|
reroute: z120.boolean().optional(),
|
|
19380
|
+
addTestPoints: z120.boolean().optional(),
|
|
19381
|
+
testPointLayer: z120.enum(["top", "bottom"]).optional(),
|
|
19382
|
+
testPointDiameter: distance.pipe(z120.number().finite().positive()).optional(),
|
|
19383
|
+
testPointClearance: distance.pipe(z120.number().finite().nonnegative()).optional(),
|
|
19384
|
+
testPointMinProbeSpacing: distance.pipe(z120.number().finite().nonnegative()).optional(),
|
|
19385
|
+
testPointMaxDetour: distance.pipe(z120.number().finite().nonnegative()).optional(),
|
|
19374
19386
|
...fanoutProps.shape
|
|
19375
19387
|
}).superRefine((value, ctx) => {
|
|
19388
|
+
if (value.addTestPoints && (value.reroute !== true || value.region || value.pcbTracePaths || value.autorouter || value.algorithmFn)) {
|
|
19389
|
+
ctx.addIssue({
|
|
19390
|
+
code: z120.ZodIssueCode.custom,
|
|
19391
|
+
path: ["addTestPoints"],
|
|
19392
|
+
message: "addTestPoints requires reroute=true and cannot combine with region, pcbTracePaths, autorouter, or algorithmFn"
|
|
19393
|
+
});
|
|
19394
|
+
}
|
|
19395
|
+
for (const option of [
|
|
19396
|
+
"testPointLayer",
|
|
19397
|
+
"testPointDiameter",
|
|
19398
|
+
"testPointClearance",
|
|
19399
|
+
"testPointMinProbeSpacing",
|
|
19400
|
+
"testPointMaxDetour"
|
|
19401
|
+
]) {
|
|
19402
|
+
if (value[option] !== void 0 && !value.addTestPoints) {
|
|
19403
|
+
ctx.addIssue({
|
|
19404
|
+
code: z120.ZodIssueCode.custom,
|
|
19405
|
+
path: [option],
|
|
19406
|
+
message: `${option} requires addTestPoints=true`
|
|
19407
|
+
});
|
|
19408
|
+
}
|
|
19409
|
+
}
|
|
19376
19410
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
19377
19411
|
if (isSimplifyAutorouter && value.reroute !== true) {
|
|
19378
19412
|
console.warn(
|
|
19379
19413
|
'The "simplify" autorouter preset should only be used with reroute=true'
|
|
19380
19414
|
);
|
|
19381
19415
|
}
|
|
19382
|
-
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
19416
|
+
if (value.reroute !== void 0 && !((isSimplifyAutorouter || value.addTestPoints) && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
19383
19417
|
ctx.addIssue({
|
|
19384
19418
|
code: z120.ZodIssueCode.custom,
|
|
19385
19419
|
message: "region, connection, or connections is required when reroute is provided",
|