@tscircuit/props 0.0.516 → 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 +15 -0
- package/dist/index.d.ts +45 -1
- package/dist/index.js +305 -294
- package/dist/index.js.map +1 -1
- package/lib/components/autoroutingphase.ts +16 -0
- package/lib/components/group.ts +1 -0
- package/lib/components/jumper.ts +1 -0
- package/lib/components/pcb-keepout.ts +3 -1
- package/lib/components/pin-header.ts +1 -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,43 +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
|
-
import { distance as distance24 } from "circuit-json";
|
|
17691
|
-
import { z as
|
|
17692
|
-
var pcbKeepoutProps =
|
|
17698
|
+
import { distance as distance24, layer_ref as layer_ref7 } from "circuit-json";
|
|
17699
|
+
import { z as z89 } from "zod";
|
|
17700
|
+
var pcbKeepoutProps = z89.union([
|
|
17693
17701
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17694
|
-
shape:
|
|
17695
|
-
radius: distance24
|
|
17702
|
+
shape: z89.literal("circle"),
|
|
17703
|
+
radius: distance24,
|
|
17704
|
+
layers: z89.array(layer_ref7).optional()
|
|
17696
17705
|
}),
|
|
17697
17706
|
pcbLayoutProps.extend({
|
|
17698
|
-
shape:
|
|
17707
|
+
shape: z89.literal("rect"),
|
|
17699
17708
|
width: distance24,
|
|
17700
|
-
height: distance24
|
|
17709
|
+
height: distance24,
|
|
17710
|
+
layers: z89.array(layer_ref7).optional()
|
|
17701
17711
|
})
|
|
17702
17712
|
]);
|
|
17703
17713
|
|
|
17704
17714
|
// lib/components/courtyard-rect.ts
|
|
17705
17715
|
import { distance as distance25 } from "circuit-json";
|
|
17706
|
-
import { z as
|
|
17716
|
+
import { z as z90 } from "zod";
|
|
17707
17717
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17708
17718
|
width: distance25,
|
|
17709
17719
|
height: distance25,
|
|
17710
17720
|
strokeWidth: distance25.optional(),
|
|
17711
|
-
isFilled:
|
|
17712
|
-
hasStroke:
|
|
17713
|
-
isStrokeDashed:
|
|
17714
|
-
color:
|
|
17721
|
+
isFilled: z90.boolean().optional(),
|
|
17722
|
+
hasStroke: z90.boolean().optional(),
|
|
17723
|
+
isStrokeDashed: z90.boolean().optional(),
|
|
17724
|
+
color: z90.string().optional()
|
|
17715
17725
|
});
|
|
17716
17726
|
|
|
17717
17727
|
// lib/components/courtyard-outline.ts
|
|
17718
17728
|
import { length as length7 } from "circuit-json";
|
|
17719
|
-
import { z as
|
|
17729
|
+
import { z as z91 } from "zod";
|
|
17720
17730
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17721
17731
|
pcbLeftEdgeX: true,
|
|
17722
17732
|
pcbRightEdgeX: true,
|
|
@@ -17728,11 +17738,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17728
17738
|
pcbOffsetY: true,
|
|
17729
17739
|
pcbRotation: true
|
|
17730
17740
|
}).extend({
|
|
17731
|
-
outline:
|
|
17741
|
+
outline: z91.array(point),
|
|
17732
17742
|
strokeWidth: length7.optional(),
|
|
17733
|
-
isClosed:
|
|
17734
|
-
isStrokeDashed:
|
|
17735
|
-
color:
|
|
17743
|
+
isClosed: z91.boolean().optional(),
|
|
17744
|
+
isStrokeDashed: z91.boolean().optional(),
|
|
17745
|
+
color: z91.string().optional()
|
|
17736
17746
|
});
|
|
17737
17747
|
|
|
17738
17748
|
// lib/components/courtyard-circle.ts
|
|
@@ -17752,35 +17762,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17752
17762
|
});
|
|
17753
17763
|
|
|
17754
17764
|
// lib/components/copper-pour.ts
|
|
17755
|
-
import { z as
|
|
17756
|
-
import { layer_ref as
|
|
17757
|
-
var copperPourProps =
|
|
17758
|
-
name:
|
|
17759
|
-
layer:
|
|
17760
|
-
connectsTo:
|
|
17761
|
-
unbroken:
|
|
17765
|
+
import { z as z94 } from "zod";
|
|
17766
|
+
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17767
|
+
var copperPourProps = z94.object({
|
|
17768
|
+
name: z94.string().optional(),
|
|
17769
|
+
layer: layer_ref8,
|
|
17770
|
+
connectsTo: z94.string(),
|
|
17771
|
+
unbroken: z94.boolean().optional(),
|
|
17762
17772
|
padMargin: distance.optional(),
|
|
17763
17773
|
traceMargin: distance.optional(),
|
|
17764
17774
|
clearance: distance.optional(),
|
|
17765
17775
|
boardEdgeMargin: distance.optional(),
|
|
17766
17776
|
cutoutMargin: distance.optional(),
|
|
17767
|
-
outline:
|
|
17768
|
-
coveredWithSolderMask:
|
|
17777
|
+
outline: z94.array(point).optional(),
|
|
17778
|
+
coveredWithSolderMask: z94.boolean().optional().default(true)
|
|
17769
17779
|
});
|
|
17770
17780
|
expectTypesMatch(true);
|
|
17771
17781
|
|
|
17772
17782
|
// lib/components/cadassembly.ts
|
|
17773
|
-
import { layer_ref as
|
|
17774
|
-
import { z as
|
|
17775
|
-
var cadassemblyProps =
|
|
17776
|
-
originalLayer:
|
|
17777
|
-
children:
|
|
17783
|
+
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
17784
|
+
import { z as z95 } from "zod";
|
|
17785
|
+
var cadassemblyProps = z95.object({
|
|
17786
|
+
originalLayer: layer_ref9.default("top").optional(),
|
|
17787
|
+
children: z95.any().optional()
|
|
17778
17788
|
});
|
|
17779
17789
|
expectTypesMatch(true);
|
|
17780
17790
|
|
|
17781
17791
|
// lib/components/cadmodel.ts
|
|
17782
|
-
import { z as
|
|
17783
|
-
var pcbPosition =
|
|
17792
|
+
import { z as z96 } from "zod";
|
|
17793
|
+
var pcbPosition = z96.object({
|
|
17784
17794
|
pcbX: pcbCoordinate.optional(),
|
|
17785
17795
|
pcbY: pcbCoordinate.optional(),
|
|
17786
17796
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -17797,7 +17807,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
17797
17807
|
});
|
|
17798
17808
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
17799
17809
|
expectTypesMatch(true);
|
|
17800
|
-
var cadmodelProps =
|
|
17810
|
+
var cadmodelProps = z96.union([z96.null(), url, cadModelObject]);
|
|
17801
17811
|
|
|
17802
17812
|
// lib/components/power-source.ts
|
|
17803
17813
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -17807,9 +17817,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
17807
17817
|
|
|
17808
17818
|
// lib/components/voltagesource.ts
|
|
17809
17819
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
17810
|
-
import { z as
|
|
17820
|
+
import { z as z97 } from "zod";
|
|
17811
17821
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17812
|
-
var percentage =
|
|
17822
|
+
var percentage = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
17813
17823
|
if (typeof val === "string") {
|
|
17814
17824
|
if (val.endsWith("%")) {
|
|
17815
17825
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17818,13 +17828,13 @@ var percentage = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
|
17818
17828
|
}
|
|
17819
17829
|
return val;
|
|
17820
17830
|
}).pipe(
|
|
17821
|
-
|
|
17831
|
+
z97.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17822
17832
|
);
|
|
17823
17833
|
var voltageSourceProps = commonComponentProps.extend({
|
|
17824
17834
|
voltage: voltage4.optional(),
|
|
17825
17835
|
frequency: frequency4.optional(),
|
|
17826
17836
|
peakToPeakVoltage: voltage4.optional(),
|
|
17827
|
-
waveShape:
|
|
17837
|
+
waveShape: z97.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17828
17838
|
phase: rotation5.optional(),
|
|
17829
17839
|
dutyCycle: percentage.optional(),
|
|
17830
17840
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -17834,9 +17844,9 @@ expectTypesMatch(true);
|
|
|
17834
17844
|
|
|
17835
17845
|
// lib/components/currentsource.ts
|
|
17836
17846
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
17837
|
-
import { z as
|
|
17847
|
+
import { z as z98 } from "zod";
|
|
17838
17848
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17839
|
-
var percentage2 =
|
|
17849
|
+
var percentage2 = z98.union([z98.string(), z98.number()]).transform((val) => {
|
|
17840
17850
|
if (typeof val === "string") {
|
|
17841
17851
|
if (val.endsWith("%")) {
|
|
17842
17852
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17845,13 +17855,13 @@ var percentage2 = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
|
17845
17855
|
}
|
|
17846
17856
|
return val;
|
|
17847
17857
|
}).pipe(
|
|
17848
|
-
|
|
17858
|
+
z98.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17849
17859
|
);
|
|
17850
17860
|
var currentSourceProps = commonComponentProps.extend({
|
|
17851
17861
|
current: current.optional(),
|
|
17852
17862
|
frequency: frequency5.optional(),
|
|
17853
17863
|
peakToPeakCurrent: current.optional(),
|
|
17854
|
-
waveShape:
|
|
17864
|
+
waveShape: z98.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17855
17865
|
phase: rotation6.optional(),
|
|
17856
17866
|
dutyCycle: percentage2.optional(),
|
|
17857
17867
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -17860,57 +17870,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
17860
17870
|
expectTypesMatch(true);
|
|
17861
17871
|
|
|
17862
17872
|
// lib/components/voltageprobe.ts
|
|
17863
|
-
import { z as
|
|
17873
|
+
import { z as z99 } from "zod";
|
|
17864
17874
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
17865
|
-
name:
|
|
17866
|
-
connectsTo:
|
|
17867
|
-
referenceTo:
|
|
17868
|
-
color:
|
|
17875
|
+
name: z99.string().optional(),
|
|
17876
|
+
connectsTo: z99.string(),
|
|
17877
|
+
referenceTo: z99.string().optional(),
|
|
17878
|
+
color: z99.string().optional()
|
|
17869
17879
|
});
|
|
17870
17880
|
expectTypesMatch(true);
|
|
17871
17881
|
|
|
17872
17882
|
// lib/components/schematic-arc.ts
|
|
17873
17883
|
import { distance as distance28, point as point5, rotation as rotation7 } from "circuit-json";
|
|
17874
|
-
import { z as
|
|
17875
|
-
var schematicArcProps =
|
|
17884
|
+
import { z as z100 } from "zod";
|
|
17885
|
+
var schematicArcProps = z100.object({
|
|
17876
17886
|
center: point5,
|
|
17877
17887
|
radius: distance28,
|
|
17878
17888
|
startAngleDegrees: rotation7,
|
|
17879
17889
|
endAngleDegrees: rotation7,
|
|
17880
|
-
direction:
|
|
17890
|
+
direction: z100.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
17881
17891
|
strokeWidth: distance28.optional(),
|
|
17882
|
-
color:
|
|
17883
|
-
isDashed:
|
|
17892
|
+
color: z100.string().optional(),
|
|
17893
|
+
isDashed: z100.boolean().optional().default(false)
|
|
17884
17894
|
});
|
|
17885
17895
|
expectTypesMatch(true);
|
|
17886
17896
|
|
|
17887
17897
|
// lib/components/toolingrail.ts
|
|
17888
|
-
import { z as
|
|
17889
|
-
var toolingrailProps =
|
|
17890
|
-
children:
|
|
17898
|
+
import { z as z101 } from "zod";
|
|
17899
|
+
var toolingrailProps = z101.object({
|
|
17900
|
+
children: z101.any().optional()
|
|
17891
17901
|
});
|
|
17892
17902
|
expectTypesMatch(true);
|
|
17893
17903
|
|
|
17894
17904
|
// lib/components/schematic-box.ts
|
|
17895
17905
|
import { distance as distance29 } from "circuit-json";
|
|
17896
|
-
import { z as
|
|
17897
|
-
var schematicBoxProps =
|
|
17906
|
+
import { z as z102 } from "zod";
|
|
17907
|
+
var schematicBoxProps = z102.object({
|
|
17898
17908
|
schX: distance29.optional(),
|
|
17899
17909
|
schY: distance29.optional(),
|
|
17900
17910
|
width: distance29.optional(),
|
|
17901
17911
|
height: distance29.optional(),
|
|
17902
|
-
overlay:
|
|
17912
|
+
overlay: z102.array(z102.string()).optional(),
|
|
17903
17913
|
padding: distance29.optional(),
|
|
17904
17914
|
paddingLeft: distance29.optional(),
|
|
17905
17915
|
paddingRight: distance29.optional(),
|
|
17906
17916
|
paddingTop: distance29.optional(),
|
|
17907
17917
|
paddingBottom: distance29.optional(),
|
|
17908
|
-
title:
|
|
17918
|
+
title: z102.string().optional(),
|
|
17909
17919
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
17910
|
-
titleColor:
|
|
17920
|
+
titleColor: z102.string().optional(),
|
|
17911
17921
|
titleFontSize: distance29.optional(),
|
|
17912
|
-
titleInside:
|
|
17913
|
-
strokeStyle:
|
|
17922
|
+
titleInside: z102.boolean().default(false),
|
|
17923
|
+
strokeStyle: z102.enum(["solid", "dashed"]).default("solid")
|
|
17914
17924
|
}).refine(
|
|
17915
17925
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
17916
17926
|
{
|
|
@@ -17926,15 +17936,15 @@ expectTypesMatch(true);
|
|
|
17926
17936
|
|
|
17927
17937
|
// lib/components/schematic-circle.ts
|
|
17928
17938
|
import { distance as distance30, point as point6 } from "circuit-json";
|
|
17929
|
-
import { z as
|
|
17930
|
-
var schematicCircleProps =
|
|
17939
|
+
import { z as z103 } from "zod";
|
|
17940
|
+
var schematicCircleProps = z103.object({
|
|
17931
17941
|
center: point6,
|
|
17932
17942
|
radius: distance30,
|
|
17933
17943
|
strokeWidth: distance30.optional(),
|
|
17934
|
-
color:
|
|
17935
|
-
isFilled:
|
|
17936
|
-
fillColor:
|
|
17937
|
-
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)
|
|
17938
17948
|
});
|
|
17939
17949
|
expectTypesMatch(
|
|
17940
17950
|
true
|
|
@@ -17942,43 +17952,43 @@ expectTypesMatch(
|
|
|
17942
17952
|
|
|
17943
17953
|
// lib/components/schematic-rect.ts
|
|
17944
17954
|
import { distance as distance31, rotation as rotation8 } from "circuit-json";
|
|
17945
|
-
import { z as
|
|
17946
|
-
var schematicRectProps =
|
|
17955
|
+
import { z as z104 } from "zod";
|
|
17956
|
+
var schematicRectProps = z104.object({
|
|
17947
17957
|
schX: distance31.optional(),
|
|
17948
17958
|
schY: distance31.optional(),
|
|
17949
17959
|
width: distance31,
|
|
17950
17960
|
height: distance31,
|
|
17951
17961
|
rotation: rotation8.default(0),
|
|
17952
17962
|
strokeWidth: distance31.optional(),
|
|
17953
|
-
color:
|
|
17954
|
-
isFilled:
|
|
17955
|
-
fillColor:
|
|
17956
|
-
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),
|
|
17957
17967
|
cornerRadius: distance31.optional()
|
|
17958
17968
|
});
|
|
17959
17969
|
expectTypesMatch(true);
|
|
17960
17970
|
|
|
17961
17971
|
// lib/components/schematic-line.ts
|
|
17962
17972
|
import { distance as distance32 } from "circuit-json";
|
|
17963
|
-
import { z as
|
|
17964
|
-
var schematicLineProps =
|
|
17973
|
+
import { z as z105 } from "zod";
|
|
17974
|
+
var schematicLineProps = z105.object({
|
|
17965
17975
|
x1: distance32,
|
|
17966
17976
|
y1: distance32,
|
|
17967
17977
|
x2: distance32,
|
|
17968
17978
|
y2: distance32,
|
|
17969
17979
|
strokeWidth: distance32.optional(),
|
|
17970
|
-
color:
|
|
17971
|
-
isDashed:
|
|
17980
|
+
color: z105.string().optional(),
|
|
17981
|
+
isDashed: z105.boolean().optional().default(false)
|
|
17972
17982
|
});
|
|
17973
17983
|
expectTypesMatch(true);
|
|
17974
17984
|
|
|
17975
17985
|
// lib/components/schematic-text.ts
|
|
17976
17986
|
import { distance as distance33, rotation as rotation9 } from "circuit-json";
|
|
17977
|
-
import { z as
|
|
17987
|
+
import { z as z107 } from "zod";
|
|
17978
17988
|
|
|
17979
17989
|
// lib/common/fivePointAnchor.ts
|
|
17980
|
-
import { z as
|
|
17981
|
-
var fivePointAnchor =
|
|
17990
|
+
import { z as z106 } from "zod";
|
|
17991
|
+
var fivePointAnchor = z106.enum([
|
|
17982
17992
|
"center",
|
|
17983
17993
|
"left",
|
|
17984
17994
|
"right",
|
|
@@ -17987,37 +17997,37 @@ var fivePointAnchor = z105.enum([
|
|
|
17987
17997
|
]);
|
|
17988
17998
|
|
|
17989
17999
|
// lib/components/schematic-text.ts
|
|
17990
|
-
var schematicTextProps =
|
|
18000
|
+
var schematicTextProps = z107.object({
|
|
17991
18001
|
schX: distance33.optional(),
|
|
17992
18002
|
schY: distance33.optional(),
|
|
17993
|
-
text:
|
|
17994
|
-
fontSize:
|
|
17995
|
-
anchor:
|
|
17996
|
-
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"),
|
|
17997
18007
|
schRotation: rotation9.default(0)
|
|
17998
18008
|
});
|
|
17999
18009
|
expectTypesMatch(true);
|
|
18000
18010
|
|
|
18001
18011
|
// lib/components/schematic-path.ts
|
|
18002
18012
|
import { distance as distance34, point as point8 } from "circuit-json";
|
|
18003
|
-
import { z as
|
|
18004
|
-
var schematicPathProps =
|
|
18005
|
-
points:
|
|
18006
|
-
svgPath:
|
|
18013
|
+
import { z as z108 } from "zod";
|
|
18014
|
+
var schematicPathProps = z108.object({
|
|
18015
|
+
points: z108.array(point8).optional(),
|
|
18016
|
+
svgPath: z108.string().optional(),
|
|
18007
18017
|
strokeWidth: distance34.optional(),
|
|
18008
|
-
strokeColor:
|
|
18009
|
-
isFilled:
|
|
18010
|
-
fillColor:
|
|
18018
|
+
strokeColor: z108.string().optional(),
|
|
18019
|
+
isFilled: z108.boolean().optional().default(false),
|
|
18020
|
+
fillColor: z108.string().optional()
|
|
18011
18021
|
});
|
|
18012
18022
|
expectTypesMatch(true);
|
|
18013
18023
|
|
|
18014
18024
|
// lib/components/schematic-table.ts
|
|
18015
18025
|
import { distance as distance35 } from "circuit-json";
|
|
18016
|
-
import { z as
|
|
18017
|
-
var schematicTableProps =
|
|
18026
|
+
import { z as z109 } from "zod";
|
|
18027
|
+
var schematicTableProps = z109.object({
|
|
18018
18028
|
schX: distance35.optional(),
|
|
18019
18029
|
schY: distance35.optional(),
|
|
18020
|
-
children:
|
|
18030
|
+
children: z109.any().optional(),
|
|
18021
18031
|
cellPadding: distance35.optional(),
|
|
18022
18032
|
borderWidth: distance35.optional(),
|
|
18023
18033
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18027,64 +18037,64 @@ expectTypesMatch(true);
|
|
|
18027
18037
|
|
|
18028
18038
|
// lib/components/schematic-row.ts
|
|
18029
18039
|
import { distance as distance36 } from "circuit-json";
|
|
18030
|
-
import { z as
|
|
18031
|
-
var schematicRowProps =
|
|
18032
|
-
children:
|
|
18040
|
+
import { z as z110 } from "zod";
|
|
18041
|
+
var schematicRowProps = z110.object({
|
|
18042
|
+
children: z110.any().optional(),
|
|
18033
18043
|
height: distance36.optional()
|
|
18034
18044
|
});
|
|
18035
18045
|
expectTypesMatch(true);
|
|
18036
18046
|
|
|
18037
18047
|
// lib/components/schematic-cell.ts
|
|
18038
18048
|
import { distance as distance37 } from "circuit-json";
|
|
18039
|
-
import { z as
|
|
18040
|
-
var schematicCellProps =
|
|
18041
|
-
children:
|
|
18042
|
-
horizontalAlign:
|
|
18043
|
-
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(),
|
|
18044
18054
|
fontSize: distance37.optional(),
|
|
18045
|
-
rowSpan:
|
|
18046
|
-
colSpan:
|
|
18055
|
+
rowSpan: z111.number().optional(),
|
|
18056
|
+
colSpan: z111.number().optional(),
|
|
18047
18057
|
width: distance37.optional(),
|
|
18048
|
-
text:
|
|
18058
|
+
text: z111.string().optional()
|
|
18049
18059
|
});
|
|
18050
18060
|
expectTypesMatch(true);
|
|
18051
18061
|
|
|
18052
18062
|
// lib/components/copper-text.ts
|
|
18053
|
-
import { layer_ref as
|
|
18054
|
-
import { z as
|
|
18063
|
+
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18064
|
+
import { z as z112 } from "zod";
|
|
18055
18065
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18056
|
-
text:
|
|
18066
|
+
text: z112.string(),
|
|
18057
18067
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18058
|
-
font:
|
|
18068
|
+
font: z112.enum(["tscircuit2024"]).optional(),
|
|
18059
18069
|
fontSize: length8.optional(),
|
|
18060
|
-
layers:
|
|
18061
|
-
knockout:
|
|
18062
|
-
mirrored:
|
|
18070
|
+
layers: z112.array(layer_ref10).optional(),
|
|
18071
|
+
knockout: z112.boolean().optional(),
|
|
18072
|
+
mirrored: z112.boolean().optional()
|
|
18063
18073
|
});
|
|
18064
18074
|
|
|
18065
18075
|
// lib/components/silkscreen-text.ts
|
|
18066
|
-
import { layer_ref as
|
|
18067
|
-
import { z as
|
|
18076
|
+
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18077
|
+
import { z as z113 } from "zod";
|
|
18068
18078
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18069
|
-
text:
|
|
18079
|
+
text: z113.string(),
|
|
18070
18080
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18071
|
-
font:
|
|
18081
|
+
font: z113.enum(["tscircuit2024"]).optional(),
|
|
18072
18082
|
fontSize: length9.optional(),
|
|
18073
18083
|
/**
|
|
18074
18084
|
* If true, text will knock out underlying silkscreen
|
|
18075
18085
|
*/
|
|
18076
|
-
isKnockout:
|
|
18086
|
+
isKnockout: z113.boolean().optional(),
|
|
18077
18087
|
knockoutPadding: length9.optional(),
|
|
18078
18088
|
knockoutPaddingLeft: length9.optional(),
|
|
18079
18089
|
knockoutPaddingRight: length9.optional(),
|
|
18080
18090
|
knockoutPaddingTop: length9.optional(),
|
|
18081
18091
|
knockoutPaddingBottom: length9.optional(),
|
|
18082
|
-
layers:
|
|
18092
|
+
layers: z113.array(layer_ref11).optional()
|
|
18083
18093
|
});
|
|
18084
18094
|
|
|
18085
18095
|
// lib/components/silkscreen-path.ts
|
|
18086
18096
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18087
|
-
import { z as
|
|
18097
|
+
import { z as z114 } from "zod";
|
|
18088
18098
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18089
18099
|
pcbLeftEdgeX: true,
|
|
18090
18100
|
pcbRightEdgeX: true,
|
|
@@ -18096,7 +18106,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18096
18106
|
pcbOffsetY: true,
|
|
18097
18107
|
pcbRotation: true
|
|
18098
18108
|
}).extend({
|
|
18099
|
-
route:
|
|
18109
|
+
route: z114.array(route_hint_point5),
|
|
18100
18110
|
strokeWidth: length10.optional()
|
|
18101
18111
|
});
|
|
18102
18112
|
|
|
@@ -18118,10 +18128,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18118
18128
|
|
|
18119
18129
|
// lib/components/silkscreen-rect.ts
|
|
18120
18130
|
import { distance as distance39 } from "circuit-json";
|
|
18121
|
-
import { z as
|
|
18131
|
+
import { z as z115 } from "zod";
|
|
18122
18132
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18123
|
-
filled:
|
|
18124
|
-
stroke:
|
|
18133
|
+
filled: z115.boolean().default(true).optional(),
|
|
18134
|
+
stroke: z115.enum(["dashed", "solid", "none"]).optional(),
|
|
18125
18135
|
strokeWidth: distance39.optional(),
|
|
18126
18136
|
width: distance39,
|
|
18127
18137
|
height: distance39,
|
|
@@ -18130,73 +18140,73 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18130
18140
|
|
|
18131
18141
|
// lib/components/silkscreen-circle.ts
|
|
18132
18142
|
import { distance as distance40 } from "circuit-json";
|
|
18133
|
-
import { z as
|
|
18143
|
+
import { z as z116 } from "zod";
|
|
18134
18144
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18135
|
-
isFilled:
|
|
18136
|
-
isOutline:
|
|
18145
|
+
isFilled: z116.boolean().optional(),
|
|
18146
|
+
isOutline: z116.boolean().optional(),
|
|
18137
18147
|
strokeWidth: distance40.optional(),
|
|
18138
18148
|
radius: distance40
|
|
18139
18149
|
});
|
|
18140
18150
|
|
|
18141
18151
|
// lib/components/trace-hint.ts
|
|
18142
|
-
import { distance as distance41, layer_ref as
|
|
18143
|
-
import { z as
|
|
18144
|
-
var routeHintPointProps =
|
|
18152
|
+
import { distance as distance41, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18153
|
+
import { z as z117 } from "zod";
|
|
18154
|
+
var routeHintPointProps = z117.object({
|
|
18145
18155
|
x: distance41,
|
|
18146
18156
|
y: distance41,
|
|
18147
|
-
via:
|
|
18148
|
-
toLayer:
|
|
18157
|
+
via: z117.boolean().optional(),
|
|
18158
|
+
toLayer: layer_ref12.optional()
|
|
18149
18159
|
});
|
|
18150
|
-
var traceHintProps =
|
|
18151
|
-
for:
|
|
18160
|
+
var traceHintProps = z117.object({
|
|
18161
|
+
for: z117.string().optional().describe(
|
|
18152
18162
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18153
18163
|
),
|
|
18154
|
-
order:
|
|
18164
|
+
order: z117.number().optional(),
|
|
18155
18165
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18156
|
-
offsets:
|
|
18157
|
-
traceWidth:
|
|
18166
|
+
offsets: z117.array(route_hint_point6).or(z117.array(routeHintPointProps)).optional(),
|
|
18167
|
+
traceWidth: z117.number().optional()
|
|
18158
18168
|
});
|
|
18159
18169
|
|
|
18160
18170
|
// lib/components/port.ts
|
|
18161
|
-
import { z as
|
|
18171
|
+
import { z as z118 } from "zod";
|
|
18162
18172
|
var portProps = commonLayoutProps.extend({
|
|
18163
|
-
name:
|
|
18164
|
-
pinNumber:
|
|
18165
|
-
schStemLength:
|
|
18166
|
-
aliases:
|
|
18167
|
-
layer:
|
|
18168
|
-
layers:
|
|
18169
|
-
schX:
|
|
18170
|
-
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(),
|
|
18171
18181
|
direction,
|
|
18172
|
-
connectsTo:
|
|
18182
|
+
connectsTo: z118.string().or(z118.array(z118.string())).optional(),
|
|
18173
18183
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18174
|
-
hasInversionCircle:
|
|
18184
|
+
hasInversionCircle: z118.boolean().optional()
|
|
18175
18185
|
});
|
|
18176
18186
|
|
|
18177
18187
|
// lib/components/pcb-note-text.ts
|
|
18178
18188
|
import { length as length11 } from "circuit-json";
|
|
18179
|
-
import { z as
|
|
18189
|
+
import { z as z119 } from "zod";
|
|
18180
18190
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18181
|
-
text:
|
|
18182
|
-
anchorAlignment:
|
|
18183
|
-
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(),
|
|
18184
18194
|
fontSize: length11.optional(),
|
|
18185
|
-
color:
|
|
18195
|
+
color: z119.string().optional()
|
|
18186
18196
|
});
|
|
18187
18197
|
expectTypesMatch(true);
|
|
18188
18198
|
|
|
18189
18199
|
// lib/components/pcb-note-rect.ts
|
|
18190
18200
|
import { distance as distance42 } from "circuit-json";
|
|
18191
|
-
import { z as
|
|
18201
|
+
import { z as z120 } from "zod";
|
|
18192
18202
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18193
18203
|
width: distance42,
|
|
18194
18204
|
height: distance42,
|
|
18195
18205
|
strokeWidth: distance42.optional(),
|
|
18196
|
-
isFilled:
|
|
18197
|
-
hasStroke:
|
|
18198
|
-
isStrokeDashed:
|
|
18199
|
-
color:
|
|
18206
|
+
isFilled: z120.boolean().optional(),
|
|
18207
|
+
hasStroke: z120.boolean().optional(),
|
|
18208
|
+
isStrokeDashed: z120.boolean().optional(),
|
|
18209
|
+
color: z120.string().optional(),
|
|
18200
18210
|
cornerRadius: distance42.optional()
|
|
18201
18211
|
});
|
|
18202
18212
|
expectTypesMatch(true);
|
|
@@ -18206,7 +18216,7 @@ import {
|
|
|
18206
18216
|
length as length12,
|
|
18207
18217
|
route_hint_point as route_hint_point7
|
|
18208
18218
|
} from "circuit-json";
|
|
18209
|
-
import { z as
|
|
18219
|
+
import { z as z121 } from "zod";
|
|
18210
18220
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18211
18221
|
pcbLeftEdgeX: true,
|
|
18212
18222
|
pcbRightEdgeX: true,
|
|
@@ -18218,15 +18228,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18218
18228
|
pcbOffsetY: true,
|
|
18219
18229
|
pcbRotation: true
|
|
18220
18230
|
}).extend({
|
|
18221
|
-
route:
|
|
18231
|
+
route: z121.array(route_hint_point7),
|
|
18222
18232
|
strokeWidth: length12.optional(),
|
|
18223
|
-
color:
|
|
18233
|
+
color: z121.string().optional()
|
|
18224
18234
|
});
|
|
18225
18235
|
expectTypesMatch(true);
|
|
18226
18236
|
|
|
18227
18237
|
// lib/components/pcb-note-line.ts
|
|
18228
18238
|
import { distance as distance43 } from "circuit-json";
|
|
18229
|
-
import { z as
|
|
18239
|
+
import { z as z122 } from "zod";
|
|
18230
18240
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18231
18241
|
pcbLeftEdgeX: true,
|
|
18232
18242
|
pcbRightEdgeX: true,
|
|
@@ -18243,15 +18253,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18243
18253
|
x2: distance43,
|
|
18244
18254
|
y2: distance43,
|
|
18245
18255
|
strokeWidth: distance43.optional(),
|
|
18246
|
-
color:
|
|
18247
|
-
isDashed:
|
|
18256
|
+
color: z122.string().optional(),
|
|
18257
|
+
isDashed: z122.boolean().optional()
|
|
18248
18258
|
});
|
|
18249
18259
|
expectTypesMatch(true);
|
|
18250
18260
|
|
|
18251
18261
|
// lib/components/pcb-note-dimension.ts
|
|
18252
18262
|
import { distance as distance44, length as length13 } from "circuit-json";
|
|
18253
|
-
import { z as
|
|
18254
|
-
var dimensionTarget2 =
|
|
18263
|
+
import { z as z123 } from "zod";
|
|
18264
|
+
var dimensionTarget2 = z123.union([z123.string(), point]);
|
|
18255
18265
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18256
18266
|
pcbLeftEdgeX: true,
|
|
18257
18267
|
pcbRightEdgeX: true,
|
|
@@ -18265,101 +18275,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18265
18275
|
}).extend({
|
|
18266
18276
|
from: dimensionTarget2,
|
|
18267
18277
|
to: dimensionTarget2,
|
|
18268
|
-
text:
|
|
18278
|
+
text: z123.string().optional(),
|
|
18269
18279
|
offset: distance44.optional(),
|
|
18270
|
-
font:
|
|
18280
|
+
font: z123.enum(["tscircuit2024"]).optional(),
|
|
18271
18281
|
fontSize: length13.optional(),
|
|
18272
|
-
color:
|
|
18282
|
+
color: z123.string().optional(),
|
|
18273
18283
|
arrowSize: distance44.optional(),
|
|
18274
|
-
units:
|
|
18275
|
-
outerEdgeToEdge:
|
|
18276
|
-
centerToCenter:
|
|
18277
|
-
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()
|
|
18278
18288
|
});
|
|
18279
18289
|
expectTypesMatch(
|
|
18280
18290
|
true
|
|
18281
18291
|
);
|
|
18282
18292
|
|
|
18283
18293
|
// lib/platformConfig.ts
|
|
18284
|
-
import { z as
|
|
18285
|
-
var unvalidatedCircuitJson =
|
|
18286
|
-
var footprintLibraryResult =
|
|
18287
|
-
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()),
|
|
18288
18298
|
cadModel: cadModelProp.optional()
|
|
18289
18299
|
});
|
|
18290
|
-
var pathToCircuitJsonFn =
|
|
18291
|
-
|
|
18292
|
-
|
|
18293
|
-
|
|
18294
|
-
).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))
|
|
18295
18305
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18296
|
-
var footprintFileParserEntry =
|
|
18297
|
-
loadFromUrl:
|
|
18306
|
+
var footprintFileParserEntry = z124.object({
|
|
18307
|
+
loadFromUrl: z124.function().args(z124.string()).returns(z124.promise(footprintLibraryResult)).describe(
|
|
18298
18308
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18299
18309
|
)
|
|
18300
18310
|
});
|
|
18301
|
-
var spiceEngineSimulationResult =
|
|
18302
|
-
engineVersionString:
|
|
18311
|
+
var spiceEngineSimulationResult = z124.object({
|
|
18312
|
+
engineVersionString: z124.string().optional(),
|
|
18303
18313
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18304
18314
|
});
|
|
18305
|
-
var spiceEngineZod =
|
|
18306
|
-
simulate:
|
|
18315
|
+
var spiceEngineZod = z124.object({
|
|
18316
|
+
simulate: z124.function().args(z124.string()).returns(z124.promise(spiceEngineSimulationResult)).describe(
|
|
18307
18317
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18308
18318
|
)
|
|
18309
18319
|
});
|
|
18310
|
-
var defaultSpiceEngine =
|
|
18320
|
+
var defaultSpiceEngine = z124.custom(
|
|
18311
18321
|
(value) => typeof value === "string"
|
|
18312
18322
|
);
|
|
18313
|
-
var autorouterInstance =
|
|
18314
|
-
run:
|
|
18315
|
-
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")
|
|
18316
18326
|
});
|
|
18317
|
-
var autorouterDefinition =
|
|
18318
|
-
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")
|
|
18319
18329
|
});
|
|
18320
|
-
var platformFetch =
|
|
18321
|
-
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({
|
|
18322
18332
|
partsEngine: partsEngine.optional(),
|
|
18323
18333
|
autorouter: autorouterProp.optional(),
|
|
18324
|
-
autorouterMap:
|
|
18334
|
+
autorouterMap: z124.record(z124.string(), autorouterDefinition).optional(),
|
|
18325
18335
|
registryApiUrl: url.optional(),
|
|
18326
18336
|
cloudAutorouterUrl: url.optional(),
|
|
18327
|
-
projectName:
|
|
18337
|
+
projectName: z124.string().optional(),
|
|
18328
18338
|
projectBaseUrl: url.optional(),
|
|
18329
|
-
version:
|
|
18339
|
+
version: z124.string().optional(),
|
|
18330
18340
|
url: url.optional(),
|
|
18331
|
-
printBoardInformationToSilkscreen:
|
|
18332
|
-
includeBoardFiles:
|
|
18341
|
+
printBoardInformationToSilkscreen: z124.boolean().optional(),
|
|
18342
|
+
includeBoardFiles: z124.array(z124.string()).describe(
|
|
18333
18343
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18334
18344
|
).optional(),
|
|
18335
|
-
snapshotsDir:
|
|
18345
|
+
snapshotsDir: z124.string().describe(
|
|
18336
18346
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18337
18347
|
).optional(),
|
|
18338
18348
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18339
|
-
unitPreference:
|
|
18340
|
-
localCacheEngine:
|
|
18341
|
-
pcbDisabled:
|
|
18342
|
-
routingDisabled:
|
|
18343
|
-
schematicDisabled:
|
|
18344
|
-
partsEngineDisabled:
|
|
18345
|
-
drcChecksDisabled:
|
|
18346
|
-
netlistDrcChecksDisabled:
|
|
18347
|
-
routingDrcChecksDisabled:
|
|
18348
|
-
placementDrcChecksDisabled:
|
|
18349
|
-
pinSpecificationDrcChecksDisabled:
|
|
18350
|
-
spiceEngineMap:
|
|
18351
|
-
footprintLibraryMap:
|
|
18352
|
-
|
|
18353
|
-
|
|
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([
|
|
18354
18364
|
pathToCircuitJsonFn,
|
|
18355
|
-
|
|
18356
|
-
|
|
18357
|
-
|
|
18365
|
+
z124.record(
|
|
18366
|
+
z124.string(),
|
|
18367
|
+
z124.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18358
18368
|
)
|
|
18359
18369
|
])
|
|
18360
18370
|
).optional(),
|
|
18361
|
-
footprintFileParserMap:
|
|
18362
|
-
resolveProjectStaticFileImportUrl:
|
|
18371
|
+
footprintFileParserMap: z124.record(z124.string(), footprintFileParserEntry).optional(),
|
|
18372
|
+
resolveProjectStaticFileImportUrl: z124.function().args(z124.string()).returns(z124.promise(z124.string())).describe(
|
|
18363
18373
|
"A function that returns a string URL for static files for the project"
|
|
18364
18374
|
).optional(),
|
|
18365
18375
|
platformFetch: platformFetch.optional()
|
|
@@ -18386,6 +18396,7 @@ export {
|
|
|
18386
18396
|
autorouterEffortLevel,
|
|
18387
18397
|
autorouterPreset,
|
|
18388
18398
|
autorouterProp,
|
|
18399
|
+
autoroutingPhaseProps,
|
|
18389
18400
|
baseGroupProps,
|
|
18390
18401
|
base_manual_edit_event,
|
|
18391
18402
|
batteryPins,
|