@tscircuit/props 0.0.591 → 0.0.592
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 +186 -101
- package/dist/index.d.ts +759 -3
- package/dist/index.js +599 -368
- package/dist/index.js.map +1 -1
- package/lib/components/analogacsweepsimulation.ts +85 -0
- package/lib/components/analogdcoperatingpointsimulation.ts +18 -0
- package/lib/components/analogdcsweepsimulation.ts +50 -0
- package/lib/components/analogsimulation.ts +22 -0
- package/lib/components/analogsweepparameter.ts +213 -0
- package/lib/components/analogtransientsimulation.ts +47 -0
- package/lib/components/currentsource.ts +6 -0
- package/lib/components/voltagesource.ts +6 -0
- package/lib/index.ts +5 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17501,6 +17501,13 @@ var spiceOptions = z79.object({
|
|
|
17501
17501
|
abstol: z79.union([z79.number(), z79.string()]).optional(),
|
|
17502
17502
|
vntol: z79.union([z79.number(), z79.string()]).optional()
|
|
17503
17503
|
});
|
|
17504
|
+
var analogAnalysisSimulationBaseProps = {
|
|
17505
|
+
name: z79.string().optional(),
|
|
17506
|
+
spiceEngine: spiceEngine.optional(),
|
|
17507
|
+
spiceOptions: spiceOptions.optional(),
|
|
17508
|
+
graphIndependentAxes: z79.boolean().optional(),
|
|
17509
|
+
children: z79.custom().optional()
|
|
17510
|
+
};
|
|
17504
17511
|
var analogSimulationProps = z79.object({
|
|
17505
17512
|
name: z79.string().optional(),
|
|
17506
17513
|
simulationType: z79.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
@@ -17515,28 +17522,237 @@ expectTypesMatch(
|
|
|
17515
17522
|
true
|
|
17516
17523
|
);
|
|
17517
17524
|
|
|
17518
|
-
// lib/components/
|
|
17525
|
+
// lib/components/analogtransientsimulation.ts
|
|
17526
|
+
import { ms as ms2 } from "circuit-json";
|
|
17519
17527
|
import { z as z80 } from "zod";
|
|
17520
|
-
var
|
|
17521
|
-
|
|
17522
|
-
|
|
17528
|
+
var positiveMilliseconds = ms2.refine(
|
|
17529
|
+
(milliseconds) => milliseconds > 0,
|
|
17530
|
+
"Time must be positive"
|
|
17531
|
+
);
|
|
17532
|
+
var analogTransientSimulationProps = z80.object({
|
|
17533
|
+
...analogAnalysisSimulationBaseProps,
|
|
17534
|
+
duration: positiveMilliseconds.default("10ms"),
|
|
17535
|
+
startTime: ms2.default("0ms"),
|
|
17536
|
+
timePerStep: positiveMilliseconds.default("0.01ms")
|
|
17537
|
+
}).superRefine((simulation, context) => {
|
|
17538
|
+
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
17539
|
+
context.addIssue({
|
|
17540
|
+
code: z80.ZodIssueCode.custom,
|
|
17541
|
+
path: ["startTime"],
|
|
17542
|
+
message: "startTime must be between zero and duration"
|
|
17543
|
+
});
|
|
17544
|
+
}
|
|
17545
|
+
});
|
|
17546
|
+
expectTypesMatch(true);
|
|
17547
|
+
|
|
17548
|
+
// lib/components/analogdcoperatingpointsimulation.ts
|
|
17549
|
+
import { z as z81 } from "zod";
|
|
17550
|
+
var analogDcOperatingPointSimulationProps = z81.object({
|
|
17551
|
+
...analogAnalysisSimulationBaseProps
|
|
17552
|
+
});
|
|
17553
|
+
expectTypesMatch(true);
|
|
17554
|
+
|
|
17555
|
+
// lib/components/analogdcsweepsimulation.ts
|
|
17556
|
+
import { current, voltage as voltage3 } from "circuit-json";
|
|
17557
|
+
import { z as z82 } from "zod";
|
|
17558
|
+
var dcSweepQuantity = z82.union([voltage3, current]);
|
|
17559
|
+
var analogDcSweepSimulationProps = z82.object({
|
|
17560
|
+
...analogAnalysisSimulationBaseProps,
|
|
17561
|
+
sweepSource: z82.string().min(1),
|
|
17562
|
+
sweepStart: dcSweepQuantity,
|
|
17563
|
+
sweepStop: dcSweepQuantity,
|
|
17564
|
+
sweepStep: dcSweepQuantity.refine(
|
|
17565
|
+
(sweepStep) => sweepStep !== 0,
|
|
17566
|
+
"sweepStep must be nonzero"
|
|
17567
|
+
)
|
|
17568
|
+
}).superRefine((simulation, context) => {
|
|
17569
|
+
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
17570
|
+
context.addIssue({
|
|
17571
|
+
code: z82.ZodIssueCode.custom,
|
|
17572
|
+
path: ["sweepStep"],
|
|
17573
|
+
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
17574
|
+
});
|
|
17575
|
+
}
|
|
17576
|
+
});
|
|
17577
|
+
expectTypesMatch(true);
|
|
17578
|
+
|
|
17579
|
+
// lib/components/analogacsweepsimulation.ts
|
|
17580
|
+
import { frequency as frequency3 } from "circuit-json";
|
|
17581
|
+
import { z as z83 } from "zod";
|
|
17582
|
+
var analogAcSweepSimulationProps = z83.object({
|
|
17583
|
+
...analogAnalysisSimulationBaseProps,
|
|
17584
|
+
sweepType: z83.enum(["linear", "decade", "octave"]),
|
|
17585
|
+
startFrequency: frequency3.refine(
|
|
17586
|
+
(startFrequencyHz) => startFrequencyHz > 0,
|
|
17587
|
+
"startFrequency must be positive"
|
|
17588
|
+
),
|
|
17589
|
+
stopFrequency: frequency3.refine(
|
|
17590
|
+
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
17591
|
+
"stopFrequency must be positive"
|
|
17592
|
+
),
|
|
17593
|
+
samplesPerInterval: z83.number().int().positive().optional(),
|
|
17594
|
+
sampleCount: z83.number().int().positive().optional()
|
|
17595
|
+
}).superRefine((simulation, context) => {
|
|
17596
|
+
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
17597
|
+
context.addIssue({
|
|
17598
|
+
code: z83.ZodIssueCode.custom,
|
|
17599
|
+
path: ["stopFrequency"],
|
|
17600
|
+
message: "stopFrequency must be greater than startFrequency"
|
|
17601
|
+
});
|
|
17602
|
+
}
|
|
17603
|
+
if (simulation.sweepType === "linear") {
|
|
17604
|
+
if (simulation.sampleCount === void 0) {
|
|
17605
|
+
context.addIssue({
|
|
17606
|
+
code: z83.ZodIssueCode.custom,
|
|
17607
|
+
path: ["sampleCount"],
|
|
17608
|
+
message: "sampleCount is required for a linear AC sweep"
|
|
17609
|
+
});
|
|
17610
|
+
}
|
|
17611
|
+
if (simulation.samplesPerInterval !== void 0) {
|
|
17612
|
+
context.addIssue({
|
|
17613
|
+
code: z83.ZodIssueCode.custom,
|
|
17614
|
+
path: ["samplesPerInterval"],
|
|
17615
|
+
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
17616
|
+
});
|
|
17617
|
+
}
|
|
17618
|
+
return;
|
|
17619
|
+
}
|
|
17620
|
+
if (simulation.samplesPerInterval === void 0) {
|
|
17621
|
+
context.addIssue({
|
|
17622
|
+
code: z83.ZodIssueCode.custom,
|
|
17623
|
+
path: ["samplesPerInterval"],
|
|
17624
|
+
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
17625
|
+
});
|
|
17626
|
+
}
|
|
17627
|
+
if (simulation.sampleCount !== void 0) {
|
|
17628
|
+
context.addIssue({
|
|
17629
|
+
code: z83.ZodIssueCode.custom,
|
|
17630
|
+
path: ["sampleCount"],
|
|
17631
|
+
message: "sampleCount is only valid for a linear sweep"
|
|
17632
|
+
});
|
|
17633
|
+
}
|
|
17634
|
+
});
|
|
17635
|
+
expectTypesMatch(true);
|
|
17636
|
+
|
|
17637
|
+
// lib/components/analogsweepparameter.ts
|
|
17638
|
+
import {
|
|
17639
|
+
capacitance as capacitance4,
|
|
17640
|
+
current as current2,
|
|
17641
|
+
inductance,
|
|
17642
|
+
resistance as resistance3,
|
|
17643
|
+
voltage as voltage4
|
|
17644
|
+
} from "circuit-json";
|
|
17645
|
+
import { z as z84 } from "zod";
|
|
17646
|
+
var resistanceSweepQuantity = resistance3.pipe(z84.number());
|
|
17647
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z84.number());
|
|
17648
|
+
var inductanceSweepQuantity = inductance.pipe(z84.number());
|
|
17649
|
+
var voltageSweepQuantity = voltage4.pipe(z84.number());
|
|
17650
|
+
var currentSweepQuantity = current2.pipe(z84.number());
|
|
17651
|
+
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
17652
|
+
name: z84.string().optional(),
|
|
17653
|
+
values: z84.array(sweepQuantity).min(1).optional(),
|
|
17654
|
+
start: sweepQuantity.optional(),
|
|
17655
|
+
stop: sweepQuantity.optional(),
|
|
17656
|
+
step: sweepQuantity.optional()
|
|
17657
|
+
});
|
|
17658
|
+
var analogResistanceSweepParameterProps = z84.object({
|
|
17659
|
+
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
17660
|
+
parameterType: z84.literal("resistance"),
|
|
17661
|
+
resistorRef: z84.string().min(1)
|
|
17662
|
+
}).strict();
|
|
17663
|
+
var analogCapacitanceSweepParameterProps = z84.object({
|
|
17664
|
+
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
17665
|
+
parameterType: z84.literal("capacitance"),
|
|
17666
|
+
capacitorRef: z84.string().min(1)
|
|
17667
|
+
}).strict();
|
|
17668
|
+
var analogInductanceSweepParameterProps = z84.object({
|
|
17669
|
+
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
17670
|
+
parameterType: z84.literal("inductance"),
|
|
17671
|
+
inductorRef: z84.string().min(1)
|
|
17672
|
+
}).strict();
|
|
17673
|
+
var analogVoltageSweepParameterProps = z84.object({
|
|
17674
|
+
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
17675
|
+
parameterType: z84.literal("voltage"),
|
|
17676
|
+
net: z84.string().min(1)
|
|
17677
|
+
}).strict();
|
|
17678
|
+
var analogCurrentSweepParameterProps = z84.object({
|
|
17679
|
+
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
17680
|
+
parameterType: z84.literal("current"),
|
|
17681
|
+
currentSourceRef: z84.string().min(1)
|
|
17682
|
+
}).strict();
|
|
17683
|
+
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
17684
|
+
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
17685
|
+
const rangeCoordinateCount = [
|
|
17686
|
+
sweepCoordinates.start,
|
|
17687
|
+
sweepCoordinates.stop,
|
|
17688
|
+
sweepCoordinates.step
|
|
17689
|
+
].filter((rangeCoordinate) => rangeCoordinate !== void 0).length;
|
|
17690
|
+
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
17691
|
+
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
17692
|
+
context.addIssue({
|
|
17693
|
+
code: z84.ZodIssueCode.custom,
|
|
17694
|
+
message: "Provide either values or start/stop/step"
|
|
17695
|
+
});
|
|
17696
|
+
return;
|
|
17697
|
+
}
|
|
17698
|
+
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
17699
|
+
context.addIssue({
|
|
17700
|
+
code: z84.ZodIssueCode.custom,
|
|
17701
|
+
message: "start, stop, and step must be provided together"
|
|
17702
|
+
});
|
|
17703
|
+
return;
|
|
17704
|
+
}
|
|
17705
|
+
if (sweepCoordinates.step === 0) {
|
|
17706
|
+
context.addIssue({
|
|
17707
|
+
code: z84.ZodIssueCode.custom,
|
|
17708
|
+
path: ["step"],
|
|
17709
|
+
message: "step must be nonzero"
|
|
17710
|
+
});
|
|
17711
|
+
}
|
|
17712
|
+
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
17713
|
+
context.addIssue({
|
|
17714
|
+
code: z84.ZodIssueCode.custom,
|
|
17715
|
+
path: ["step"],
|
|
17716
|
+
message: "step must move from start toward stop"
|
|
17717
|
+
});
|
|
17718
|
+
}
|
|
17719
|
+
};
|
|
17720
|
+
var analogSweepParameterProps = z84.discriminatedUnion("parameterType", [
|
|
17721
|
+
analogResistanceSweepParameterProps,
|
|
17722
|
+
analogCapacitanceSweepParameterProps,
|
|
17723
|
+
analogInductanceSweepParameterProps,
|
|
17724
|
+
analogVoltageSweepParameterProps,
|
|
17725
|
+
analogCurrentSweepParameterProps
|
|
17726
|
+
]).superRefine(validateAnalogSweepCoordinates);
|
|
17727
|
+
expectTypesMatch(true);
|
|
17728
|
+
expectTypesMatch(true);
|
|
17729
|
+
expectTypesMatch(true);
|
|
17730
|
+
expectTypesMatch(true);
|
|
17731
|
+
expectTypesMatch(true);
|
|
17732
|
+
expectTypesMatch(true);
|
|
17733
|
+
|
|
17734
|
+
// lib/components/autoroutingphase.ts
|
|
17735
|
+
import { z as z85 } from "zod";
|
|
17736
|
+
var autoroutingPhaseProps = z85.object({
|
|
17737
|
+
key: z85.any().optional(),
|
|
17738
|
+
name: z85.string().optional(),
|
|
17523
17739
|
autorouter: autorouterProp.optional(),
|
|
17524
|
-
phaseIndex:
|
|
17740
|
+
phaseIndex: z85.number().optional(),
|
|
17525
17741
|
...routingTolerances.shape,
|
|
17526
|
-
region:
|
|
17527
|
-
shape:
|
|
17528
|
-
minX:
|
|
17529
|
-
maxX:
|
|
17530
|
-
minY:
|
|
17531
|
-
maxY:
|
|
17742
|
+
region: z85.object({
|
|
17743
|
+
shape: z85.literal("rect").optional(),
|
|
17744
|
+
minX: z85.number(),
|
|
17745
|
+
maxX: z85.number(),
|
|
17746
|
+
minY: z85.number(),
|
|
17747
|
+
maxY: z85.number()
|
|
17532
17748
|
}).optional(),
|
|
17533
|
-
connection:
|
|
17534
|
-
connections:
|
|
17535
|
-
reroute:
|
|
17749
|
+
connection: z85.string().optional(),
|
|
17750
|
+
connections: z85.array(z85.string()).optional(),
|
|
17751
|
+
reroute: z85.boolean().optional()
|
|
17536
17752
|
}).superRefine((value, ctx) => {
|
|
17537
17753
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17538
17754
|
ctx.addIssue({
|
|
17539
|
-
code:
|
|
17755
|
+
code: z85.ZodIssueCode.custom,
|
|
17540
17756
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17541
17757
|
path: ["region"]
|
|
17542
17758
|
});
|
|
@@ -17545,15 +17761,15 @@ var autoroutingPhaseProps = z80.object({
|
|
|
17545
17761
|
expectTypesMatch(true);
|
|
17546
17762
|
|
|
17547
17763
|
// lib/components/spicemodel.ts
|
|
17548
|
-
import { z as
|
|
17549
|
-
var spicemodelProps =
|
|
17550
|
-
source:
|
|
17551
|
-
spicePinMapping:
|
|
17764
|
+
import { z as z86 } from "zod";
|
|
17765
|
+
var spicemodelProps = z86.object({
|
|
17766
|
+
source: z86.string(),
|
|
17767
|
+
spicePinMapping: z86.record(z86.string(), z86.string()).optional()
|
|
17552
17768
|
});
|
|
17553
17769
|
expectTypesMatch(true);
|
|
17554
17770
|
|
|
17555
17771
|
// lib/components/transistor.ts
|
|
17556
|
-
import { z as
|
|
17772
|
+
import { z as z87 } from "zod";
|
|
17557
17773
|
var transistorPinsLabels = [
|
|
17558
17774
|
"pin1",
|
|
17559
17775
|
"pin2",
|
|
@@ -17566,7 +17782,7 @@ var transistorPinsLabels = [
|
|
|
17566
17782
|
"drain"
|
|
17567
17783
|
];
|
|
17568
17784
|
var transistorProps = commonComponentProps.extend({
|
|
17569
|
-
type:
|
|
17785
|
+
type: z87.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17570
17786
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17571
17787
|
});
|
|
17572
17788
|
var transistorPins = [
|
|
@@ -17580,7 +17796,7 @@ var transistorPins = [
|
|
|
17580
17796
|
expectTypesMatch(true);
|
|
17581
17797
|
|
|
17582
17798
|
// lib/components/mosfet.ts
|
|
17583
|
-
import { z as
|
|
17799
|
+
import { z as z88 } from "zod";
|
|
17584
17800
|
var mosfetPins = [
|
|
17585
17801
|
"pin1",
|
|
17586
17802
|
"drain",
|
|
@@ -17590,11 +17806,11 @@ var mosfetPins = [
|
|
|
17590
17806
|
"gate"
|
|
17591
17807
|
];
|
|
17592
17808
|
var mosfetProps = commonComponentProps.extend({
|
|
17593
|
-
channelType:
|
|
17594
|
-
mosfetMode:
|
|
17595
|
-
symbolDrainSide:
|
|
17596
|
-
symbolSourceSide:
|
|
17597
|
-
symbolGateSide:
|
|
17809
|
+
channelType: z88.enum(["n", "p"]),
|
|
17810
|
+
mosfetMode: z88.enum(["enhancement", "depletion"]),
|
|
17811
|
+
symbolDrainSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17812
|
+
symbolSourceSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17813
|
+
symbolGateSide: z88.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17598
17814
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17599
17815
|
});
|
|
17600
17816
|
expectTypesMatch(true);
|
|
@@ -17615,30 +17831,30 @@ var opampPins = opampPinLabels;
|
|
|
17615
17831
|
expectTypesMatch(true);
|
|
17616
17832
|
|
|
17617
17833
|
// lib/components/inductor.ts
|
|
17618
|
-
import { inductance } from "circuit-json";
|
|
17619
|
-
import { z as
|
|
17834
|
+
import { inductance as inductance2 } from "circuit-json";
|
|
17835
|
+
import { z as z90 } from "zod";
|
|
17620
17836
|
var inductorPins = lrPins;
|
|
17621
17837
|
var inductorProps = commonComponentProps.extend({
|
|
17622
|
-
inductance,
|
|
17623
|
-
maxCurrentRating:
|
|
17838
|
+
inductance: inductance2,
|
|
17839
|
+
maxCurrentRating: z90.union([z90.string(), z90.number()]).optional(),
|
|
17624
17840
|
schOrientation: schematicOrientation.optional(),
|
|
17625
17841
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17626
17842
|
});
|
|
17627
17843
|
expectTypesMatch(true);
|
|
17628
17844
|
|
|
17629
17845
|
// lib/components/internal-circuit.ts
|
|
17630
|
-
import { z as
|
|
17631
|
-
var internalCircuitProps =
|
|
17632
|
-
children:
|
|
17846
|
+
import { z as z91 } from "zod";
|
|
17847
|
+
var internalCircuitProps = z91.object({
|
|
17848
|
+
children: z91.custom().optional()
|
|
17633
17849
|
});
|
|
17634
17850
|
expectTypesMatch(
|
|
17635
17851
|
true
|
|
17636
17852
|
);
|
|
17637
17853
|
|
|
17638
17854
|
// lib/components/diode.ts
|
|
17639
|
-
import { z as
|
|
17855
|
+
import { z as z92 } from "zod";
|
|
17640
17856
|
var diodePins = lrPolarPins;
|
|
17641
|
-
var diodeConnectionKeys =
|
|
17857
|
+
var diodeConnectionKeys = z92.enum([
|
|
17642
17858
|
"anode",
|
|
17643
17859
|
"cathode",
|
|
17644
17860
|
"pin1",
|
|
@@ -17646,13 +17862,13 @@ var diodeConnectionKeys = z87.enum([
|
|
|
17646
17862
|
"pos",
|
|
17647
17863
|
"neg"
|
|
17648
17864
|
]);
|
|
17649
|
-
var connectionTarget3 =
|
|
17650
|
-
var connectionsProp2 =
|
|
17651
|
-
var diodePinLabelsProp =
|
|
17652
|
-
|
|
17653
|
-
schematicPinLabel.or(
|
|
17865
|
+
var connectionTarget3 = z92.string().or(z92.array(z92.string()).readonly()).or(z92.array(z92.string()));
|
|
17866
|
+
var connectionsProp2 = z92.record(diodeConnectionKeys, connectionTarget3);
|
|
17867
|
+
var diodePinLabelsProp = z92.record(
|
|
17868
|
+
z92.enum(diodePins),
|
|
17869
|
+
schematicPinLabel.or(z92.array(schematicPinLabel).readonly()).or(z92.array(schematicPinLabel))
|
|
17654
17870
|
);
|
|
17655
|
-
var diodeVariant =
|
|
17871
|
+
var diodeVariant = z92.enum([
|
|
17656
17872
|
"standard",
|
|
17657
17873
|
"schottky",
|
|
17658
17874
|
"zener",
|
|
@@ -17663,12 +17879,12 @@ var diodeVariant = z87.enum([
|
|
|
17663
17879
|
var diodeProps = commonComponentProps.extend({
|
|
17664
17880
|
connections: connectionsProp2.optional(),
|
|
17665
17881
|
variant: diodeVariant.optional().default("standard"),
|
|
17666
|
-
standard:
|
|
17667
|
-
schottky:
|
|
17668
|
-
zener:
|
|
17669
|
-
avalanche:
|
|
17670
|
-
photo:
|
|
17671
|
-
tvs:
|
|
17882
|
+
standard: z92.boolean().optional(),
|
|
17883
|
+
schottky: z92.boolean().optional(),
|
|
17884
|
+
zener: z92.boolean().optional(),
|
|
17885
|
+
avalanche: z92.boolean().optional(),
|
|
17886
|
+
photo: z92.boolean().optional(),
|
|
17887
|
+
tvs: z92.boolean().optional(),
|
|
17672
17888
|
schOrientation: schematicOrientation.optional(),
|
|
17673
17889
|
pinLabels: diodePinLabelsProp.optional()
|
|
17674
17890
|
}).superRefine((data, ctx) => {
|
|
@@ -17682,11 +17898,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17682
17898
|
].filter(Boolean).length;
|
|
17683
17899
|
if (enabledFlags > 1) {
|
|
17684
17900
|
ctx.addIssue({
|
|
17685
|
-
code:
|
|
17901
|
+
code: z92.ZodIssueCode.custom,
|
|
17686
17902
|
message: "Exactly one diode variant must be enabled",
|
|
17687
17903
|
path: []
|
|
17688
17904
|
});
|
|
17689
|
-
return
|
|
17905
|
+
return z92.INVALID;
|
|
17690
17906
|
}
|
|
17691
17907
|
}).transform((data) => {
|
|
17692
17908
|
const result = {
|
|
@@ -17732,34 +17948,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17732
17948
|
expectTypesMatch(true);
|
|
17733
17949
|
|
|
17734
17950
|
// lib/components/led.ts
|
|
17735
|
-
import { z as
|
|
17951
|
+
import { z as z93 } from "zod";
|
|
17736
17952
|
var ledProps = commonComponentProps.extend({
|
|
17737
|
-
color:
|
|
17738
|
-
wavelength:
|
|
17739
|
-
schDisplayValue:
|
|
17953
|
+
color: z93.string().optional(),
|
|
17954
|
+
wavelength: z93.string().optional(),
|
|
17955
|
+
schDisplayValue: z93.string().optional(),
|
|
17740
17956
|
schOrientation: schematicOrientation.optional(),
|
|
17741
17957
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17742
|
-
laser:
|
|
17958
|
+
laser: z93.boolean().optional()
|
|
17743
17959
|
});
|
|
17744
17960
|
var ledPins = lrPolarPins;
|
|
17745
17961
|
|
|
17746
17962
|
// lib/components/switch.ts
|
|
17747
|
-
import { ms as
|
|
17748
|
-
import { z as
|
|
17963
|
+
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
17964
|
+
import { z as z94 } from "zod";
|
|
17749
17965
|
var switchProps = commonComponentProps.extend({
|
|
17750
|
-
type:
|
|
17751
|
-
isNormallyClosed:
|
|
17752
|
-
spst:
|
|
17753
|
-
spdt:
|
|
17754
|
-
dpst:
|
|
17755
|
-
dpdt:
|
|
17966
|
+
type: z94.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17967
|
+
isNormallyClosed: z94.boolean().optional().default(false),
|
|
17968
|
+
spst: z94.boolean().optional(),
|
|
17969
|
+
spdt: z94.boolean().optional(),
|
|
17970
|
+
dpst: z94.boolean().optional(),
|
|
17971
|
+
dpdt: z94.boolean().optional(),
|
|
17756
17972
|
pinLabels: pinLabelsProp.optional(),
|
|
17757
|
-
simSwitchFrequency:
|
|
17758
|
-
simCloseAt:
|
|
17759
|
-
simOpenAt:
|
|
17760
|
-
simStartClosed:
|
|
17761
|
-
simStartOpen:
|
|
17762
|
-
connections:
|
|
17973
|
+
simSwitchFrequency: frequency4.optional(),
|
|
17974
|
+
simCloseAt: ms3.optional(),
|
|
17975
|
+
simOpenAt: ms3.optional(),
|
|
17976
|
+
simStartClosed: z94.boolean().optional(),
|
|
17977
|
+
simStartOpen: z94.boolean().optional(),
|
|
17978
|
+
connections: z94.custom().pipe(z94.record(z94.string(), connectionTarget)).optional()
|
|
17763
17979
|
}).transform((props) => {
|
|
17764
17980
|
const updatedProps = { ...props };
|
|
17765
17981
|
if (updatedProps.dpdt) {
|
|
@@ -17791,33 +18007,33 @@ expectTypesMatch(true);
|
|
|
17791
18007
|
|
|
17792
18008
|
// lib/components/fabrication-note-text.ts
|
|
17793
18009
|
import { length as length4 } from "circuit-json";
|
|
17794
|
-
import { z as
|
|
18010
|
+
import { z as z95 } from "zod";
|
|
17795
18011
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17796
|
-
text:
|
|
17797
|
-
anchorAlignment:
|
|
17798
|
-
font:
|
|
18012
|
+
text: z95.string(),
|
|
18013
|
+
anchorAlignment: z95.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18014
|
+
font: z95.enum(["tscircuit2024"]).optional(),
|
|
17799
18015
|
fontSize: length4.optional(),
|
|
17800
|
-
color:
|
|
18016
|
+
color: z95.string().optional()
|
|
17801
18017
|
});
|
|
17802
18018
|
expectTypesMatch(true);
|
|
17803
18019
|
|
|
17804
18020
|
// lib/components/fabrication-note-rect.ts
|
|
17805
18021
|
import { distance as distance21 } from "circuit-json";
|
|
17806
|
-
import { z as
|
|
18022
|
+
import { z as z96 } from "zod";
|
|
17807
18023
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17808
18024
|
width: distance21,
|
|
17809
18025
|
height: distance21,
|
|
17810
18026
|
strokeWidth: distance21.optional(),
|
|
17811
|
-
isFilled:
|
|
17812
|
-
hasStroke:
|
|
17813
|
-
isStrokeDashed:
|
|
17814
|
-
color:
|
|
18027
|
+
isFilled: z96.boolean().optional(),
|
|
18028
|
+
hasStroke: z96.boolean().optional(),
|
|
18029
|
+
isStrokeDashed: z96.boolean().optional(),
|
|
18030
|
+
color: z96.string().optional(),
|
|
17815
18031
|
cornerRadius: distance21.optional()
|
|
17816
18032
|
});
|
|
17817
18033
|
|
|
17818
18034
|
// lib/components/fabrication-note-path.ts
|
|
17819
18035
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17820
|
-
import { z as
|
|
18036
|
+
import { z as z97 } from "zod";
|
|
17821
18037
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17822
18038
|
pcbLeftEdgeX: true,
|
|
17823
18039
|
pcbRightEdgeX: true,
|
|
@@ -17829,15 +18045,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17829
18045
|
pcbOffsetY: true,
|
|
17830
18046
|
pcbRotation: true
|
|
17831
18047
|
}).extend({
|
|
17832
|
-
route:
|
|
18048
|
+
route: z97.array(route_hint_point3),
|
|
17833
18049
|
strokeWidth: length5.optional(),
|
|
17834
|
-
color:
|
|
18050
|
+
color: z97.string().optional()
|
|
17835
18051
|
});
|
|
17836
18052
|
|
|
17837
18053
|
// lib/components/fabrication-note-dimension.ts
|
|
17838
18054
|
import { distance as distance22, length as length6 } from "circuit-json";
|
|
17839
|
-
import { z as
|
|
17840
|
-
var dimensionTarget =
|
|
18055
|
+
import { z as z98 } from "zod";
|
|
18056
|
+
var dimensionTarget = z98.union([z98.string(), point]);
|
|
17841
18057
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17842
18058
|
pcbLeftEdgeX: true,
|
|
17843
18059
|
pcbRightEdgeX: true,
|
|
@@ -17851,54 +18067,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17851
18067
|
}).extend({
|
|
17852
18068
|
from: dimensionTarget,
|
|
17853
18069
|
to: dimensionTarget,
|
|
17854
|
-
text:
|
|
18070
|
+
text: z98.string().optional(),
|
|
17855
18071
|
offset: distance22.optional(),
|
|
17856
|
-
font:
|
|
18072
|
+
font: z98.enum(["tscircuit2024"]).optional(),
|
|
17857
18073
|
fontSize: length6.optional(),
|
|
17858
|
-
color:
|
|
18074
|
+
color: z98.string().optional(),
|
|
17859
18075
|
arrowSize: distance22.optional(),
|
|
17860
|
-
units:
|
|
17861
|
-
outerEdgeToEdge:
|
|
17862
|
-
centerToCenter:
|
|
17863
|
-
innerEdgeToEdge:
|
|
18076
|
+
units: z98.enum(["in", "mm"]).optional(),
|
|
18077
|
+
outerEdgeToEdge: z98.literal(true).optional(),
|
|
18078
|
+
centerToCenter: z98.literal(true).optional(),
|
|
18079
|
+
innerEdgeToEdge: z98.literal(true).optional()
|
|
17864
18080
|
});
|
|
17865
18081
|
expectTypesMatch(true);
|
|
17866
18082
|
|
|
17867
18083
|
// lib/components/pcb-trace.ts
|
|
17868
18084
|
import { distance as distance23, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17869
|
-
import { z as
|
|
17870
|
-
var pcbTraceProps =
|
|
17871
|
-
layer:
|
|
18085
|
+
import { z as z99 } from "zod";
|
|
18086
|
+
var pcbTraceProps = z99.object({
|
|
18087
|
+
layer: z99.string().optional(),
|
|
17872
18088
|
thickness: distance23.optional(),
|
|
17873
|
-
route:
|
|
18089
|
+
route: z99.array(route_hint_point4)
|
|
17874
18090
|
});
|
|
17875
18091
|
|
|
17876
18092
|
// lib/components/via.ts
|
|
17877
18093
|
import { distance as distance24, layer_ref as layer_ref6 } from "circuit-json";
|
|
17878
|
-
import { z as
|
|
18094
|
+
import { z as z100 } from "zod";
|
|
17879
18095
|
var viaProps = commonLayoutProps.extend({
|
|
17880
|
-
name:
|
|
18096
|
+
name: z100.string().optional(),
|
|
17881
18097
|
fromLayer: layer_ref6.optional(),
|
|
17882
18098
|
toLayer: layer_ref6.optional(),
|
|
17883
18099
|
holeDiameter: distance24.optional(),
|
|
17884
18100
|
outerDiameter: distance24.optional(),
|
|
17885
|
-
layers:
|
|
17886
|
-
connectsTo:
|
|
17887
|
-
netIsAssignable:
|
|
18101
|
+
layers: z100.array(layer_ref6).optional(),
|
|
18102
|
+
connectsTo: z100.string().or(z100.array(z100.string())).optional(),
|
|
18103
|
+
netIsAssignable: z100.boolean().optional()
|
|
17888
18104
|
});
|
|
17889
18105
|
expectTypesMatch(true);
|
|
17890
18106
|
|
|
17891
18107
|
// lib/components/testpoint.ts
|
|
17892
18108
|
import { distance as distance25 } from "circuit-json";
|
|
17893
|
-
import { z as
|
|
18109
|
+
import { z as z101 } from "zod";
|
|
17894
18110
|
var testpointPins = ["pin1"];
|
|
17895
|
-
var testpointConnectionsProp =
|
|
18111
|
+
var testpointConnectionsProp = z101.object({
|
|
17896
18112
|
pin1: connectionTarget
|
|
17897
18113
|
}).strict();
|
|
17898
18114
|
var testpointProps = commonComponentProps.extend({
|
|
17899
18115
|
connections: testpointConnectionsProp.optional(),
|
|
17900
|
-
footprintVariant:
|
|
17901
|
-
padShape:
|
|
18116
|
+
footprintVariant: z101.enum(["pad", "through_hole"]).optional(),
|
|
18117
|
+
padShape: z101.enum(["rect", "circle"]).optional().default("circle"),
|
|
17902
18118
|
padDiameter: distance25.optional(),
|
|
17903
18119
|
holeDiameter: distance25.optional(),
|
|
17904
18120
|
width: distance25.optional(),
|
|
@@ -17910,45 +18126,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17910
18126
|
expectTypesMatch(true);
|
|
17911
18127
|
|
|
17912
18128
|
// lib/components/breakoutpoint.ts
|
|
17913
|
-
import { z as
|
|
18129
|
+
import { z as z102 } from "zod";
|
|
17914
18130
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17915
|
-
connection:
|
|
18131
|
+
connection: z102.string()
|
|
17916
18132
|
});
|
|
17917
18133
|
expectTypesMatch(true);
|
|
17918
18134
|
|
|
17919
18135
|
// lib/components/pcb-keepout.ts
|
|
17920
18136
|
import { distance as distance26, layer_ref as layer_ref7 } from "circuit-json";
|
|
17921
|
-
import { z as
|
|
17922
|
-
var pcbKeepoutProps =
|
|
18137
|
+
import { z as z103 } from "zod";
|
|
18138
|
+
var pcbKeepoutProps = z103.union([
|
|
17923
18139
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17924
|
-
shape:
|
|
18140
|
+
shape: z103.literal("circle"),
|
|
17925
18141
|
radius: distance26,
|
|
17926
|
-
layers:
|
|
18142
|
+
layers: z103.array(layer_ref7).optional()
|
|
17927
18143
|
}),
|
|
17928
18144
|
pcbLayoutProps.extend({
|
|
17929
|
-
shape:
|
|
18145
|
+
shape: z103.literal("rect"),
|
|
17930
18146
|
width: distance26,
|
|
17931
18147
|
height: distance26,
|
|
17932
|
-
layers:
|
|
18148
|
+
layers: z103.array(layer_ref7).optional()
|
|
17933
18149
|
})
|
|
17934
18150
|
]);
|
|
17935
18151
|
|
|
17936
18152
|
// lib/components/courtyard-rect.ts
|
|
17937
18153
|
import { distance as distance27 } from "circuit-json";
|
|
17938
|
-
import { z as
|
|
18154
|
+
import { z as z104 } from "zod";
|
|
17939
18155
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
17940
18156
|
width: distance27,
|
|
17941
18157
|
height: distance27,
|
|
17942
18158
|
strokeWidth: distance27.optional(),
|
|
17943
|
-
isFilled:
|
|
17944
|
-
hasStroke:
|
|
17945
|
-
isStrokeDashed:
|
|
17946
|
-
color:
|
|
18159
|
+
isFilled: z104.boolean().optional(),
|
|
18160
|
+
hasStroke: z104.boolean().optional(),
|
|
18161
|
+
isStrokeDashed: z104.boolean().optional(),
|
|
18162
|
+
color: z104.string().optional()
|
|
17947
18163
|
});
|
|
17948
18164
|
|
|
17949
18165
|
// lib/components/courtyard-outline.ts
|
|
17950
18166
|
import { length as length7 } from "circuit-json";
|
|
17951
|
-
import { z as
|
|
18167
|
+
import { z as z105 } from "zod";
|
|
17952
18168
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17953
18169
|
pcbLeftEdgeX: true,
|
|
17954
18170
|
pcbRightEdgeX: true,
|
|
@@ -17960,11 +18176,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17960
18176
|
pcbOffsetY: true,
|
|
17961
18177
|
pcbRotation: true
|
|
17962
18178
|
}).extend({
|
|
17963
|
-
outline:
|
|
18179
|
+
outline: z105.array(point),
|
|
17964
18180
|
strokeWidth: length7.optional(),
|
|
17965
|
-
isClosed:
|
|
17966
|
-
isStrokeDashed:
|
|
17967
|
-
color:
|
|
18181
|
+
isClosed: z105.boolean().optional(),
|
|
18182
|
+
isStrokeDashed: z105.boolean().optional(),
|
|
18183
|
+
color: z105.string().optional()
|
|
17968
18184
|
});
|
|
17969
18185
|
|
|
17970
18186
|
// lib/components/courtyard-circle.ts
|
|
@@ -17984,35 +18200,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17984
18200
|
});
|
|
17985
18201
|
|
|
17986
18202
|
// lib/components/copper-pour.ts
|
|
17987
|
-
import { z as
|
|
18203
|
+
import { z as z108 } from "zod";
|
|
17988
18204
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17989
|
-
var copperPourProps =
|
|
17990
|
-
name:
|
|
18205
|
+
var copperPourProps = z108.object({
|
|
18206
|
+
name: z108.string().optional(),
|
|
17991
18207
|
layer: layer_ref8,
|
|
17992
|
-
connectsTo:
|
|
17993
|
-
unbroken:
|
|
18208
|
+
connectsTo: z108.string(),
|
|
18209
|
+
unbroken: z108.boolean().optional(),
|
|
17994
18210
|
padMargin: distance.optional(),
|
|
17995
18211
|
traceMargin: distance.optional(),
|
|
17996
18212
|
clearance: distance.optional(),
|
|
17997
18213
|
boardEdgeMargin: distance.optional(),
|
|
17998
18214
|
cutoutMargin: distance.optional(),
|
|
17999
|
-
outline:
|
|
18000
|
-
coveredWithSolderMask:
|
|
18215
|
+
outline: z108.array(point).optional(),
|
|
18216
|
+
coveredWithSolderMask: z108.boolean().optional().default(true)
|
|
18001
18217
|
});
|
|
18002
18218
|
expectTypesMatch(true);
|
|
18003
18219
|
|
|
18004
18220
|
// lib/components/cadassembly.ts
|
|
18005
18221
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
18006
|
-
import { z as
|
|
18007
|
-
var cadassemblyProps =
|
|
18222
|
+
import { z as z109 } from "zod";
|
|
18223
|
+
var cadassemblyProps = z109.object({
|
|
18008
18224
|
originalLayer: layer_ref9.default("top").optional(),
|
|
18009
|
-
children:
|
|
18225
|
+
children: z109.any().optional()
|
|
18010
18226
|
});
|
|
18011
18227
|
expectTypesMatch(true);
|
|
18012
18228
|
|
|
18013
18229
|
// lib/components/cadmodel.ts
|
|
18014
|
-
import { z as
|
|
18015
|
-
var pcbPosition =
|
|
18230
|
+
import { z as z110 } from "zod";
|
|
18231
|
+
var pcbPosition = z110.object({
|
|
18016
18232
|
pcbX: pcbCoordinate.optional(),
|
|
18017
18233
|
pcbY: pcbCoordinate.optional(),
|
|
18018
18234
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18029,19 +18245,19 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18029
18245
|
});
|
|
18030
18246
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18031
18247
|
expectTypesMatch(true);
|
|
18032
|
-
var cadmodelProps =
|
|
18248
|
+
var cadmodelProps = z110.union([z110.null(), url, cadModelObject]);
|
|
18033
18249
|
|
|
18034
18250
|
// lib/components/power-source.ts
|
|
18035
|
-
import { voltage as
|
|
18251
|
+
import { voltage as voltage5 } from "circuit-json";
|
|
18036
18252
|
var powerSourceProps = commonComponentProps.extend({
|
|
18037
|
-
voltage:
|
|
18253
|
+
voltage: voltage5
|
|
18038
18254
|
});
|
|
18039
18255
|
|
|
18040
18256
|
// lib/components/voltagesource.ts
|
|
18041
|
-
import { frequency as
|
|
18042
|
-
import { z as
|
|
18257
|
+
import { frequency as frequency5, ms as ms4, rotation as rotation5, voltage as voltage6 } from "circuit-json";
|
|
18258
|
+
import { z as z111 } from "zod";
|
|
18043
18259
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18044
|
-
var percentage =
|
|
18260
|
+
var percentage = z111.union([z111.string(), z111.number()]).transform((val) => {
|
|
18045
18261
|
if (typeof val === "string") {
|
|
18046
18262
|
if (val.endsWith("%")) {
|
|
18047
18263
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18050,30 +18266,32 @@ var percentage = z106.union([z106.string(), z106.number()]).transform((val) => {
|
|
|
18050
18266
|
}
|
|
18051
18267
|
return val;
|
|
18052
18268
|
}).pipe(
|
|
18053
|
-
|
|
18269
|
+
z111.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18054
18270
|
);
|
|
18055
18271
|
var voltageSourceProps = commonComponentProps.extend({
|
|
18056
|
-
voltage:
|
|
18057
|
-
frequency:
|
|
18058
|
-
peakToPeakVoltage:
|
|
18059
|
-
waveShape:
|
|
18272
|
+
voltage: voltage6.optional(),
|
|
18273
|
+
frequency: frequency5.optional(),
|
|
18274
|
+
peakToPeakVoltage: voltage6.optional(),
|
|
18275
|
+
waveShape: z111.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18060
18276
|
phase: rotation5.optional(),
|
|
18061
18277
|
dutyCycle: percentage.optional(),
|
|
18062
|
-
pulseDelay:
|
|
18063
|
-
riseTime:
|
|
18064
|
-
fallTime:
|
|
18065
|
-
pulseWidth:
|
|
18066
|
-
period:
|
|
18278
|
+
pulseDelay: ms4.optional(),
|
|
18279
|
+
riseTime: ms4.optional(),
|
|
18280
|
+
fallTime: ms4.optional(),
|
|
18281
|
+
pulseWidth: ms4.optional(),
|
|
18282
|
+
period: ms4.optional(),
|
|
18283
|
+
acMagnitude: voltage6.optional(),
|
|
18284
|
+
acPhase: rotation5.optional(),
|
|
18067
18285
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
18068
18286
|
});
|
|
18069
18287
|
var voltageSourcePins = lrPolarPins;
|
|
18070
18288
|
expectTypesMatch(true);
|
|
18071
18289
|
|
|
18072
18290
|
// lib/components/currentsource.ts
|
|
18073
|
-
import { frequency as
|
|
18074
|
-
import { z as
|
|
18291
|
+
import { frequency as frequency6, rotation as rotation6, current as current3 } from "circuit-json";
|
|
18292
|
+
import { z as z112 } from "zod";
|
|
18075
18293
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18076
|
-
var percentage2 =
|
|
18294
|
+
var percentage2 = z112.union([z112.string(), z112.number()]).transform((val) => {
|
|
18077
18295
|
if (typeof val === "string") {
|
|
18078
18296
|
if (val.endsWith("%")) {
|
|
18079
18297
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -18082,36 +18300,38 @@ var percentage2 = z107.union([z107.string(), z107.number()]).transform((val) =>
|
|
|
18082
18300
|
}
|
|
18083
18301
|
return val;
|
|
18084
18302
|
}).pipe(
|
|
18085
|
-
|
|
18303
|
+
z112.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18086
18304
|
);
|
|
18087
18305
|
var currentSourceProps = commonComponentProps.extend({
|
|
18088
|
-
current:
|
|
18089
|
-
frequency:
|
|
18090
|
-
peakToPeakCurrent:
|
|
18091
|
-
waveShape:
|
|
18306
|
+
current: current3.optional(),
|
|
18307
|
+
frequency: frequency6.optional(),
|
|
18308
|
+
peakToPeakCurrent: current3.optional(),
|
|
18309
|
+
waveShape: z112.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18092
18310
|
phase: rotation6.optional(),
|
|
18093
18311
|
dutyCycle: percentage2.optional(),
|
|
18312
|
+
acMagnitude: current3.optional(),
|
|
18313
|
+
acPhase: rotation6.optional(),
|
|
18094
18314
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
18095
18315
|
});
|
|
18096
18316
|
var currentSourcePins = lrPolarPins;
|
|
18097
18317
|
expectTypesMatch(true);
|
|
18098
18318
|
|
|
18099
18319
|
// lib/components/voltageprobe.ts
|
|
18100
|
-
import { z as
|
|
18320
|
+
import { z as z113 } from "zod";
|
|
18101
18321
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18102
|
-
name:
|
|
18103
|
-
connectsTo:
|
|
18104
|
-
referenceTo:
|
|
18105
|
-
color:
|
|
18106
|
-
graphDisplayName:
|
|
18107
|
-
graphCenter:
|
|
18108
|
-
graphVerticalOffset:
|
|
18109
|
-
graphVoltagePerDiv:
|
|
18322
|
+
name: z113.string().optional(),
|
|
18323
|
+
connectsTo: z113.string(),
|
|
18324
|
+
referenceTo: z113.string().optional(),
|
|
18325
|
+
color: z113.string().optional(),
|
|
18326
|
+
graphDisplayName: z113.string().optional(),
|
|
18327
|
+
graphCenter: z113.number().optional(),
|
|
18328
|
+
graphVerticalOffset: z113.number().or(z113.string()).optional(),
|
|
18329
|
+
graphVoltagePerDiv: z113.number().or(z113.string()).optional()
|
|
18110
18330
|
});
|
|
18111
18331
|
expectTypesMatch(true);
|
|
18112
18332
|
|
|
18113
18333
|
// lib/components/ammeter.ts
|
|
18114
|
-
import { z as
|
|
18334
|
+
import { z as z114 } from "zod";
|
|
18115
18335
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18116
18336
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18117
18337
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18121,63 +18341,63 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18121
18341
|
hasAmmeterConnectionPair,
|
|
18122
18342
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18123
18343
|
),
|
|
18124
|
-
color:
|
|
18125
|
-
graphDisplayName:
|
|
18126
|
-
graphCenter:
|
|
18127
|
-
graphVerticalOffset:
|
|
18128
|
-
graphCurrentPerDiv:
|
|
18344
|
+
color: z114.string().optional(),
|
|
18345
|
+
graphDisplayName: z114.string().optional(),
|
|
18346
|
+
graphCenter: z114.number().optional(),
|
|
18347
|
+
graphVerticalOffset: z114.number().or(z114.string()).optional(),
|
|
18348
|
+
graphCurrentPerDiv: z114.number().or(z114.string()).optional()
|
|
18129
18349
|
});
|
|
18130
18350
|
var ammeterPins = ammeterPinLabels;
|
|
18131
18351
|
expectTypesMatch(true);
|
|
18132
18352
|
|
|
18133
18353
|
// lib/components/schematic-arc.ts
|
|
18134
18354
|
import { distance as distance30, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18135
|
-
import { z as
|
|
18136
|
-
var schematicArcProps =
|
|
18355
|
+
import { z as z115 } from "zod";
|
|
18356
|
+
var schematicArcProps = z115.object({
|
|
18137
18357
|
center: point5,
|
|
18138
18358
|
radius: distance30,
|
|
18139
18359
|
startAngleDegrees: rotation7,
|
|
18140
18360
|
endAngleDegrees: rotation7,
|
|
18141
|
-
direction:
|
|
18361
|
+
direction: z115.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18142
18362
|
strokeWidth: distance30.optional(),
|
|
18143
|
-
color:
|
|
18144
|
-
isDashed:
|
|
18363
|
+
color: z115.string().optional(),
|
|
18364
|
+
isDashed: z115.boolean().optional().default(false)
|
|
18145
18365
|
});
|
|
18146
18366
|
expectTypesMatch(true);
|
|
18147
18367
|
|
|
18148
18368
|
// lib/components/toolingrail.ts
|
|
18149
|
-
import { z as
|
|
18150
|
-
var toolingrailProps =
|
|
18151
|
-
children:
|
|
18369
|
+
import { z as z116 } from "zod";
|
|
18370
|
+
var toolingrailProps = z116.object({
|
|
18371
|
+
children: z116.any().optional()
|
|
18152
18372
|
});
|
|
18153
18373
|
expectTypesMatch(true);
|
|
18154
18374
|
|
|
18155
18375
|
// lib/components/schematic-box.ts
|
|
18156
18376
|
import { distance as distance31 } from "circuit-json";
|
|
18157
|
-
import { z as
|
|
18158
|
-
var schematicBoxProps =
|
|
18159
|
-
name:
|
|
18160
|
-
chipRef:
|
|
18377
|
+
import { z as z117 } from "zod";
|
|
18378
|
+
var schematicBoxProps = z117.object({
|
|
18379
|
+
name: z117.string().optional(),
|
|
18380
|
+
chipRef: z117.string().optional(),
|
|
18161
18381
|
pinLabels: pinLabelsProp.optional(),
|
|
18162
18382
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18163
18383
|
schX: distance31.optional(),
|
|
18164
18384
|
schY: distance31.optional(),
|
|
18165
|
-
schSectionName:
|
|
18166
|
-
schSheetName:
|
|
18385
|
+
schSectionName: z117.string().optional(),
|
|
18386
|
+
schSheetName: z117.string().optional(),
|
|
18167
18387
|
width: distance31.optional(),
|
|
18168
18388
|
height: distance31.optional(),
|
|
18169
|
-
overlay:
|
|
18389
|
+
overlay: z117.array(z117.string()).optional(),
|
|
18170
18390
|
padding: distance31.optional(),
|
|
18171
18391
|
paddingLeft: distance31.optional(),
|
|
18172
18392
|
paddingRight: distance31.optional(),
|
|
18173
18393
|
paddingTop: distance31.optional(),
|
|
18174
18394
|
paddingBottom: distance31.optional(),
|
|
18175
|
-
title:
|
|
18395
|
+
title: z117.string().optional(),
|
|
18176
18396
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18177
|
-
titleColor:
|
|
18397
|
+
titleColor: z117.string().optional(),
|
|
18178
18398
|
titleFontSize: distance31.optional(),
|
|
18179
|
-
titleInside:
|
|
18180
|
-
strokeStyle:
|
|
18399
|
+
titleInside: z117.boolean().default(false),
|
|
18400
|
+
strokeStyle: z117.enum(["solid", "dashed"]).default("solid")
|
|
18181
18401
|
}).refine(
|
|
18182
18402
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18183
18403
|
{
|
|
@@ -18193,21 +18413,21 @@ expectTypesMatch(true);
|
|
|
18193
18413
|
|
|
18194
18414
|
// lib/components/schematic-symbol.ts
|
|
18195
18415
|
import { rotation as rotation8 } from "circuit-json";
|
|
18196
|
-
import { z as
|
|
18197
|
-
var schematicSymbolConnections =
|
|
18416
|
+
import { z as z118 } from "zod";
|
|
18417
|
+
var schematicSymbolConnections = z118.custom().pipe(z118.record(z118.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
18198
18418
|
message: "connections must map at least one schematic symbol port"
|
|
18199
18419
|
});
|
|
18200
|
-
var schematicSymbolProps =
|
|
18201
|
-
name:
|
|
18202
|
-
displayName:
|
|
18203
|
-
chipRef:
|
|
18204
|
-
symbolName:
|
|
18420
|
+
var schematicSymbolProps = z118.object({
|
|
18421
|
+
name: z118.string().min(1),
|
|
18422
|
+
displayName: z118.string().optional(),
|
|
18423
|
+
chipRef: z118.string().min(1).optional(),
|
|
18424
|
+
symbolName: z118.string().min(1),
|
|
18205
18425
|
connections: schematicSymbolConnections.optional(),
|
|
18206
18426
|
schX: distance.optional(),
|
|
18207
18427
|
schY: distance.optional(),
|
|
18208
18428
|
schRotation: rotation8.optional(),
|
|
18209
|
-
schSectionName:
|
|
18210
|
-
schSheetName:
|
|
18429
|
+
schSectionName: z118.string().optional(),
|
|
18430
|
+
schSheetName: z118.string().optional()
|
|
18211
18431
|
});
|
|
18212
18432
|
expectTypesMatch(
|
|
18213
18433
|
true
|
|
@@ -18215,15 +18435,15 @@ expectTypesMatch(
|
|
|
18215
18435
|
|
|
18216
18436
|
// lib/components/schematic-circle.ts
|
|
18217
18437
|
import { distance as distance32, point as point6 } from "circuit-json";
|
|
18218
|
-
import { z as
|
|
18219
|
-
var schematicCircleProps =
|
|
18438
|
+
import { z as z119 } from "zod";
|
|
18439
|
+
var schematicCircleProps = z119.object({
|
|
18220
18440
|
center: point6,
|
|
18221
18441
|
radius: distance32,
|
|
18222
18442
|
strokeWidth: distance32.optional(),
|
|
18223
|
-
color:
|
|
18224
|
-
isFilled:
|
|
18225
|
-
fillColor:
|
|
18226
|
-
isDashed:
|
|
18443
|
+
color: z119.string().optional(),
|
|
18444
|
+
isFilled: z119.boolean().optional().default(false),
|
|
18445
|
+
fillColor: z119.string().optional(),
|
|
18446
|
+
isDashed: z119.boolean().optional().default(false)
|
|
18227
18447
|
});
|
|
18228
18448
|
expectTypesMatch(
|
|
18229
18449
|
true
|
|
@@ -18231,32 +18451,32 @@ expectTypesMatch(
|
|
|
18231
18451
|
|
|
18232
18452
|
// lib/components/schematic-rect.ts
|
|
18233
18453
|
import { distance as distance33, rotation as rotation9 } from "circuit-json";
|
|
18234
|
-
import { z as
|
|
18235
|
-
var schematicRectProps =
|
|
18454
|
+
import { z as z120 } from "zod";
|
|
18455
|
+
var schematicRectProps = z120.object({
|
|
18236
18456
|
schX: distance33.optional(),
|
|
18237
18457
|
schY: distance33.optional(),
|
|
18238
18458
|
width: distance33,
|
|
18239
18459
|
height: distance33,
|
|
18240
18460
|
rotation: rotation9.default(0),
|
|
18241
18461
|
strokeWidth: distance33.optional(),
|
|
18242
|
-
color:
|
|
18243
|
-
isFilled:
|
|
18244
|
-
fillColor:
|
|
18245
|
-
isDashed:
|
|
18462
|
+
color: z120.string().optional(),
|
|
18463
|
+
isFilled: z120.boolean().optional().default(false),
|
|
18464
|
+
fillColor: z120.string().optional(),
|
|
18465
|
+
isDashed: z120.boolean().optional().default(false)
|
|
18246
18466
|
});
|
|
18247
18467
|
expectTypesMatch(true);
|
|
18248
18468
|
|
|
18249
18469
|
// lib/components/schematic-line.ts
|
|
18250
18470
|
import { distance as distance34 } from "circuit-json";
|
|
18251
|
-
import { z as
|
|
18252
|
-
var schematicLineProps =
|
|
18471
|
+
import { z as z121 } from "zod";
|
|
18472
|
+
var schematicLineProps = z121.object({
|
|
18253
18473
|
x1: distance34,
|
|
18254
18474
|
y1: distance34,
|
|
18255
18475
|
x2: distance34,
|
|
18256
18476
|
y2: distance34,
|
|
18257
18477
|
strokeWidth: distance34.optional(),
|
|
18258
|
-
color:
|
|
18259
|
-
isDashed:
|
|
18478
|
+
color: z121.string().optional(),
|
|
18479
|
+
isDashed: z121.boolean().optional().default(false),
|
|
18260
18480
|
dashLength: distance34.optional(),
|
|
18261
18481
|
dashGap: distance34.optional()
|
|
18262
18482
|
});
|
|
@@ -18264,11 +18484,11 @@ expectTypesMatch(true);
|
|
|
18264
18484
|
|
|
18265
18485
|
// lib/components/schematic-text.ts
|
|
18266
18486
|
import { distance as distance35, rotation as rotation10 } from "circuit-json";
|
|
18267
|
-
import { z as
|
|
18487
|
+
import { z as z123 } from "zod";
|
|
18268
18488
|
|
|
18269
18489
|
// lib/common/fivePointAnchor.ts
|
|
18270
|
-
import { z as
|
|
18271
|
-
var fivePointAnchor =
|
|
18490
|
+
import { z as z122 } from "zod";
|
|
18491
|
+
var fivePointAnchor = z122.enum([
|
|
18272
18492
|
"center",
|
|
18273
18493
|
"left",
|
|
18274
18494
|
"right",
|
|
@@ -18277,39 +18497,39 @@ var fivePointAnchor = z117.enum([
|
|
|
18277
18497
|
]);
|
|
18278
18498
|
|
|
18279
18499
|
// lib/components/schematic-text.ts
|
|
18280
|
-
var schematicTextProps =
|
|
18500
|
+
var schematicTextProps = z123.object({
|
|
18281
18501
|
schX: distance35.optional(),
|
|
18282
18502
|
schY: distance35.optional(),
|
|
18283
|
-
text:
|
|
18284
|
-
fontSize:
|
|
18285
|
-
anchor:
|
|
18286
|
-
color:
|
|
18503
|
+
text: z123.string(),
|
|
18504
|
+
fontSize: z123.number().default(1),
|
|
18505
|
+
anchor: z123.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18506
|
+
color: z123.string().default("#000000"),
|
|
18287
18507
|
schRotation: rotation10.default(0)
|
|
18288
18508
|
});
|
|
18289
18509
|
expectTypesMatch(true);
|
|
18290
18510
|
|
|
18291
18511
|
// lib/components/schematic-path.ts
|
|
18292
18512
|
import { distance as distance36, point as point7 } from "circuit-json";
|
|
18293
|
-
import { z as
|
|
18294
|
-
var schematicPathProps =
|
|
18295
|
-
points:
|
|
18296
|
-
svgPath:
|
|
18513
|
+
import { z as z124 } from "zod";
|
|
18514
|
+
var schematicPathProps = z124.object({
|
|
18515
|
+
points: z124.array(point7).optional(),
|
|
18516
|
+
svgPath: z124.string().optional(),
|
|
18297
18517
|
strokeWidth: distance36.optional(),
|
|
18298
|
-
strokeColor:
|
|
18518
|
+
strokeColor: z124.string().optional(),
|
|
18299
18519
|
dashLength: distance36.optional(),
|
|
18300
18520
|
dashGap: distance36.optional(),
|
|
18301
|
-
isFilled:
|
|
18302
|
-
fillColor:
|
|
18521
|
+
isFilled: z124.boolean().optional().default(false),
|
|
18522
|
+
fillColor: z124.string().optional()
|
|
18303
18523
|
});
|
|
18304
18524
|
expectTypesMatch(true);
|
|
18305
18525
|
|
|
18306
18526
|
// lib/components/schematic-table.ts
|
|
18307
18527
|
import { distance as distance37 } from "circuit-json";
|
|
18308
|
-
import { z as
|
|
18309
|
-
var schematicTableProps =
|
|
18528
|
+
import { z as z125 } from "zod";
|
|
18529
|
+
var schematicTableProps = z125.object({
|
|
18310
18530
|
schX: distance37.optional(),
|
|
18311
18531
|
schY: distance37.optional(),
|
|
18312
|
-
children:
|
|
18532
|
+
children: z125.any().optional(),
|
|
18313
18533
|
cellPadding: distance37.optional(),
|
|
18314
18534
|
borderWidth: distance37.optional(),
|
|
18315
18535
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18319,34 +18539,34 @@ expectTypesMatch(true);
|
|
|
18319
18539
|
|
|
18320
18540
|
// lib/components/schematic-row.ts
|
|
18321
18541
|
import { distance as distance38 } from "circuit-json";
|
|
18322
|
-
import { z as
|
|
18323
|
-
var schematicRowProps =
|
|
18324
|
-
children:
|
|
18542
|
+
import { z as z126 } from "zod";
|
|
18543
|
+
var schematicRowProps = z126.object({
|
|
18544
|
+
children: z126.any().optional(),
|
|
18325
18545
|
height: distance38.optional()
|
|
18326
18546
|
});
|
|
18327
18547
|
expectTypesMatch(true);
|
|
18328
18548
|
|
|
18329
18549
|
// lib/components/schematic-cell.ts
|
|
18330
18550
|
import { distance as distance39 } from "circuit-json";
|
|
18331
|
-
import { z as
|
|
18332
|
-
var schematicCellProps =
|
|
18333
|
-
children:
|
|
18334
|
-
horizontalAlign:
|
|
18335
|
-
verticalAlign:
|
|
18551
|
+
import { z as z127 } from "zod";
|
|
18552
|
+
var schematicCellProps = z127.object({
|
|
18553
|
+
children: z127.string().optional(),
|
|
18554
|
+
horizontalAlign: z127.enum(["left", "center", "right"]).optional(),
|
|
18555
|
+
verticalAlign: z127.enum(["top", "middle", "bottom"]).optional(),
|
|
18336
18556
|
fontSize: distance39.optional(),
|
|
18337
|
-
rowSpan:
|
|
18338
|
-
colSpan:
|
|
18557
|
+
rowSpan: z127.number().optional(),
|
|
18558
|
+
colSpan: z127.number().optional(),
|
|
18339
18559
|
width: distance39.optional(),
|
|
18340
|
-
text:
|
|
18560
|
+
text: z127.string().optional()
|
|
18341
18561
|
});
|
|
18342
18562
|
expectTypesMatch(true);
|
|
18343
18563
|
|
|
18344
18564
|
// lib/components/schematic-section.ts
|
|
18345
18565
|
import { distance as distance40 } from "circuit-json";
|
|
18346
|
-
import { z as
|
|
18347
|
-
var schematicSectionProps =
|
|
18348
|
-
displayName:
|
|
18349
|
-
name:
|
|
18566
|
+
import { z as z128 } from "zod";
|
|
18567
|
+
var schematicSectionProps = z128.object({
|
|
18568
|
+
displayName: z128.string().optional(),
|
|
18569
|
+
name: z128.string(),
|
|
18350
18570
|
sectionTitleFontSize: distance40.optional()
|
|
18351
18571
|
});
|
|
18352
18572
|
expectTypesMatch(
|
|
@@ -18354,51 +18574,51 @@ expectTypesMatch(
|
|
|
18354
18574
|
);
|
|
18355
18575
|
|
|
18356
18576
|
// lib/components/schematic-sheet.ts
|
|
18357
|
-
import { z as
|
|
18358
|
-
var schematicSheetProps =
|
|
18359
|
-
name:
|
|
18360
|
-
displayName:
|
|
18361
|
-
sheetIndex:
|
|
18362
|
-
children:
|
|
18577
|
+
import { z as z129 } from "zod";
|
|
18578
|
+
var schematicSheetProps = z129.object({
|
|
18579
|
+
name: z129.string(),
|
|
18580
|
+
displayName: z129.string(),
|
|
18581
|
+
sheetIndex: z129.number().optional(),
|
|
18582
|
+
children: z129.any().optional()
|
|
18363
18583
|
});
|
|
18364
18584
|
expectTypesMatch(true);
|
|
18365
18585
|
|
|
18366
18586
|
// lib/components/copper-text.ts
|
|
18367
18587
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18368
|
-
import { z as
|
|
18588
|
+
import { z as z130 } from "zod";
|
|
18369
18589
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18370
|
-
text:
|
|
18590
|
+
text: z130.string(),
|
|
18371
18591
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18372
|
-
font:
|
|
18592
|
+
font: z130.enum(["tscircuit2024"]).optional(),
|
|
18373
18593
|
fontSize: length8.optional(),
|
|
18374
|
-
layers:
|
|
18375
|
-
knockout:
|
|
18376
|
-
mirrored:
|
|
18594
|
+
layers: z130.array(layer_ref10).optional(),
|
|
18595
|
+
knockout: z130.boolean().optional(),
|
|
18596
|
+
mirrored: z130.boolean().optional()
|
|
18377
18597
|
});
|
|
18378
18598
|
|
|
18379
18599
|
// lib/components/silkscreen-text.ts
|
|
18380
18600
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18381
|
-
import { z as
|
|
18601
|
+
import { z as z131 } from "zod";
|
|
18382
18602
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18383
|
-
text:
|
|
18603
|
+
text: z131.string(),
|
|
18384
18604
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18385
|
-
font:
|
|
18605
|
+
font: z131.enum(["tscircuit2024"]).optional(),
|
|
18386
18606
|
fontSize: length9.optional(),
|
|
18387
18607
|
/**
|
|
18388
18608
|
* If true, text will knock out underlying silkscreen
|
|
18389
18609
|
*/
|
|
18390
|
-
isKnockout:
|
|
18610
|
+
isKnockout: z131.boolean().optional(),
|
|
18391
18611
|
knockoutPadding: length9.optional(),
|
|
18392
18612
|
knockoutPaddingLeft: length9.optional(),
|
|
18393
18613
|
knockoutPaddingRight: length9.optional(),
|
|
18394
18614
|
knockoutPaddingTop: length9.optional(),
|
|
18395
18615
|
knockoutPaddingBottom: length9.optional(),
|
|
18396
|
-
layers:
|
|
18616
|
+
layers: z131.array(layer_ref11).optional()
|
|
18397
18617
|
});
|
|
18398
18618
|
|
|
18399
18619
|
// lib/components/silkscreen-path.ts
|
|
18400
18620
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18401
|
-
import { z as
|
|
18621
|
+
import { z as z132 } from "zod";
|
|
18402
18622
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18403
18623
|
pcbLeftEdgeX: true,
|
|
18404
18624
|
pcbRightEdgeX: true,
|
|
@@ -18410,7 +18630,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18410
18630
|
pcbOffsetY: true,
|
|
18411
18631
|
pcbRotation: true
|
|
18412
18632
|
}).extend({
|
|
18413
|
-
route:
|
|
18633
|
+
route: z132.array(route_hint_point5),
|
|
18414
18634
|
strokeWidth: length10.optional()
|
|
18415
18635
|
});
|
|
18416
18636
|
|
|
@@ -18432,10 +18652,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18432
18652
|
|
|
18433
18653
|
// lib/components/silkscreen-rect.ts
|
|
18434
18654
|
import { distance as distance42 } from "circuit-json";
|
|
18435
|
-
import { z as
|
|
18655
|
+
import { z as z133 } from "zod";
|
|
18436
18656
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18437
|
-
filled:
|
|
18438
|
-
stroke:
|
|
18657
|
+
filled: z133.boolean().default(true).optional(),
|
|
18658
|
+
stroke: z133.enum(["dashed", "solid", "none"]).optional(),
|
|
18439
18659
|
strokeWidth: distance42.optional(),
|
|
18440
18660
|
width: distance42,
|
|
18441
18661
|
height: distance42,
|
|
@@ -18444,10 +18664,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18444
18664
|
|
|
18445
18665
|
// lib/components/silkscreen-circle.ts
|
|
18446
18666
|
import { distance as distance43 } from "circuit-json";
|
|
18447
|
-
import { z as
|
|
18667
|
+
import { z as z134 } from "zod";
|
|
18448
18668
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18449
|
-
isFilled:
|
|
18450
|
-
isOutline:
|
|
18669
|
+
isFilled: z134.boolean().optional(),
|
|
18670
|
+
isOutline: z134.boolean().optional(),
|
|
18451
18671
|
strokeWidth: distance43.optional(),
|
|
18452
18672
|
radius: distance43
|
|
18453
18673
|
});
|
|
@@ -18465,63 +18685,63 @@ expectTypesMatch(true);
|
|
|
18465
18685
|
|
|
18466
18686
|
// lib/components/trace-hint.ts
|
|
18467
18687
|
import { distance as distance44, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18468
|
-
import { z as
|
|
18469
|
-
var routeHintPointProps =
|
|
18688
|
+
import { z as z136 } from "zod";
|
|
18689
|
+
var routeHintPointProps = z136.object({
|
|
18470
18690
|
x: distance44,
|
|
18471
18691
|
y: distance44,
|
|
18472
|
-
via:
|
|
18692
|
+
via: z136.boolean().optional(),
|
|
18473
18693
|
toLayer: layer_ref12.optional()
|
|
18474
18694
|
});
|
|
18475
|
-
var traceHintProps =
|
|
18476
|
-
for:
|
|
18695
|
+
var traceHintProps = z136.object({
|
|
18696
|
+
for: z136.string().optional().describe(
|
|
18477
18697
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18478
18698
|
),
|
|
18479
|
-
order:
|
|
18699
|
+
order: z136.number().optional(),
|
|
18480
18700
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18481
|
-
offsets:
|
|
18482
|
-
traceWidth:
|
|
18701
|
+
offsets: z136.array(route_hint_point6).or(z136.array(routeHintPointProps)).optional(),
|
|
18702
|
+
traceWidth: z136.number().optional()
|
|
18483
18703
|
});
|
|
18484
18704
|
|
|
18485
18705
|
// lib/components/port.ts
|
|
18486
|
-
import { z as
|
|
18706
|
+
import { z as z137 } from "zod";
|
|
18487
18707
|
var portProps = commonLayoutProps.extend({
|
|
18488
|
-
name:
|
|
18489
|
-
pinNumber:
|
|
18490
|
-
schStemLength:
|
|
18491
|
-
aliases:
|
|
18492
|
-
layer:
|
|
18493
|
-
layers:
|
|
18494
|
-
schX:
|
|
18495
|
-
schY:
|
|
18708
|
+
name: z137.string().optional(),
|
|
18709
|
+
pinNumber: z137.number().optional(),
|
|
18710
|
+
schStemLength: z137.number().optional(),
|
|
18711
|
+
aliases: z137.array(z137.string()).optional(),
|
|
18712
|
+
layer: z137.string().optional(),
|
|
18713
|
+
layers: z137.array(z137.string()).optional(),
|
|
18714
|
+
schX: z137.number().optional(),
|
|
18715
|
+
schY: z137.number().optional(),
|
|
18496
18716
|
direction: direction.optional(),
|
|
18497
|
-
connectsTo:
|
|
18717
|
+
connectsTo: z137.string().or(z137.array(z137.string())).optional(),
|
|
18498
18718
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18499
|
-
hasInversionCircle:
|
|
18719
|
+
hasInversionCircle: z137.boolean().optional()
|
|
18500
18720
|
});
|
|
18501
18721
|
|
|
18502
18722
|
// lib/components/pcb-note-text.ts
|
|
18503
18723
|
import { length as length11 } from "circuit-json";
|
|
18504
|
-
import { z as
|
|
18724
|
+
import { z as z138 } from "zod";
|
|
18505
18725
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18506
|
-
text:
|
|
18507
|
-
anchorAlignment:
|
|
18508
|
-
font:
|
|
18726
|
+
text: z138.string(),
|
|
18727
|
+
anchorAlignment: z138.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18728
|
+
font: z138.enum(["tscircuit2024"]).optional(),
|
|
18509
18729
|
fontSize: length11.optional(),
|
|
18510
|
-
color:
|
|
18730
|
+
color: z138.string().optional()
|
|
18511
18731
|
});
|
|
18512
18732
|
expectTypesMatch(true);
|
|
18513
18733
|
|
|
18514
18734
|
// lib/components/pcb-note-rect.ts
|
|
18515
18735
|
import { distance as distance45 } from "circuit-json";
|
|
18516
|
-
import { z as
|
|
18736
|
+
import { z as z139 } from "zod";
|
|
18517
18737
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18518
18738
|
width: distance45,
|
|
18519
18739
|
height: distance45,
|
|
18520
18740
|
strokeWidth: distance45.optional(),
|
|
18521
|
-
isFilled:
|
|
18522
|
-
hasStroke:
|
|
18523
|
-
isStrokeDashed:
|
|
18524
|
-
color:
|
|
18741
|
+
isFilled: z139.boolean().optional(),
|
|
18742
|
+
hasStroke: z139.boolean().optional(),
|
|
18743
|
+
isStrokeDashed: z139.boolean().optional(),
|
|
18744
|
+
color: z139.string().optional(),
|
|
18525
18745
|
cornerRadius: distance45.optional()
|
|
18526
18746
|
});
|
|
18527
18747
|
expectTypesMatch(true);
|
|
@@ -18531,7 +18751,7 @@ import {
|
|
|
18531
18751
|
length as length12,
|
|
18532
18752
|
route_hint_point as route_hint_point7
|
|
18533
18753
|
} from "circuit-json";
|
|
18534
|
-
import { z as
|
|
18754
|
+
import { z as z140 } from "zod";
|
|
18535
18755
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18536
18756
|
pcbLeftEdgeX: true,
|
|
18537
18757
|
pcbRightEdgeX: true,
|
|
@@ -18543,15 +18763,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18543
18763
|
pcbOffsetY: true,
|
|
18544
18764
|
pcbRotation: true
|
|
18545
18765
|
}).extend({
|
|
18546
|
-
route:
|
|
18766
|
+
route: z140.array(route_hint_point7),
|
|
18547
18767
|
strokeWidth: length12.optional(),
|
|
18548
|
-
color:
|
|
18768
|
+
color: z140.string().optional()
|
|
18549
18769
|
});
|
|
18550
18770
|
expectTypesMatch(true);
|
|
18551
18771
|
|
|
18552
18772
|
// lib/components/pcb-note-line.ts
|
|
18553
18773
|
import { distance as distance46 } from "circuit-json";
|
|
18554
|
-
import { z as
|
|
18774
|
+
import { z as z141 } from "zod";
|
|
18555
18775
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18556
18776
|
pcbLeftEdgeX: true,
|
|
18557
18777
|
pcbRightEdgeX: true,
|
|
@@ -18568,15 +18788,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18568
18788
|
x2: distance46,
|
|
18569
18789
|
y2: distance46,
|
|
18570
18790
|
strokeWidth: distance46.optional(),
|
|
18571
|
-
color:
|
|
18572
|
-
isDashed:
|
|
18791
|
+
color: z141.string().optional(),
|
|
18792
|
+
isDashed: z141.boolean().optional()
|
|
18573
18793
|
});
|
|
18574
18794
|
expectTypesMatch(true);
|
|
18575
18795
|
|
|
18576
18796
|
// lib/components/pcb-note-dimension.ts
|
|
18577
18797
|
import { distance as distance47, length as length13 } from "circuit-json";
|
|
18578
|
-
import { z as
|
|
18579
|
-
var dimensionTarget2 =
|
|
18798
|
+
import { z as z142 } from "zod";
|
|
18799
|
+
var dimensionTarget2 = z142.union([z142.string(), point]);
|
|
18580
18800
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18581
18801
|
pcbLeftEdgeX: true,
|
|
18582
18802
|
pcbRightEdgeX: true,
|
|
@@ -18590,101 +18810,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18590
18810
|
}).extend({
|
|
18591
18811
|
from: dimensionTarget2,
|
|
18592
18812
|
to: dimensionTarget2,
|
|
18593
|
-
text:
|
|
18813
|
+
text: z142.string().optional(),
|
|
18594
18814
|
offset: distance47.optional(),
|
|
18595
|
-
font:
|
|
18815
|
+
font: z142.enum(["tscircuit2024"]).optional(),
|
|
18596
18816
|
fontSize: length13.optional(),
|
|
18597
|
-
color:
|
|
18817
|
+
color: z142.string().optional(),
|
|
18598
18818
|
arrowSize: distance47.optional(),
|
|
18599
|
-
units:
|
|
18600
|
-
outerEdgeToEdge:
|
|
18601
|
-
centerToCenter:
|
|
18602
|
-
innerEdgeToEdge:
|
|
18819
|
+
units: z142.enum(["in", "mm"]).optional(),
|
|
18820
|
+
outerEdgeToEdge: z142.literal(true).optional(),
|
|
18821
|
+
centerToCenter: z142.literal(true).optional(),
|
|
18822
|
+
innerEdgeToEdge: z142.literal(true).optional()
|
|
18603
18823
|
});
|
|
18604
18824
|
expectTypesMatch(
|
|
18605
18825
|
true
|
|
18606
18826
|
);
|
|
18607
18827
|
|
|
18608
18828
|
// lib/platformConfig.ts
|
|
18609
|
-
import { z as
|
|
18610
|
-
var unvalidatedCircuitJson =
|
|
18611
|
-
var footprintLibraryResult =
|
|
18612
|
-
footprintCircuitJson:
|
|
18829
|
+
import { z as z143 } from "zod";
|
|
18830
|
+
var unvalidatedCircuitJson = z143.array(z143.any()).describe("Circuit JSON");
|
|
18831
|
+
var footprintLibraryResult = z143.object({
|
|
18832
|
+
footprintCircuitJson: z143.array(z143.any()),
|
|
18613
18833
|
cadModel: cadModelProp.optional()
|
|
18614
18834
|
});
|
|
18615
|
-
var pathToCircuitJsonFn =
|
|
18616
|
-
|
|
18617
|
-
|
|
18618
|
-
|
|
18619
|
-
).returns(
|
|
18835
|
+
var pathToCircuitJsonFn = z143.function().args(z143.string()).returns(z143.promise(footprintLibraryResult)).or(
|
|
18836
|
+
z143.function().args(
|
|
18837
|
+
z143.string(),
|
|
18838
|
+
z143.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18839
|
+
).returns(z143.promise(footprintLibraryResult))
|
|
18620
18840
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18621
|
-
var footprintFileParserEntry =
|
|
18622
|
-
loadFromUrl:
|
|
18841
|
+
var footprintFileParserEntry = z143.object({
|
|
18842
|
+
loadFromUrl: z143.function().args(z143.string()).returns(z143.promise(footprintLibraryResult)).describe(
|
|
18623
18843
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18624
18844
|
)
|
|
18625
18845
|
});
|
|
18626
|
-
var spiceEngineSimulationResult =
|
|
18627
|
-
engineVersionString:
|
|
18846
|
+
var spiceEngineSimulationResult = z143.object({
|
|
18847
|
+
engineVersionString: z143.string().optional(),
|
|
18628
18848
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18629
18849
|
});
|
|
18630
|
-
var spiceEngineZod =
|
|
18631
|
-
simulate:
|
|
18850
|
+
var spiceEngineZod = z143.object({
|
|
18851
|
+
simulate: z143.function().args(z143.string()).returns(z143.promise(spiceEngineSimulationResult)).describe(
|
|
18632
18852
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18633
18853
|
)
|
|
18634
18854
|
});
|
|
18635
|
-
var defaultSpiceEngine =
|
|
18855
|
+
var defaultSpiceEngine = z143.custom(
|
|
18636
18856
|
(value) => typeof value === "string"
|
|
18637
18857
|
);
|
|
18638
|
-
var autorouterInstance =
|
|
18639
|
-
run:
|
|
18640
|
-
getOutputSimpleRouteJson:
|
|
18858
|
+
var autorouterInstance = z143.object({
|
|
18859
|
+
run: z143.function().args().returns(z143.promise(z143.unknown())).describe("Run the autorouter"),
|
|
18860
|
+
getOutputSimpleRouteJson: z143.function().args().returns(z143.promise(z143.any())).describe("Get the resulting SimpleRouteJson")
|
|
18641
18861
|
});
|
|
18642
|
-
var autorouterDefinition =
|
|
18643
|
-
createAutorouter:
|
|
18862
|
+
var autorouterDefinition = z143.object({
|
|
18863
|
+
createAutorouter: z143.function().args(z143.any(), z143.any().optional()).returns(z143.union([autorouterInstance, z143.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18644
18864
|
});
|
|
18645
|
-
var platformFetch =
|
|
18646
|
-
var platformConfig =
|
|
18865
|
+
var platformFetch = z143.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18866
|
+
var platformConfig = z143.object({
|
|
18647
18867
|
partsEngine: partsEngine.optional(),
|
|
18648
18868
|
autorouter: autorouterProp.optional(),
|
|
18649
|
-
autorouterMap:
|
|
18869
|
+
autorouterMap: z143.record(z143.string(), autorouterDefinition).optional(),
|
|
18650
18870
|
registryApiUrl: url.optional(),
|
|
18651
18871
|
cloudAutorouterUrl: url.optional(),
|
|
18652
|
-
projectName:
|
|
18872
|
+
projectName: z143.string().optional(),
|
|
18653
18873
|
projectBaseUrl: url.optional(),
|
|
18654
|
-
version:
|
|
18874
|
+
version: z143.string().optional(),
|
|
18655
18875
|
url: url.optional(),
|
|
18656
|
-
printBoardInformationToSilkscreen:
|
|
18657
|
-
includeBoardFiles:
|
|
18876
|
+
printBoardInformationToSilkscreen: z143.boolean().optional(),
|
|
18877
|
+
includeBoardFiles: z143.array(z143.string()).describe(
|
|
18658
18878
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18659
18879
|
).optional(),
|
|
18660
|
-
snapshotsDir:
|
|
18880
|
+
snapshotsDir: z143.string().describe(
|
|
18661
18881
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18662
18882
|
).optional(),
|
|
18663
18883
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18664
|
-
unitPreference:
|
|
18665
|
-
localCacheEngine:
|
|
18666
|
-
pcbDisabled:
|
|
18667
|
-
routingDisabled:
|
|
18668
|
-
schematicDisabled:
|
|
18669
|
-
partsEngineDisabled:
|
|
18670
|
-
drcChecksDisabled:
|
|
18671
|
-
netlistDrcChecksDisabled:
|
|
18672
|
-
routingDrcChecksDisabled:
|
|
18673
|
-
placementDrcChecksDisabled:
|
|
18674
|
-
pinSpecificationDrcChecksDisabled:
|
|
18675
|
-
spiceEngineMap:
|
|
18676
|
-
footprintLibraryMap:
|
|
18677
|
-
|
|
18678
|
-
|
|
18884
|
+
unitPreference: z143.enum(["mm", "in", "mil"]).optional(),
|
|
18885
|
+
localCacheEngine: z143.any().optional(),
|
|
18886
|
+
pcbDisabled: z143.boolean().optional(),
|
|
18887
|
+
routingDisabled: z143.boolean().optional(),
|
|
18888
|
+
schematicDisabled: z143.boolean().optional(),
|
|
18889
|
+
partsEngineDisabled: z143.boolean().optional(),
|
|
18890
|
+
drcChecksDisabled: z143.boolean().optional(),
|
|
18891
|
+
netlistDrcChecksDisabled: z143.boolean().optional(),
|
|
18892
|
+
routingDrcChecksDisabled: z143.boolean().optional(),
|
|
18893
|
+
placementDrcChecksDisabled: z143.boolean().optional(),
|
|
18894
|
+
pinSpecificationDrcChecksDisabled: z143.boolean().optional(),
|
|
18895
|
+
spiceEngineMap: z143.record(z143.string(), spiceEngineZod).optional(),
|
|
18896
|
+
footprintLibraryMap: z143.record(
|
|
18897
|
+
z143.string(),
|
|
18898
|
+
z143.union([
|
|
18679
18899
|
pathToCircuitJsonFn,
|
|
18680
|
-
|
|
18681
|
-
|
|
18682
|
-
|
|
18900
|
+
z143.record(
|
|
18901
|
+
z143.string(),
|
|
18902
|
+
z143.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18683
18903
|
)
|
|
18684
18904
|
])
|
|
18685
18905
|
).optional(),
|
|
18686
|
-
footprintFileParserMap:
|
|
18687
|
-
resolveProjectStaticFileImportUrl:
|
|
18906
|
+
footprintFileParserMap: z143.record(z143.string(), footprintFileParserEntry).optional(),
|
|
18907
|
+
resolveProjectStaticFileImportUrl: z143.function().args(z143.string()).returns(z143.promise(z143.string())).describe(
|
|
18688
18908
|
"A function that returns a string URL for static files for the project"
|
|
18689
18909
|
).optional(),
|
|
18690
18910
|
platformFetch: platformFetch.optional()
|
|
@@ -18711,7 +18931,18 @@ export {
|
|
|
18711
18931
|
ammeterPinLabels,
|
|
18712
18932
|
ammeterPins,
|
|
18713
18933
|
ammeterProps,
|
|
18934
|
+
analogAcSweepSimulationProps,
|
|
18935
|
+
analogAnalysisSimulationBaseProps,
|
|
18936
|
+
analogCapacitanceSweepParameterProps,
|
|
18937
|
+
analogCurrentSweepParameterProps,
|
|
18938
|
+
analogDcOperatingPointSimulationProps,
|
|
18939
|
+
analogDcSweepSimulationProps,
|
|
18940
|
+
analogInductanceSweepParameterProps,
|
|
18941
|
+
analogResistanceSweepParameterProps,
|
|
18714
18942
|
analogSimulationProps,
|
|
18943
|
+
analogSweepParameterProps,
|
|
18944
|
+
analogTransientSimulationProps,
|
|
18945
|
+
analogVoltageSweepParameterProps,
|
|
18715
18946
|
assemblyDeviceProps,
|
|
18716
18947
|
assemblyProps,
|
|
18717
18948
|
autorouterConfig,
|