@tscircuit/props 0.0.517 → 0.0.519
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 +13 -0
- package/dist/index.d.ts +20 -1
- package/dist/index.js +295 -285
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +18 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17342,8 +17342,17 @@ expectTypesMatch(
|
|
|
17342
17342
|
true
|
|
17343
17343
|
);
|
|
17344
17344
|
|
|
17345
|
-
// lib/components/
|
|
17345
|
+
// lib/components/autoroutingphase.ts
|
|
17346
17346
|
import { z as z73 } from "zod";
|
|
17347
|
+
var autoroutingPhaseProps = z73.object({
|
|
17348
|
+
key: z73.any().optional(),
|
|
17349
|
+
autorouter: autorouterProp.optional(),
|
|
17350
|
+
phaseIndex: z73.number().optional()
|
|
17351
|
+
});
|
|
17352
|
+
expectTypesMatch(true);
|
|
17353
|
+
|
|
17354
|
+
// lib/components/transistor.ts
|
|
17355
|
+
import { z as z74 } from "zod";
|
|
17347
17356
|
var transistorPinsLabels = [
|
|
17348
17357
|
"pin1",
|
|
17349
17358
|
"pin2",
|
|
@@ -17356,7 +17365,7 @@ var transistorPinsLabels = [
|
|
|
17356
17365
|
"drain"
|
|
17357
17366
|
];
|
|
17358
17367
|
var transistorProps = commonComponentProps.extend({
|
|
17359
|
-
type:
|
|
17368
|
+
type: z74.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17360
17369
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17361
17370
|
});
|
|
17362
17371
|
var transistorPins = [
|
|
@@ -17370,10 +17379,10 @@ var transistorPins = [
|
|
|
17370
17379
|
expectTypesMatch(true);
|
|
17371
17380
|
|
|
17372
17381
|
// lib/components/mosfet.ts
|
|
17373
|
-
import { z as
|
|
17382
|
+
import { z as z75 } from "zod";
|
|
17374
17383
|
var mosfetProps = commonComponentProps.extend({
|
|
17375
|
-
channelType:
|
|
17376
|
-
mosfetMode:
|
|
17384
|
+
channelType: z75.enum(["n", "p"]),
|
|
17385
|
+
mosfetMode: z75.enum(["enhancement", "depletion"])
|
|
17377
17386
|
});
|
|
17378
17387
|
var mosfetPins = [
|
|
17379
17388
|
"pin1",
|
|
@@ -17402,19 +17411,19 @@ expectTypesMatch(true);
|
|
|
17402
17411
|
|
|
17403
17412
|
// lib/components/inductor.ts
|
|
17404
17413
|
import { inductance } from "circuit-json";
|
|
17405
|
-
import { z as
|
|
17414
|
+
import { z as z77 } from "zod";
|
|
17406
17415
|
var inductorPins = lrPins;
|
|
17407
17416
|
var inductorProps = commonComponentProps.extend({
|
|
17408
17417
|
inductance,
|
|
17409
|
-
maxCurrentRating:
|
|
17418
|
+
maxCurrentRating: z77.union([z77.string(), z77.number()]).optional(),
|
|
17410
17419
|
schOrientation: schematicOrientation.optional(),
|
|
17411
17420
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17412
17421
|
});
|
|
17413
17422
|
expectTypesMatch(true);
|
|
17414
17423
|
|
|
17415
17424
|
// lib/components/diode.ts
|
|
17416
|
-
import { z as
|
|
17417
|
-
var diodeConnectionKeys =
|
|
17425
|
+
import { z as z78 } from "zod";
|
|
17426
|
+
var diodeConnectionKeys = z78.enum([
|
|
17418
17427
|
"anode",
|
|
17419
17428
|
"cathode",
|
|
17420
17429
|
"pin1",
|
|
@@ -17422,9 +17431,9 @@ var diodeConnectionKeys = z77.enum([
|
|
|
17422
17431
|
"pos",
|
|
17423
17432
|
"neg"
|
|
17424
17433
|
]);
|
|
17425
|
-
var connectionTarget3 =
|
|
17426
|
-
var connectionsProp2 =
|
|
17427
|
-
var diodeVariant =
|
|
17434
|
+
var connectionTarget3 = z78.string().or(z78.array(z78.string()).readonly()).or(z78.array(z78.string()));
|
|
17435
|
+
var connectionsProp2 = z78.record(diodeConnectionKeys, connectionTarget3);
|
|
17436
|
+
var diodeVariant = z78.enum([
|
|
17428
17437
|
"standard",
|
|
17429
17438
|
"schottky",
|
|
17430
17439
|
"zener",
|
|
@@ -17435,12 +17444,12 @@ var diodeVariant = z77.enum([
|
|
|
17435
17444
|
var diodeProps = commonComponentProps.extend({
|
|
17436
17445
|
connections: connectionsProp2.optional(),
|
|
17437
17446
|
variant: diodeVariant.optional().default("standard"),
|
|
17438
|
-
standard:
|
|
17439
|
-
schottky:
|
|
17440
|
-
zener:
|
|
17441
|
-
avalanche:
|
|
17442
|
-
photo:
|
|
17443
|
-
tvs:
|
|
17447
|
+
standard: z78.boolean().optional(),
|
|
17448
|
+
schottky: z78.boolean().optional(),
|
|
17449
|
+
zener: z78.boolean().optional(),
|
|
17450
|
+
avalanche: z78.boolean().optional(),
|
|
17451
|
+
photo: z78.boolean().optional(),
|
|
17452
|
+
tvs: z78.boolean().optional(),
|
|
17444
17453
|
schOrientation: schematicOrientation.optional()
|
|
17445
17454
|
}).superRefine((data, ctx) => {
|
|
17446
17455
|
const enabledFlags = [
|
|
@@ -17453,11 +17462,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17453
17462
|
].filter(Boolean).length;
|
|
17454
17463
|
if (enabledFlags > 1) {
|
|
17455
17464
|
ctx.addIssue({
|
|
17456
|
-
code:
|
|
17465
|
+
code: z78.ZodIssueCode.custom,
|
|
17457
17466
|
message: "Exactly one diode variant must be enabled",
|
|
17458
17467
|
path: []
|
|
17459
17468
|
});
|
|
17460
|
-
return
|
|
17469
|
+
return z78.INVALID;
|
|
17461
17470
|
}
|
|
17462
17471
|
}).transform((data) => {
|
|
17463
17472
|
const result = {
|
|
@@ -17504,33 +17513,33 @@ var diodePins = lrPolarPins;
|
|
|
17504
17513
|
expectTypesMatch(true);
|
|
17505
17514
|
|
|
17506
17515
|
// lib/components/led.ts
|
|
17507
|
-
import { z as
|
|
17516
|
+
import { z as z79 } from "zod";
|
|
17508
17517
|
var ledProps = commonComponentProps.extend({
|
|
17509
|
-
color:
|
|
17510
|
-
wavelength:
|
|
17511
|
-
schDisplayValue:
|
|
17518
|
+
color: z79.string().optional(),
|
|
17519
|
+
wavelength: z79.string().optional(),
|
|
17520
|
+
schDisplayValue: z79.string().optional(),
|
|
17512
17521
|
schOrientation: schematicOrientation.optional(),
|
|
17513
17522
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17514
|
-
laser:
|
|
17523
|
+
laser: z79.boolean().optional()
|
|
17515
17524
|
});
|
|
17516
17525
|
var ledPins = lrPolarPins;
|
|
17517
17526
|
|
|
17518
17527
|
// lib/components/switch.ts
|
|
17519
17528
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
17520
|
-
import { z as
|
|
17529
|
+
import { z as z80 } from "zod";
|
|
17521
17530
|
var switchProps = commonComponentProps.extend({
|
|
17522
|
-
type:
|
|
17523
|
-
isNormallyClosed:
|
|
17524
|
-
spst:
|
|
17525
|
-
spdt:
|
|
17526
|
-
dpst:
|
|
17527
|
-
dpdt:
|
|
17531
|
+
type: z80.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17532
|
+
isNormallyClosed: z80.boolean().optional().default(false),
|
|
17533
|
+
spst: z80.boolean().optional(),
|
|
17534
|
+
spdt: z80.boolean().optional(),
|
|
17535
|
+
dpst: z80.boolean().optional(),
|
|
17536
|
+
dpdt: z80.boolean().optional(),
|
|
17528
17537
|
simSwitchFrequency: frequency3.optional(),
|
|
17529
17538
|
simCloseAt: ms2.optional(),
|
|
17530
17539
|
simOpenAt: ms2.optional(),
|
|
17531
|
-
simStartClosed:
|
|
17532
|
-
simStartOpen:
|
|
17533
|
-
connections:
|
|
17540
|
+
simStartClosed: z80.boolean().optional(),
|
|
17541
|
+
simStartOpen: z80.boolean().optional(),
|
|
17542
|
+
connections: z80.custom().pipe(z80.record(z80.string(), connectionTarget)).optional()
|
|
17534
17543
|
}).transform((props) => {
|
|
17535
17544
|
const updatedProps = { ...props };
|
|
17536
17545
|
if (updatedProps.dpdt) {
|
|
@@ -17562,33 +17571,33 @@ expectTypesMatch(true);
|
|
|
17562
17571
|
|
|
17563
17572
|
// lib/components/fabrication-note-text.ts
|
|
17564
17573
|
import { length as length4 } from "circuit-json";
|
|
17565
|
-
import { z as
|
|
17574
|
+
import { z as z81 } from "zod";
|
|
17566
17575
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17567
|
-
text:
|
|
17568
|
-
anchorAlignment:
|
|
17569
|
-
font:
|
|
17576
|
+
text: z81.string(),
|
|
17577
|
+
anchorAlignment: z81.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
17578
|
+
font: z81.enum(["tscircuit2024"]).optional(),
|
|
17570
17579
|
fontSize: length4.optional(),
|
|
17571
|
-
color:
|
|
17580
|
+
color: z81.string().optional()
|
|
17572
17581
|
});
|
|
17573
17582
|
expectTypesMatch(true);
|
|
17574
17583
|
|
|
17575
17584
|
// lib/components/fabrication-note-rect.ts
|
|
17576
17585
|
import { distance as distance19 } from "circuit-json";
|
|
17577
|
-
import { z as
|
|
17586
|
+
import { z as z82 } from "zod";
|
|
17578
17587
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17579
17588
|
width: distance19,
|
|
17580
17589
|
height: distance19,
|
|
17581
17590
|
strokeWidth: distance19.optional(),
|
|
17582
|
-
isFilled:
|
|
17583
|
-
hasStroke:
|
|
17584
|
-
isStrokeDashed:
|
|
17585
|
-
color:
|
|
17591
|
+
isFilled: z82.boolean().optional(),
|
|
17592
|
+
hasStroke: z82.boolean().optional(),
|
|
17593
|
+
isStrokeDashed: z82.boolean().optional(),
|
|
17594
|
+
color: z82.string().optional(),
|
|
17586
17595
|
cornerRadius: distance19.optional()
|
|
17587
17596
|
});
|
|
17588
17597
|
|
|
17589
17598
|
// lib/components/fabrication-note-path.ts
|
|
17590
17599
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17591
|
-
import { z as
|
|
17600
|
+
import { z as z83 } from "zod";
|
|
17592
17601
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17593
17602
|
pcbLeftEdgeX: true,
|
|
17594
17603
|
pcbRightEdgeX: true,
|
|
@@ -17600,15 +17609,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17600
17609
|
pcbOffsetY: true,
|
|
17601
17610
|
pcbRotation: true
|
|
17602
17611
|
}).extend({
|
|
17603
|
-
route:
|
|
17612
|
+
route: z83.array(route_hint_point3),
|
|
17604
17613
|
strokeWidth: length5.optional(),
|
|
17605
|
-
color:
|
|
17614
|
+
color: z83.string().optional()
|
|
17606
17615
|
});
|
|
17607
17616
|
|
|
17608
17617
|
// lib/components/fabrication-note-dimension.ts
|
|
17609
17618
|
import { distance as distance20, length as length6 } from "circuit-json";
|
|
17610
|
-
import { z as
|
|
17611
|
-
var dimensionTarget =
|
|
17619
|
+
import { z as z84 } from "zod";
|
|
17620
|
+
var dimensionTarget = z84.union([z84.string(), point]);
|
|
17612
17621
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17613
17622
|
pcbLeftEdgeX: true,
|
|
17614
17623
|
pcbRightEdgeX: true,
|
|
@@ -17622,53 +17631,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17622
17631
|
}).extend({
|
|
17623
17632
|
from: dimensionTarget,
|
|
17624
17633
|
to: dimensionTarget,
|
|
17625
|
-
text:
|
|
17634
|
+
text: z84.string().optional(),
|
|
17626
17635
|
offset: distance20.optional(),
|
|
17627
|
-
font:
|
|
17636
|
+
font: z84.enum(["tscircuit2024"]).optional(),
|
|
17628
17637
|
fontSize: length6.optional(),
|
|
17629
|
-
color:
|
|
17638
|
+
color: z84.string().optional(),
|
|
17630
17639
|
arrowSize: distance20.optional(),
|
|
17631
|
-
units:
|
|
17632
|
-
outerEdgeToEdge:
|
|
17633
|
-
centerToCenter:
|
|
17634
|
-
innerEdgeToEdge:
|
|
17640
|
+
units: z84.enum(["in", "mm"]).optional(),
|
|
17641
|
+
outerEdgeToEdge: z84.literal(true).optional(),
|
|
17642
|
+
centerToCenter: z84.literal(true).optional(),
|
|
17643
|
+
innerEdgeToEdge: z84.literal(true).optional()
|
|
17635
17644
|
});
|
|
17636
17645
|
expectTypesMatch(true);
|
|
17637
17646
|
|
|
17638
17647
|
// lib/components/pcb-trace.ts
|
|
17639
17648
|
import { distance as distance21, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17640
|
-
import { z as
|
|
17641
|
-
var pcbTraceProps =
|
|
17642
|
-
layer:
|
|
17649
|
+
import { z as z85 } from "zod";
|
|
17650
|
+
var pcbTraceProps = z85.object({
|
|
17651
|
+
layer: z85.string().optional(),
|
|
17643
17652
|
thickness: distance21.optional(),
|
|
17644
|
-
route:
|
|
17653
|
+
route: z85.array(route_hint_point4)
|
|
17645
17654
|
});
|
|
17646
17655
|
|
|
17647
17656
|
// lib/components/via.ts
|
|
17648
17657
|
import { distance as distance22, layer_ref as layer_ref6 } from "circuit-json";
|
|
17649
|
-
import { z as
|
|
17658
|
+
import { z as z86 } from "zod";
|
|
17650
17659
|
var viaProps = commonLayoutProps.extend({
|
|
17651
|
-
name:
|
|
17660
|
+
name: z86.string().optional(),
|
|
17652
17661
|
fromLayer: layer_ref6,
|
|
17653
17662
|
toLayer: layer_ref6,
|
|
17654
17663
|
holeDiameter: distance22.optional(),
|
|
17655
17664
|
outerDiameter: distance22.optional(),
|
|
17656
|
-
connectsTo:
|
|
17657
|
-
netIsAssignable:
|
|
17665
|
+
connectsTo: z86.string().or(z86.array(z86.string())).optional(),
|
|
17666
|
+
netIsAssignable: z86.boolean().optional()
|
|
17658
17667
|
});
|
|
17659
17668
|
expectTypesMatch(true);
|
|
17660
17669
|
|
|
17661
17670
|
// lib/components/testpoint.ts
|
|
17662
17671
|
import { distance as distance23 } from "circuit-json";
|
|
17663
|
-
import { z as
|
|
17672
|
+
import { z as z87 } from "zod";
|
|
17664
17673
|
var testpointPins = ["pin1"];
|
|
17665
|
-
var testpointConnectionsProp =
|
|
17674
|
+
var testpointConnectionsProp = z87.object({
|
|
17666
17675
|
pin1: connectionTarget
|
|
17667
17676
|
}).strict();
|
|
17668
17677
|
var testpointProps = commonComponentProps.extend({
|
|
17669
17678
|
connections: testpointConnectionsProp.optional(),
|
|
17670
|
-
footprintVariant:
|
|
17671
|
-
padShape:
|
|
17679
|
+
footprintVariant: z87.enum(["pad", "through_hole"]).optional(),
|
|
17680
|
+
padShape: z87.enum(["rect", "circle"]).optional().default("circle"),
|
|
17672
17681
|
padDiameter: distance23.optional(),
|
|
17673
17682
|
holeDiameter: distance23.optional(),
|
|
17674
17683
|
width: distance23.optional(),
|
|
@@ -17680,45 +17689,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17680
17689
|
expectTypesMatch(true);
|
|
17681
17690
|
|
|
17682
17691
|
// lib/components/breakoutpoint.ts
|
|
17683
|
-
import { z as
|
|
17692
|
+
import { z as z88 } from "zod";
|
|
17684
17693
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17685
|
-
connection:
|
|
17694
|
+
connection: z88.string()
|
|
17686
17695
|
});
|
|
17687
17696
|
expectTypesMatch(true);
|
|
17688
17697
|
|
|
17689
17698
|
// lib/components/pcb-keepout.ts
|
|
17690
17699
|
import { distance as distance24, layer_ref as layer_ref7 } from "circuit-json";
|
|
17691
|
-
import { z as
|
|
17692
|
-
var pcbKeepoutProps =
|
|
17700
|
+
import { z as z89 } from "zod";
|
|
17701
|
+
var pcbKeepoutProps = z89.union([
|
|
17693
17702
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17694
|
-
shape:
|
|
17703
|
+
shape: z89.literal("circle"),
|
|
17695
17704
|
radius: distance24,
|
|
17696
|
-
layers:
|
|
17705
|
+
layers: z89.array(layer_ref7).optional()
|
|
17697
17706
|
}),
|
|
17698
17707
|
pcbLayoutProps.extend({
|
|
17699
|
-
shape:
|
|
17708
|
+
shape: z89.literal("rect"),
|
|
17700
17709
|
width: distance24,
|
|
17701
17710
|
height: distance24,
|
|
17702
|
-
layers:
|
|
17711
|
+
layers: z89.array(layer_ref7).optional()
|
|
17703
17712
|
})
|
|
17704
17713
|
]);
|
|
17705
17714
|
|
|
17706
17715
|
// lib/components/courtyard-rect.ts
|
|
17707
17716
|
import { distance as distance25 } from "circuit-json";
|
|
17708
|
-
import { z as
|
|
17717
|
+
import { z as z90 } from "zod";
|
|
17709
17718
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17710
17719
|
width: distance25,
|
|
17711
17720
|
height: distance25,
|
|
17712
17721
|
strokeWidth: distance25.optional(),
|
|
17713
|
-
isFilled:
|
|
17714
|
-
hasStroke:
|
|
17715
|
-
isStrokeDashed:
|
|
17716
|
-
color:
|
|
17722
|
+
isFilled: z90.boolean().optional(),
|
|
17723
|
+
hasStroke: z90.boolean().optional(),
|
|
17724
|
+
isStrokeDashed: z90.boolean().optional(),
|
|
17725
|
+
color: z90.string().optional()
|
|
17717
17726
|
});
|
|
17718
17727
|
|
|
17719
17728
|
// lib/components/courtyard-outline.ts
|
|
17720
17729
|
import { length as length7 } from "circuit-json";
|
|
17721
|
-
import { z as
|
|
17730
|
+
import { z as z91 } from "zod";
|
|
17722
17731
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17723
17732
|
pcbLeftEdgeX: true,
|
|
17724
17733
|
pcbRightEdgeX: true,
|
|
@@ -17730,11 +17739,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17730
17739
|
pcbOffsetY: true,
|
|
17731
17740
|
pcbRotation: true
|
|
17732
17741
|
}).extend({
|
|
17733
|
-
outline:
|
|
17742
|
+
outline: z91.array(point),
|
|
17734
17743
|
strokeWidth: length7.optional(),
|
|
17735
|
-
isClosed:
|
|
17736
|
-
isStrokeDashed:
|
|
17737
|
-
color:
|
|
17744
|
+
isClosed: z91.boolean().optional(),
|
|
17745
|
+
isStrokeDashed: z91.boolean().optional(),
|
|
17746
|
+
color: z91.string().optional()
|
|
17738
17747
|
});
|
|
17739
17748
|
|
|
17740
17749
|
// lib/components/courtyard-circle.ts
|
|
@@ -17754,35 +17763,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17754
17763
|
});
|
|
17755
17764
|
|
|
17756
17765
|
// lib/components/copper-pour.ts
|
|
17757
|
-
import { z as
|
|
17766
|
+
import { z as z94 } from "zod";
|
|
17758
17767
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17759
|
-
var copperPourProps =
|
|
17760
|
-
name:
|
|
17768
|
+
var copperPourProps = z94.object({
|
|
17769
|
+
name: z94.string().optional(),
|
|
17761
17770
|
layer: layer_ref8,
|
|
17762
|
-
connectsTo:
|
|
17763
|
-
unbroken:
|
|
17771
|
+
connectsTo: z94.string(),
|
|
17772
|
+
unbroken: z94.boolean().optional(),
|
|
17764
17773
|
padMargin: distance.optional(),
|
|
17765
17774
|
traceMargin: distance.optional(),
|
|
17766
17775
|
clearance: distance.optional(),
|
|
17767
17776
|
boardEdgeMargin: distance.optional(),
|
|
17768
17777
|
cutoutMargin: distance.optional(),
|
|
17769
|
-
outline:
|
|
17770
|
-
coveredWithSolderMask:
|
|
17778
|
+
outline: z94.array(point).optional(),
|
|
17779
|
+
coveredWithSolderMask: z94.boolean().optional().default(true)
|
|
17771
17780
|
});
|
|
17772
17781
|
expectTypesMatch(true);
|
|
17773
17782
|
|
|
17774
17783
|
// lib/components/cadassembly.ts
|
|
17775
17784
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
17776
|
-
import { z as
|
|
17777
|
-
var cadassemblyProps =
|
|
17785
|
+
import { z as z95 } from "zod";
|
|
17786
|
+
var cadassemblyProps = z95.object({
|
|
17778
17787
|
originalLayer: layer_ref9.default("top").optional(),
|
|
17779
|
-
children:
|
|
17788
|
+
children: z95.any().optional()
|
|
17780
17789
|
});
|
|
17781
17790
|
expectTypesMatch(true);
|
|
17782
17791
|
|
|
17783
17792
|
// lib/components/cadmodel.ts
|
|
17784
|
-
import { z as
|
|
17785
|
-
var pcbPosition =
|
|
17793
|
+
import { z as z96 } from "zod";
|
|
17794
|
+
var pcbPosition = z96.object({
|
|
17786
17795
|
pcbX: pcbCoordinate.optional(),
|
|
17787
17796
|
pcbY: pcbCoordinate.optional(),
|
|
17788
17797
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -17799,7 +17808,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
17799
17808
|
});
|
|
17800
17809
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
17801
17810
|
expectTypesMatch(true);
|
|
17802
|
-
var cadmodelProps =
|
|
17811
|
+
var cadmodelProps = z96.union([z96.null(), url, cadModelObject]);
|
|
17803
17812
|
|
|
17804
17813
|
// lib/components/power-source.ts
|
|
17805
17814
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -17809,9 +17818,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
17809
17818
|
|
|
17810
17819
|
// lib/components/voltagesource.ts
|
|
17811
17820
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
17812
|
-
import { z as
|
|
17821
|
+
import { z as z97 } from "zod";
|
|
17813
17822
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17814
|
-
var percentage =
|
|
17823
|
+
var percentage = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
17815
17824
|
if (typeof val === "string") {
|
|
17816
17825
|
if (val.endsWith("%")) {
|
|
17817
17826
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17820,13 +17829,13 @@ var percentage = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
|
17820
17829
|
}
|
|
17821
17830
|
return val;
|
|
17822
17831
|
}).pipe(
|
|
17823
|
-
|
|
17832
|
+
z97.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17824
17833
|
);
|
|
17825
17834
|
var voltageSourceProps = commonComponentProps.extend({
|
|
17826
17835
|
voltage: voltage4.optional(),
|
|
17827
17836
|
frequency: frequency4.optional(),
|
|
17828
17837
|
peakToPeakVoltage: voltage4.optional(),
|
|
17829
|
-
waveShape:
|
|
17838
|
+
waveShape: z97.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17830
17839
|
phase: rotation5.optional(),
|
|
17831
17840
|
dutyCycle: percentage.optional(),
|
|
17832
17841
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -17836,9 +17845,9 @@ expectTypesMatch(true);
|
|
|
17836
17845
|
|
|
17837
17846
|
// lib/components/currentsource.ts
|
|
17838
17847
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
17839
|
-
import { z as
|
|
17848
|
+
import { z as z98 } from "zod";
|
|
17840
17849
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17841
|
-
var percentage2 =
|
|
17850
|
+
var percentage2 = z98.union([z98.string(), z98.number()]).transform((val) => {
|
|
17842
17851
|
if (typeof val === "string") {
|
|
17843
17852
|
if (val.endsWith("%")) {
|
|
17844
17853
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17847,13 +17856,13 @@ var percentage2 = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
|
17847
17856
|
}
|
|
17848
17857
|
return val;
|
|
17849
17858
|
}).pipe(
|
|
17850
|
-
|
|
17859
|
+
z98.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17851
17860
|
);
|
|
17852
17861
|
var currentSourceProps = commonComponentProps.extend({
|
|
17853
17862
|
current: current.optional(),
|
|
17854
17863
|
frequency: frequency5.optional(),
|
|
17855
17864
|
peakToPeakCurrent: current.optional(),
|
|
17856
|
-
waveShape:
|
|
17865
|
+
waveShape: z98.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17857
17866
|
phase: rotation6.optional(),
|
|
17858
17867
|
dutyCycle: percentage2.optional(),
|
|
17859
17868
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -17862,57 +17871,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
17862
17871
|
expectTypesMatch(true);
|
|
17863
17872
|
|
|
17864
17873
|
// lib/components/voltageprobe.ts
|
|
17865
|
-
import { z as
|
|
17874
|
+
import { z as z99 } from "zod";
|
|
17866
17875
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
17867
|
-
name:
|
|
17868
|
-
connectsTo:
|
|
17869
|
-
referenceTo:
|
|
17870
|
-
color:
|
|
17876
|
+
name: z99.string().optional(),
|
|
17877
|
+
connectsTo: z99.string(),
|
|
17878
|
+
referenceTo: z99.string().optional(),
|
|
17879
|
+
color: z99.string().optional()
|
|
17871
17880
|
});
|
|
17872
17881
|
expectTypesMatch(true);
|
|
17873
17882
|
|
|
17874
17883
|
// lib/components/schematic-arc.ts
|
|
17875
17884
|
import { distance as distance28, point as point5, rotation as rotation7 } from "circuit-json";
|
|
17876
|
-
import { z as
|
|
17877
|
-
var schematicArcProps =
|
|
17885
|
+
import { z as z100 } from "zod";
|
|
17886
|
+
var schematicArcProps = z100.object({
|
|
17878
17887
|
center: point5,
|
|
17879
17888
|
radius: distance28,
|
|
17880
17889
|
startAngleDegrees: rotation7,
|
|
17881
17890
|
endAngleDegrees: rotation7,
|
|
17882
|
-
direction:
|
|
17891
|
+
direction: z100.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
17883
17892
|
strokeWidth: distance28.optional(),
|
|
17884
|
-
color:
|
|
17885
|
-
isDashed:
|
|
17893
|
+
color: z100.string().optional(),
|
|
17894
|
+
isDashed: z100.boolean().optional().default(false)
|
|
17886
17895
|
});
|
|
17887
17896
|
expectTypesMatch(true);
|
|
17888
17897
|
|
|
17889
17898
|
// lib/components/toolingrail.ts
|
|
17890
|
-
import { z as
|
|
17891
|
-
var toolingrailProps =
|
|
17892
|
-
children:
|
|
17899
|
+
import { z as z101 } from "zod";
|
|
17900
|
+
var toolingrailProps = z101.object({
|
|
17901
|
+
children: z101.any().optional()
|
|
17893
17902
|
});
|
|
17894
17903
|
expectTypesMatch(true);
|
|
17895
17904
|
|
|
17896
17905
|
// lib/components/schematic-box.ts
|
|
17897
17906
|
import { distance as distance29 } from "circuit-json";
|
|
17898
|
-
import { z as
|
|
17899
|
-
var schematicBoxProps =
|
|
17907
|
+
import { z as z102 } from "zod";
|
|
17908
|
+
var schematicBoxProps = z102.object({
|
|
17900
17909
|
schX: distance29.optional(),
|
|
17901
17910
|
schY: distance29.optional(),
|
|
17902
17911
|
width: distance29.optional(),
|
|
17903
17912
|
height: distance29.optional(),
|
|
17904
|
-
overlay:
|
|
17913
|
+
overlay: z102.array(z102.string()).optional(),
|
|
17905
17914
|
padding: distance29.optional(),
|
|
17906
17915
|
paddingLeft: distance29.optional(),
|
|
17907
17916
|
paddingRight: distance29.optional(),
|
|
17908
17917
|
paddingTop: distance29.optional(),
|
|
17909
17918
|
paddingBottom: distance29.optional(),
|
|
17910
|
-
title:
|
|
17919
|
+
title: z102.string().optional(),
|
|
17911
17920
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
17912
|
-
titleColor:
|
|
17921
|
+
titleColor: z102.string().optional(),
|
|
17913
17922
|
titleFontSize: distance29.optional(),
|
|
17914
|
-
titleInside:
|
|
17915
|
-
strokeStyle:
|
|
17923
|
+
titleInside: z102.boolean().default(false),
|
|
17924
|
+
strokeStyle: z102.enum(["solid", "dashed"]).default("solid")
|
|
17916
17925
|
}).refine(
|
|
17917
17926
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
17918
17927
|
{
|
|
@@ -17928,15 +17937,15 @@ expectTypesMatch(true);
|
|
|
17928
17937
|
|
|
17929
17938
|
// lib/components/schematic-circle.ts
|
|
17930
17939
|
import { distance as distance30, point as point6 } from "circuit-json";
|
|
17931
|
-
import { z as
|
|
17932
|
-
var schematicCircleProps =
|
|
17940
|
+
import { z as z103 } from "zod";
|
|
17941
|
+
var schematicCircleProps = z103.object({
|
|
17933
17942
|
center: point6,
|
|
17934
17943
|
radius: distance30,
|
|
17935
17944
|
strokeWidth: distance30.optional(),
|
|
17936
|
-
color:
|
|
17937
|
-
isFilled:
|
|
17938
|
-
fillColor:
|
|
17939
|
-
isDashed:
|
|
17945
|
+
color: z103.string().optional(),
|
|
17946
|
+
isFilled: z103.boolean().optional().default(false),
|
|
17947
|
+
fillColor: z103.string().optional(),
|
|
17948
|
+
isDashed: z103.boolean().optional().default(false)
|
|
17940
17949
|
});
|
|
17941
17950
|
expectTypesMatch(
|
|
17942
17951
|
true
|
|
@@ -17944,43 +17953,43 @@ expectTypesMatch(
|
|
|
17944
17953
|
|
|
17945
17954
|
// lib/components/schematic-rect.ts
|
|
17946
17955
|
import { distance as distance31, rotation as rotation8 } from "circuit-json";
|
|
17947
|
-
import { z as
|
|
17948
|
-
var schematicRectProps =
|
|
17956
|
+
import { z as z104 } from "zod";
|
|
17957
|
+
var schematicRectProps = z104.object({
|
|
17949
17958
|
schX: distance31.optional(),
|
|
17950
17959
|
schY: distance31.optional(),
|
|
17951
17960
|
width: distance31,
|
|
17952
17961
|
height: distance31,
|
|
17953
17962
|
rotation: rotation8.default(0),
|
|
17954
17963
|
strokeWidth: distance31.optional(),
|
|
17955
|
-
color:
|
|
17956
|
-
isFilled:
|
|
17957
|
-
fillColor:
|
|
17958
|
-
isDashed:
|
|
17964
|
+
color: z104.string().optional(),
|
|
17965
|
+
isFilled: z104.boolean().optional().default(false),
|
|
17966
|
+
fillColor: z104.string().optional(),
|
|
17967
|
+
isDashed: z104.boolean().optional().default(false),
|
|
17959
17968
|
cornerRadius: distance31.optional()
|
|
17960
17969
|
});
|
|
17961
17970
|
expectTypesMatch(true);
|
|
17962
17971
|
|
|
17963
17972
|
// lib/components/schematic-line.ts
|
|
17964
17973
|
import { distance as distance32 } from "circuit-json";
|
|
17965
|
-
import { z as
|
|
17966
|
-
var schematicLineProps =
|
|
17974
|
+
import { z as z105 } from "zod";
|
|
17975
|
+
var schematicLineProps = z105.object({
|
|
17967
17976
|
x1: distance32,
|
|
17968
17977
|
y1: distance32,
|
|
17969
17978
|
x2: distance32,
|
|
17970
17979
|
y2: distance32,
|
|
17971
17980
|
strokeWidth: distance32.optional(),
|
|
17972
|
-
color:
|
|
17973
|
-
isDashed:
|
|
17981
|
+
color: z105.string().optional(),
|
|
17982
|
+
isDashed: z105.boolean().optional().default(false)
|
|
17974
17983
|
});
|
|
17975
17984
|
expectTypesMatch(true);
|
|
17976
17985
|
|
|
17977
17986
|
// lib/components/schematic-text.ts
|
|
17978
17987
|
import { distance as distance33, rotation as rotation9 } from "circuit-json";
|
|
17979
|
-
import { z as
|
|
17988
|
+
import { z as z107 } from "zod";
|
|
17980
17989
|
|
|
17981
17990
|
// lib/common/fivePointAnchor.ts
|
|
17982
|
-
import { z as
|
|
17983
|
-
var fivePointAnchor =
|
|
17991
|
+
import { z as z106 } from "zod";
|
|
17992
|
+
var fivePointAnchor = z106.enum([
|
|
17984
17993
|
"center",
|
|
17985
17994
|
"left",
|
|
17986
17995
|
"right",
|
|
@@ -17989,37 +17998,37 @@ var fivePointAnchor = z105.enum([
|
|
|
17989
17998
|
]);
|
|
17990
17999
|
|
|
17991
18000
|
// lib/components/schematic-text.ts
|
|
17992
|
-
var schematicTextProps =
|
|
18001
|
+
var schematicTextProps = z107.object({
|
|
17993
18002
|
schX: distance33.optional(),
|
|
17994
18003
|
schY: distance33.optional(),
|
|
17995
|
-
text:
|
|
17996
|
-
fontSize:
|
|
17997
|
-
anchor:
|
|
17998
|
-
color:
|
|
18004
|
+
text: z107.string(),
|
|
18005
|
+
fontSize: z107.number().default(1),
|
|
18006
|
+
anchor: z107.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18007
|
+
color: z107.string().default("#000000"),
|
|
17999
18008
|
schRotation: rotation9.default(0)
|
|
18000
18009
|
});
|
|
18001
18010
|
expectTypesMatch(true);
|
|
18002
18011
|
|
|
18003
18012
|
// lib/components/schematic-path.ts
|
|
18004
18013
|
import { distance as distance34, point as point8 } from "circuit-json";
|
|
18005
|
-
import { z as
|
|
18006
|
-
var schematicPathProps =
|
|
18007
|
-
points:
|
|
18008
|
-
svgPath:
|
|
18014
|
+
import { z as z108 } from "zod";
|
|
18015
|
+
var schematicPathProps = z108.object({
|
|
18016
|
+
points: z108.array(point8).optional(),
|
|
18017
|
+
svgPath: z108.string().optional(),
|
|
18009
18018
|
strokeWidth: distance34.optional(),
|
|
18010
|
-
strokeColor:
|
|
18011
|
-
isFilled:
|
|
18012
|
-
fillColor:
|
|
18019
|
+
strokeColor: z108.string().optional(),
|
|
18020
|
+
isFilled: z108.boolean().optional().default(false),
|
|
18021
|
+
fillColor: z108.string().optional()
|
|
18013
18022
|
});
|
|
18014
18023
|
expectTypesMatch(true);
|
|
18015
18024
|
|
|
18016
18025
|
// lib/components/schematic-table.ts
|
|
18017
18026
|
import { distance as distance35 } from "circuit-json";
|
|
18018
|
-
import { z as
|
|
18019
|
-
var schematicTableProps =
|
|
18027
|
+
import { z as z109 } from "zod";
|
|
18028
|
+
var schematicTableProps = z109.object({
|
|
18020
18029
|
schX: distance35.optional(),
|
|
18021
18030
|
schY: distance35.optional(),
|
|
18022
|
-
children:
|
|
18031
|
+
children: z109.any().optional(),
|
|
18023
18032
|
cellPadding: distance35.optional(),
|
|
18024
18033
|
borderWidth: distance35.optional(),
|
|
18025
18034
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18029,64 +18038,64 @@ expectTypesMatch(true);
|
|
|
18029
18038
|
|
|
18030
18039
|
// lib/components/schematic-row.ts
|
|
18031
18040
|
import { distance as distance36 } from "circuit-json";
|
|
18032
|
-
import { z as
|
|
18033
|
-
var schematicRowProps =
|
|
18034
|
-
children:
|
|
18041
|
+
import { z as z110 } from "zod";
|
|
18042
|
+
var schematicRowProps = z110.object({
|
|
18043
|
+
children: z110.any().optional(),
|
|
18035
18044
|
height: distance36.optional()
|
|
18036
18045
|
});
|
|
18037
18046
|
expectTypesMatch(true);
|
|
18038
18047
|
|
|
18039
18048
|
// lib/components/schematic-cell.ts
|
|
18040
18049
|
import { distance as distance37 } from "circuit-json";
|
|
18041
|
-
import { z as
|
|
18042
|
-
var schematicCellProps =
|
|
18043
|
-
children:
|
|
18044
|
-
horizontalAlign:
|
|
18045
|
-
verticalAlign:
|
|
18050
|
+
import { z as z111 } from "zod";
|
|
18051
|
+
var schematicCellProps = z111.object({
|
|
18052
|
+
children: z111.string().optional(),
|
|
18053
|
+
horizontalAlign: z111.enum(["left", "center", "right"]).optional(),
|
|
18054
|
+
verticalAlign: z111.enum(["top", "middle", "bottom"]).optional(),
|
|
18046
18055
|
fontSize: distance37.optional(),
|
|
18047
|
-
rowSpan:
|
|
18048
|
-
colSpan:
|
|
18056
|
+
rowSpan: z111.number().optional(),
|
|
18057
|
+
colSpan: z111.number().optional(),
|
|
18049
18058
|
width: distance37.optional(),
|
|
18050
|
-
text:
|
|
18059
|
+
text: z111.string().optional()
|
|
18051
18060
|
});
|
|
18052
18061
|
expectTypesMatch(true);
|
|
18053
18062
|
|
|
18054
18063
|
// lib/components/copper-text.ts
|
|
18055
18064
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18056
|
-
import { z as
|
|
18065
|
+
import { z as z112 } from "zod";
|
|
18057
18066
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18058
|
-
text:
|
|
18067
|
+
text: z112.string(),
|
|
18059
18068
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18060
|
-
font:
|
|
18069
|
+
font: z112.enum(["tscircuit2024"]).optional(),
|
|
18061
18070
|
fontSize: length8.optional(),
|
|
18062
|
-
layers:
|
|
18063
|
-
knockout:
|
|
18064
|
-
mirrored:
|
|
18071
|
+
layers: z112.array(layer_ref10).optional(),
|
|
18072
|
+
knockout: z112.boolean().optional(),
|
|
18073
|
+
mirrored: z112.boolean().optional()
|
|
18065
18074
|
});
|
|
18066
18075
|
|
|
18067
18076
|
// lib/components/silkscreen-text.ts
|
|
18068
18077
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18069
|
-
import { z as
|
|
18078
|
+
import { z as z113 } from "zod";
|
|
18070
18079
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18071
|
-
text:
|
|
18080
|
+
text: z113.string(),
|
|
18072
18081
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18073
|
-
font:
|
|
18082
|
+
font: z113.enum(["tscircuit2024"]).optional(),
|
|
18074
18083
|
fontSize: length9.optional(),
|
|
18075
18084
|
/**
|
|
18076
18085
|
* If true, text will knock out underlying silkscreen
|
|
18077
18086
|
*/
|
|
18078
|
-
isKnockout:
|
|
18087
|
+
isKnockout: z113.boolean().optional(),
|
|
18079
18088
|
knockoutPadding: length9.optional(),
|
|
18080
18089
|
knockoutPaddingLeft: length9.optional(),
|
|
18081
18090
|
knockoutPaddingRight: length9.optional(),
|
|
18082
18091
|
knockoutPaddingTop: length9.optional(),
|
|
18083
18092
|
knockoutPaddingBottom: length9.optional(),
|
|
18084
|
-
layers:
|
|
18093
|
+
layers: z113.array(layer_ref11).optional()
|
|
18085
18094
|
});
|
|
18086
18095
|
|
|
18087
18096
|
// lib/components/silkscreen-path.ts
|
|
18088
18097
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18089
|
-
import { z as
|
|
18098
|
+
import { z as z114 } from "zod";
|
|
18090
18099
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18091
18100
|
pcbLeftEdgeX: true,
|
|
18092
18101
|
pcbRightEdgeX: true,
|
|
@@ -18098,7 +18107,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18098
18107
|
pcbOffsetY: true,
|
|
18099
18108
|
pcbRotation: true
|
|
18100
18109
|
}).extend({
|
|
18101
|
-
route:
|
|
18110
|
+
route: z114.array(route_hint_point5),
|
|
18102
18111
|
strokeWidth: length10.optional()
|
|
18103
18112
|
});
|
|
18104
18113
|
|
|
@@ -18120,10 +18129,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18120
18129
|
|
|
18121
18130
|
// lib/components/silkscreen-rect.ts
|
|
18122
18131
|
import { distance as distance39 } from "circuit-json";
|
|
18123
|
-
import { z as
|
|
18132
|
+
import { z as z115 } from "zod";
|
|
18124
18133
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18125
|
-
filled:
|
|
18126
|
-
stroke:
|
|
18134
|
+
filled: z115.boolean().default(true).optional(),
|
|
18135
|
+
stroke: z115.enum(["dashed", "solid", "none"]).optional(),
|
|
18127
18136
|
strokeWidth: distance39.optional(),
|
|
18128
18137
|
width: distance39,
|
|
18129
18138
|
height: distance39,
|
|
@@ -18132,73 +18141,73 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18132
18141
|
|
|
18133
18142
|
// lib/components/silkscreen-circle.ts
|
|
18134
18143
|
import { distance as distance40 } from "circuit-json";
|
|
18135
|
-
import { z as
|
|
18144
|
+
import { z as z116 } from "zod";
|
|
18136
18145
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18137
|
-
isFilled:
|
|
18138
|
-
isOutline:
|
|
18146
|
+
isFilled: z116.boolean().optional(),
|
|
18147
|
+
isOutline: z116.boolean().optional(),
|
|
18139
18148
|
strokeWidth: distance40.optional(),
|
|
18140
18149
|
radius: distance40
|
|
18141
18150
|
});
|
|
18142
18151
|
|
|
18143
18152
|
// lib/components/trace-hint.ts
|
|
18144
18153
|
import { distance as distance41, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18145
|
-
import { z as
|
|
18146
|
-
var routeHintPointProps =
|
|
18154
|
+
import { z as z117 } from "zod";
|
|
18155
|
+
var routeHintPointProps = z117.object({
|
|
18147
18156
|
x: distance41,
|
|
18148
18157
|
y: distance41,
|
|
18149
|
-
via:
|
|
18158
|
+
via: z117.boolean().optional(),
|
|
18150
18159
|
toLayer: layer_ref12.optional()
|
|
18151
18160
|
});
|
|
18152
|
-
var traceHintProps =
|
|
18153
|
-
for:
|
|
18161
|
+
var traceHintProps = z117.object({
|
|
18162
|
+
for: z117.string().optional().describe(
|
|
18154
18163
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18155
18164
|
),
|
|
18156
|
-
order:
|
|
18165
|
+
order: z117.number().optional(),
|
|
18157
18166
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18158
|
-
offsets:
|
|
18159
|
-
traceWidth:
|
|
18167
|
+
offsets: z117.array(route_hint_point6).or(z117.array(routeHintPointProps)).optional(),
|
|
18168
|
+
traceWidth: z117.number().optional()
|
|
18160
18169
|
});
|
|
18161
18170
|
|
|
18162
18171
|
// lib/components/port.ts
|
|
18163
|
-
import { z as
|
|
18172
|
+
import { z as z118 } from "zod";
|
|
18164
18173
|
var portProps = commonLayoutProps.extend({
|
|
18165
|
-
name:
|
|
18166
|
-
pinNumber:
|
|
18167
|
-
schStemLength:
|
|
18168
|
-
aliases:
|
|
18169
|
-
layer:
|
|
18170
|
-
layers:
|
|
18171
|
-
schX:
|
|
18172
|
-
schY:
|
|
18174
|
+
name: z118.string(),
|
|
18175
|
+
pinNumber: z118.number().optional(),
|
|
18176
|
+
schStemLength: z118.number().optional(),
|
|
18177
|
+
aliases: z118.array(z118.string()).optional(),
|
|
18178
|
+
layer: z118.string().optional(),
|
|
18179
|
+
layers: z118.array(z118.string()).optional(),
|
|
18180
|
+
schX: z118.number().optional(),
|
|
18181
|
+
schY: z118.number().optional(),
|
|
18173
18182
|
direction,
|
|
18174
|
-
connectsTo:
|
|
18183
|
+
connectsTo: z118.string().or(z118.array(z118.string())).optional(),
|
|
18175
18184
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18176
|
-
hasInversionCircle:
|
|
18185
|
+
hasInversionCircle: z118.boolean().optional()
|
|
18177
18186
|
});
|
|
18178
18187
|
|
|
18179
18188
|
// lib/components/pcb-note-text.ts
|
|
18180
18189
|
import { length as length11 } from "circuit-json";
|
|
18181
|
-
import { z as
|
|
18190
|
+
import { z as z119 } from "zod";
|
|
18182
18191
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18183
|
-
text:
|
|
18184
|
-
anchorAlignment:
|
|
18185
|
-
font:
|
|
18192
|
+
text: z119.string(),
|
|
18193
|
+
anchorAlignment: z119.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18194
|
+
font: z119.enum(["tscircuit2024"]).optional(),
|
|
18186
18195
|
fontSize: length11.optional(),
|
|
18187
|
-
color:
|
|
18196
|
+
color: z119.string().optional()
|
|
18188
18197
|
});
|
|
18189
18198
|
expectTypesMatch(true);
|
|
18190
18199
|
|
|
18191
18200
|
// lib/components/pcb-note-rect.ts
|
|
18192
18201
|
import { distance as distance42 } from "circuit-json";
|
|
18193
|
-
import { z as
|
|
18202
|
+
import { z as z120 } from "zod";
|
|
18194
18203
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18195
18204
|
width: distance42,
|
|
18196
18205
|
height: distance42,
|
|
18197
18206
|
strokeWidth: distance42.optional(),
|
|
18198
|
-
isFilled:
|
|
18199
|
-
hasStroke:
|
|
18200
|
-
isStrokeDashed:
|
|
18201
|
-
color:
|
|
18207
|
+
isFilled: z120.boolean().optional(),
|
|
18208
|
+
hasStroke: z120.boolean().optional(),
|
|
18209
|
+
isStrokeDashed: z120.boolean().optional(),
|
|
18210
|
+
color: z120.string().optional(),
|
|
18202
18211
|
cornerRadius: distance42.optional()
|
|
18203
18212
|
});
|
|
18204
18213
|
expectTypesMatch(true);
|
|
@@ -18208,7 +18217,7 @@ import {
|
|
|
18208
18217
|
length as length12,
|
|
18209
18218
|
route_hint_point as route_hint_point7
|
|
18210
18219
|
} from "circuit-json";
|
|
18211
|
-
import { z as
|
|
18220
|
+
import { z as z121 } from "zod";
|
|
18212
18221
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18213
18222
|
pcbLeftEdgeX: true,
|
|
18214
18223
|
pcbRightEdgeX: true,
|
|
@@ -18220,15 +18229,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18220
18229
|
pcbOffsetY: true,
|
|
18221
18230
|
pcbRotation: true
|
|
18222
18231
|
}).extend({
|
|
18223
|
-
route:
|
|
18232
|
+
route: z121.array(route_hint_point7),
|
|
18224
18233
|
strokeWidth: length12.optional(),
|
|
18225
|
-
color:
|
|
18234
|
+
color: z121.string().optional()
|
|
18226
18235
|
});
|
|
18227
18236
|
expectTypesMatch(true);
|
|
18228
18237
|
|
|
18229
18238
|
// lib/components/pcb-note-line.ts
|
|
18230
18239
|
import { distance as distance43 } from "circuit-json";
|
|
18231
|
-
import { z as
|
|
18240
|
+
import { z as z122 } from "zod";
|
|
18232
18241
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18233
18242
|
pcbLeftEdgeX: true,
|
|
18234
18243
|
pcbRightEdgeX: true,
|
|
@@ -18245,15 +18254,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18245
18254
|
x2: distance43,
|
|
18246
18255
|
y2: distance43,
|
|
18247
18256
|
strokeWidth: distance43.optional(),
|
|
18248
|
-
color:
|
|
18249
|
-
isDashed:
|
|
18257
|
+
color: z122.string().optional(),
|
|
18258
|
+
isDashed: z122.boolean().optional()
|
|
18250
18259
|
});
|
|
18251
18260
|
expectTypesMatch(true);
|
|
18252
18261
|
|
|
18253
18262
|
// lib/components/pcb-note-dimension.ts
|
|
18254
18263
|
import { distance as distance44, length as length13 } from "circuit-json";
|
|
18255
|
-
import { z as
|
|
18256
|
-
var dimensionTarget2 =
|
|
18264
|
+
import { z as z123 } from "zod";
|
|
18265
|
+
var dimensionTarget2 = z123.union([z123.string(), point]);
|
|
18257
18266
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18258
18267
|
pcbLeftEdgeX: true,
|
|
18259
18268
|
pcbRightEdgeX: true,
|
|
@@ -18267,101 +18276,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18267
18276
|
}).extend({
|
|
18268
18277
|
from: dimensionTarget2,
|
|
18269
18278
|
to: dimensionTarget2,
|
|
18270
|
-
text:
|
|
18279
|
+
text: z123.string().optional(),
|
|
18271
18280
|
offset: distance44.optional(),
|
|
18272
|
-
font:
|
|
18281
|
+
font: z123.enum(["tscircuit2024"]).optional(),
|
|
18273
18282
|
fontSize: length13.optional(),
|
|
18274
|
-
color:
|
|
18283
|
+
color: z123.string().optional(),
|
|
18275
18284
|
arrowSize: distance44.optional(),
|
|
18276
|
-
units:
|
|
18277
|
-
outerEdgeToEdge:
|
|
18278
|
-
centerToCenter:
|
|
18279
|
-
innerEdgeToEdge:
|
|
18285
|
+
units: z123.enum(["in", "mm"]).optional(),
|
|
18286
|
+
outerEdgeToEdge: z123.literal(true).optional(),
|
|
18287
|
+
centerToCenter: z123.literal(true).optional(),
|
|
18288
|
+
innerEdgeToEdge: z123.literal(true).optional()
|
|
18280
18289
|
});
|
|
18281
18290
|
expectTypesMatch(
|
|
18282
18291
|
true
|
|
18283
18292
|
);
|
|
18284
18293
|
|
|
18285
18294
|
// lib/platformConfig.ts
|
|
18286
|
-
import { z as
|
|
18287
|
-
var unvalidatedCircuitJson =
|
|
18288
|
-
var footprintLibraryResult =
|
|
18289
|
-
footprintCircuitJson:
|
|
18295
|
+
import { z as z124 } from "zod";
|
|
18296
|
+
var unvalidatedCircuitJson = z124.array(z124.any()).describe("Circuit JSON");
|
|
18297
|
+
var footprintLibraryResult = z124.object({
|
|
18298
|
+
footprintCircuitJson: z124.array(z124.any()),
|
|
18290
18299
|
cadModel: cadModelProp.optional()
|
|
18291
18300
|
});
|
|
18292
|
-
var pathToCircuitJsonFn =
|
|
18293
|
-
|
|
18294
|
-
|
|
18295
|
-
|
|
18296
|
-
).returns(
|
|
18301
|
+
var pathToCircuitJsonFn = z124.function().args(z124.string()).returns(z124.promise(footprintLibraryResult)).or(
|
|
18302
|
+
z124.function().args(
|
|
18303
|
+
z124.string(),
|
|
18304
|
+
z124.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18305
|
+
).returns(z124.promise(footprintLibraryResult))
|
|
18297
18306
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18298
|
-
var footprintFileParserEntry =
|
|
18299
|
-
loadFromUrl:
|
|
18307
|
+
var footprintFileParserEntry = z124.object({
|
|
18308
|
+
loadFromUrl: z124.function().args(z124.string()).returns(z124.promise(footprintLibraryResult)).describe(
|
|
18300
18309
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18301
18310
|
)
|
|
18302
18311
|
});
|
|
18303
|
-
var spiceEngineSimulationResult =
|
|
18304
|
-
engineVersionString:
|
|
18312
|
+
var spiceEngineSimulationResult = z124.object({
|
|
18313
|
+
engineVersionString: z124.string().optional(),
|
|
18305
18314
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18306
18315
|
});
|
|
18307
|
-
var spiceEngineZod =
|
|
18308
|
-
simulate:
|
|
18316
|
+
var spiceEngineZod = z124.object({
|
|
18317
|
+
simulate: z124.function().args(z124.string()).returns(z124.promise(spiceEngineSimulationResult)).describe(
|
|
18309
18318
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18310
18319
|
)
|
|
18311
18320
|
});
|
|
18312
|
-
var defaultSpiceEngine =
|
|
18321
|
+
var defaultSpiceEngine = z124.custom(
|
|
18313
18322
|
(value) => typeof value === "string"
|
|
18314
18323
|
);
|
|
18315
|
-
var autorouterInstance =
|
|
18316
|
-
run:
|
|
18317
|
-
getOutputSimpleRouteJson:
|
|
18324
|
+
var autorouterInstance = z124.object({
|
|
18325
|
+
run: z124.function().args().returns(z124.promise(z124.unknown())).describe("Run the autorouter"),
|
|
18326
|
+
getOutputSimpleRouteJson: z124.function().args().returns(z124.promise(z124.any())).describe("Get the resulting SimpleRouteJson")
|
|
18318
18327
|
});
|
|
18319
|
-
var autorouterDefinition =
|
|
18320
|
-
createAutorouter:
|
|
18328
|
+
var autorouterDefinition = z124.object({
|
|
18329
|
+
createAutorouter: z124.function().args(z124.any(), z124.any().optional()).returns(z124.union([autorouterInstance, z124.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18321
18330
|
});
|
|
18322
|
-
var platformFetch =
|
|
18323
|
-
var platformConfig =
|
|
18331
|
+
var platformFetch = z124.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18332
|
+
var platformConfig = z124.object({
|
|
18324
18333
|
partsEngine: partsEngine.optional(),
|
|
18325
18334
|
autorouter: autorouterProp.optional(),
|
|
18326
|
-
autorouterMap:
|
|
18335
|
+
autorouterMap: z124.record(z124.string(), autorouterDefinition).optional(),
|
|
18327
18336
|
registryApiUrl: url.optional(),
|
|
18328
18337
|
cloudAutorouterUrl: url.optional(),
|
|
18329
|
-
projectName:
|
|
18338
|
+
projectName: z124.string().optional(),
|
|
18330
18339
|
projectBaseUrl: url.optional(),
|
|
18331
|
-
version:
|
|
18340
|
+
version: z124.string().optional(),
|
|
18332
18341
|
url: url.optional(),
|
|
18333
|
-
printBoardInformationToSilkscreen:
|
|
18334
|
-
includeBoardFiles:
|
|
18342
|
+
printBoardInformationToSilkscreen: z124.boolean().optional(),
|
|
18343
|
+
includeBoardFiles: z124.array(z124.string()).describe(
|
|
18335
18344
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18336
18345
|
).optional(),
|
|
18337
|
-
snapshotsDir:
|
|
18346
|
+
snapshotsDir: z124.string().describe(
|
|
18338
18347
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18339
18348
|
).optional(),
|
|
18340
18349
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18341
|
-
unitPreference:
|
|
18342
|
-
localCacheEngine:
|
|
18343
|
-
pcbDisabled:
|
|
18344
|
-
routingDisabled:
|
|
18345
|
-
schematicDisabled:
|
|
18346
|
-
partsEngineDisabled:
|
|
18347
|
-
drcChecksDisabled:
|
|
18348
|
-
netlistDrcChecksDisabled:
|
|
18349
|
-
routingDrcChecksDisabled:
|
|
18350
|
-
placementDrcChecksDisabled:
|
|
18351
|
-
pinSpecificationDrcChecksDisabled:
|
|
18352
|
-
spiceEngineMap:
|
|
18353
|
-
footprintLibraryMap:
|
|
18354
|
-
|
|
18355
|
-
|
|
18350
|
+
unitPreference: z124.enum(["mm", "in", "mil"]).optional(),
|
|
18351
|
+
localCacheEngine: z124.any().optional(),
|
|
18352
|
+
pcbDisabled: z124.boolean().optional(),
|
|
18353
|
+
routingDisabled: z124.boolean().optional(),
|
|
18354
|
+
schematicDisabled: z124.boolean().optional(),
|
|
18355
|
+
partsEngineDisabled: z124.boolean().optional(),
|
|
18356
|
+
drcChecksDisabled: z124.boolean().optional(),
|
|
18357
|
+
netlistDrcChecksDisabled: z124.boolean().optional(),
|
|
18358
|
+
routingDrcChecksDisabled: z124.boolean().optional(),
|
|
18359
|
+
placementDrcChecksDisabled: z124.boolean().optional(),
|
|
18360
|
+
pinSpecificationDrcChecksDisabled: z124.boolean().optional(),
|
|
18361
|
+
spiceEngineMap: z124.record(z124.string(), spiceEngineZod).optional(),
|
|
18362
|
+
footprintLibraryMap: z124.record(
|
|
18363
|
+
z124.string(),
|
|
18364
|
+
z124.union([
|
|
18356
18365
|
pathToCircuitJsonFn,
|
|
18357
|
-
|
|
18358
|
-
|
|
18359
|
-
|
|
18366
|
+
z124.record(
|
|
18367
|
+
z124.string(),
|
|
18368
|
+
z124.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18360
18369
|
)
|
|
18361
18370
|
])
|
|
18362
18371
|
).optional(),
|
|
18363
|
-
footprintFileParserMap:
|
|
18364
|
-
resolveProjectStaticFileImportUrl:
|
|
18372
|
+
footprintFileParserMap: z124.record(z124.string(), footprintFileParserEntry).optional(),
|
|
18373
|
+
resolveProjectStaticFileImportUrl: z124.function().args(z124.string()).returns(z124.promise(z124.string())).describe(
|
|
18365
18374
|
"A function that returns a string URL for static files for the project"
|
|
18366
18375
|
).optional(),
|
|
18367
18376
|
platformFetch: platformFetch.optional()
|
|
@@ -18388,6 +18397,7 @@ export {
|
|
|
18388
18397
|
autorouterEffortLevel,
|
|
18389
18398
|
autorouterPreset,
|
|
18390
18399
|
autorouterProp,
|
|
18400
|
+
autoroutingPhaseProps,
|
|
18391
18401
|
baseGroupProps,
|
|
18392
18402
|
base_manual_edit_event,
|
|
18393
18403
|
batteryPins,
|