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