@tscircuit/props 0.0.708 → 0.0.709
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/dist/index.d.ts +643 -3
- package/dist/index.js +101 -35
- package/dist/index.js.map +1 -1
- package/lib/components/analogtransientsimulation.ts +120 -1
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18862,7 +18862,7 @@ expectTypesMatch(
|
|
|
18862
18862
|
);
|
|
18863
18863
|
|
|
18864
18864
|
// lib/components/analogtransientsimulation.ts
|
|
18865
|
-
import { ms as ms2 } from "circuit-json";
|
|
18865
|
+
import { frequency as frequency3, length as length4, ms as ms2 } from "circuit-json";
|
|
18866
18866
|
import { z as z109 } from "zod";
|
|
18867
18867
|
|
|
18868
18868
|
// lib/common/ibis.ts
|
|
@@ -18899,6 +18899,63 @@ var ibisModelDefinition = z108.object({
|
|
|
18899
18899
|
});
|
|
18900
18900
|
|
|
18901
18901
|
// lib/components/analogtransientsimulation.ts
|
|
18902
|
+
var positiveLength = length4.pipe(z109.number().finite().positive());
|
|
18903
|
+
var signedLength = length4.pipe(z109.number().finite());
|
|
18904
|
+
var positiveFrequency = frequency3.pipe(z109.number().finite().positive());
|
|
18905
|
+
var pcbSpiceChannelProps = z109.object({
|
|
18906
|
+
reduction: z109.enum(["routed-copper", "straightened-stages"]),
|
|
18907
|
+
sections: z109.number().int().min(1).max(128),
|
|
18908
|
+
lanes: z109.array(
|
|
18909
|
+
z109.object({
|
|
18910
|
+
name: z109.string().min(1),
|
|
18911
|
+
from: z109.string().min(1),
|
|
18912
|
+
to: z109.string().min(1)
|
|
18913
|
+
})
|
|
18914
|
+
).min(1).max(3),
|
|
18915
|
+
referencePinRef: z109.string().min(1),
|
|
18916
|
+
passiveComponentRefs: z109.array(z109.string().min(1)).optional(),
|
|
18917
|
+
extraction: z109.object({
|
|
18918
|
+
minimumFrequency: positiveFrequency,
|
|
18919
|
+
maximumFrequency: positiveFrequency,
|
|
18920
|
+
modelFrequency: positiveFrequency,
|
|
18921
|
+
filaments: z109.number().int().positive(),
|
|
18922
|
+
refinementFilaments: z109.number().int().positive(),
|
|
18923
|
+
convergenceTolerance: z109.number().finite().positive(),
|
|
18924
|
+
capacitanceTolerance: z109.number().finite().positive(),
|
|
18925
|
+
reciprocityTolerance: z109.number().finite().positive(),
|
|
18926
|
+
dcResistanceTolerance: z109.number().finite().positive(),
|
|
18927
|
+
maxPanelLength: positiveLength,
|
|
18928
|
+
groundMeshSize: positiveLength.optional()
|
|
18929
|
+
}).refine(
|
|
18930
|
+
(extraction) => extraction.refinementFilaments > extraction.filaments,
|
|
18931
|
+
{
|
|
18932
|
+
path: ["refinementFilaments"],
|
|
18933
|
+
message: "refinementFilaments must be greater than filaments"
|
|
18934
|
+
}
|
|
18935
|
+
),
|
|
18936
|
+
relativePermittivity: z109.number().finite().positive().optional(),
|
|
18937
|
+
via: z109.object({
|
|
18938
|
+
platingThickness: positiveLength.optional(),
|
|
18939
|
+
equivalentWidth: positiveLength.optional(),
|
|
18940
|
+
omitThroughViaStubs: z109.boolean().optional()
|
|
18941
|
+
}).optional(),
|
|
18942
|
+
straightenedStageProfiles: z109.record(
|
|
18943
|
+
z109.object({
|
|
18944
|
+
spacing: positiveLength,
|
|
18945
|
+
relativePermittivity: z109.number().finite().positive(),
|
|
18946
|
+
return: z109.object({
|
|
18947
|
+
width: positiveLength,
|
|
18948
|
+
thickness: positiveLength,
|
|
18949
|
+
lengthFactor: z109.number().finite().positive(),
|
|
18950
|
+
centerY: signedLength,
|
|
18951
|
+
centerZ: signedLength
|
|
18952
|
+
})
|
|
18953
|
+
})
|
|
18954
|
+
).optional()
|
|
18955
|
+
});
|
|
18956
|
+
expectTypesMatch(
|
|
18957
|
+
true
|
|
18958
|
+
);
|
|
18902
18959
|
var positiveMilliseconds = ms2.refine(
|
|
18903
18960
|
(milliseconds) => milliseconds > 0,
|
|
18904
18961
|
"Time must be positive"
|
|
@@ -18908,8 +18965,16 @@ var analogTransientSimulationProps = z109.object({
|
|
|
18908
18965
|
duration: positiveMilliseconds.default("10ms"),
|
|
18909
18966
|
startTime: ms2.default("0ms"),
|
|
18910
18967
|
timePerStep: positiveMilliseconds.default("0.01ms"),
|
|
18968
|
+
pcbSpiceChannel: pcbSpiceChannelProps.optional(),
|
|
18911
18969
|
ibisPinStates: z109.record(z109.string().min(1), ibisPinRunState).optional()
|
|
18912
18970
|
}).superRefine((simulation, context) => {
|
|
18971
|
+
if (simulation.pcbSpiceChannel && simulation.spiceEngine !== "pcb_spice") {
|
|
18972
|
+
context.addIssue({
|
|
18973
|
+
code: z109.ZodIssueCode.custom,
|
|
18974
|
+
path: ["pcbSpiceChannel"],
|
|
18975
|
+
message: "PCB SPICE channel settings require spiceEngine=pcb_spice"
|
|
18976
|
+
});
|
|
18977
|
+
}
|
|
18913
18978
|
if (simulation.ibisPinStates && simulation.spiceEngine !== "pcb_spice") {
|
|
18914
18979
|
context.addIssue({
|
|
18915
18980
|
code: z109.ZodIssueCode.custom,
|
|
@@ -19016,16 +19081,16 @@ var analogDcSweepSimulationProps = z114.object({
|
|
|
19016
19081
|
expectTypesMatch(true);
|
|
19017
19082
|
|
|
19018
19083
|
// lib/components/analogacsweepsimulation.ts
|
|
19019
|
-
import { frequency as
|
|
19084
|
+
import { frequency as frequency4 } from "circuit-json";
|
|
19020
19085
|
import { z as z115 } from "zod";
|
|
19021
19086
|
var analogAcSweepSimulationProps = z115.object({
|
|
19022
19087
|
...analogAnalysisSimulationBaseProps,
|
|
19023
19088
|
sweepType: z115.enum(["linear", "decade", "octave"]),
|
|
19024
|
-
startFrequency:
|
|
19089
|
+
startFrequency: frequency4.refine(
|
|
19025
19090
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
19026
19091
|
"startFrequency must be positive"
|
|
19027
19092
|
),
|
|
19028
|
-
stopFrequency:
|
|
19093
|
+
stopFrequency: frequency4.refine(
|
|
19029
19094
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
19030
19095
|
"stopFrequency must be positive"
|
|
19031
19096
|
),
|
|
@@ -19497,7 +19562,7 @@ var ledProps = commonComponentProps.extend({
|
|
|
19497
19562
|
var ledPins = lrPolarPins;
|
|
19498
19563
|
|
|
19499
19564
|
// lib/components/switch.ts
|
|
19500
|
-
import { ms as ms5, frequency as
|
|
19565
|
+
import { ms as ms5, frequency as frequency5 } from "circuit-json";
|
|
19501
19566
|
import { z as z128 } from "zod";
|
|
19502
19567
|
var switchProps = commonComponentProps.extend({
|
|
19503
19568
|
type: z128.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
@@ -19508,7 +19573,7 @@ var switchProps = commonComponentProps.extend({
|
|
|
19508
19573
|
dpdt: z128.boolean().optional(),
|
|
19509
19574
|
pinLabels: pinLabelsProp.optional(),
|
|
19510
19575
|
noConnect: noConnectProp.optional(),
|
|
19511
|
-
simSwitchFrequency:
|
|
19576
|
+
simSwitchFrequency: frequency5.optional(),
|
|
19512
19577
|
simCloseAt: ms5.optional(),
|
|
19513
19578
|
simOpenAt: ms5.optional(),
|
|
19514
19579
|
simStartClosed: z128.boolean().optional(),
|
|
@@ -19544,13 +19609,13 @@ var switchProps = commonComponentProps.extend({
|
|
|
19544
19609
|
expectTypesMatch(true);
|
|
19545
19610
|
|
|
19546
19611
|
// lib/components/fabrication-note-text.ts
|
|
19547
|
-
import { length as
|
|
19612
|
+
import { length as length5 } from "circuit-json";
|
|
19548
19613
|
import { z as z129 } from "zod";
|
|
19549
19614
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
19550
19615
|
text: z129.string(),
|
|
19551
19616
|
anchorAlignment: z129.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19552
19617
|
font: z129.enum(["tscircuit2024"]).optional(),
|
|
19553
|
-
fontSize:
|
|
19618
|
+
fontSize: length5.optional(),
|
|
19554
19619
|
color: z129.string().optional()
|
|
19555
19620
|
});
|
|
19556
19621
|
expectTypesMatch(true);
|
|
@@ -19570,7 +19635,7 @@ var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend
|
|
|
19570
19635
|
});
|
|
19571
19636
|
|
|
19572
19637
|
// lib/components/fabrication-note-path.ts
|
|
19573
|
-
import { length as
|
|
19638
|
+
import { length as length6, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
19574
19639
|
import { z as z131 } from "zod";
|
|
19575
19640
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
19576
19641
|
pcbLeftEdgeX: true,
|
|
@@ -19584,7 +19649,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
19584
19649
|
pcbRotation: true
|
|
19585
19650
|
}).extend({
|
|
19586
19651
|
route: z131.array(route_hint_point3),
|
|
19587
|
-
strokeWidth:
|
|
19652
|
+
strokeWidth: length6.optional(),
|
|
19588
19653
|
color: z131.string().optional(),
|
|
19589
19654
|
/** Fill the route, closing its boundary implicitly. Omitted means false. */
|
|
19590
19655
|
isFilled: z131.boolean().optional(),
|
|
@@ -19593,7 +19658,7 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
19593
19658
|
});
|
|
19594
19659
|
|
|
19595
19660
|
// lib/components/fabrication-note-dimension.ts
|
|
19596
|
-
import { distance as distance28, length as
|
|
19661
|
+
import { distance as distance28, length as length7 } from "circuit-json";
|
|
19597
19662
|
import { z as z132 } from "zod";
|
|
19598
19663
|
var dimensionTarget = z132.union([z132.string(), point]);
|
|
19599
19664
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
@@ -19613,7 +19678,7 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19613
19678
|
offset: distance28.optional(),
|
|
19614
19679
|
offsetDirection: z132.object({ x: z132.number().finite(), y: z132.number().finite() }).optional(),
|
|
19615
19680
|
font: z132.enum(["tscircuit2024"]).optional(),
|
|
19616
|
-
fontSize:
|
|
19681
|
+
fontSize: length7.optional(),
|
|
19617
19682
|
color: z132.string().optional(),
|
|
19618
19683
|
arrowSize: distance28.optional(),
|
|
19619
19684
|
units: z132.enum(["in", "mm"]).optional(),
|
|
@@ -19740,7 +19805,7 @@ var courtyardRectProps = pcbLayoutProps.extend({
|
|
|
19740
19805
|
});
|
|
19741
19806
|
|
|
19742
19807
|
// lib/components/courtyard-outline.ts
|
|
19743
|
-
import { length as
|
|
19808
|
+
import { length as length8 } from "circuit-json";
|
|
19744
19809
|
import { z as z139 } from "zod";
|
|
19745
19810
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
19746
19811
|
pcbLeftEdgeX: true,
|
|
@@ -19754,7 +19819,7 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
19754
19819
|
pcbRotation: true
|
|
19755
19820
|
}).extend({
|
|
19756
19821
|
outline: z139.array(point),
|
|
19757
|
-
strokeWidth:
|
|
19822
|
+
strokeWidth: length8.optional(),
|
|
19758
19823
|
isClosed: z139.boolean().optional(),
|
|
19759
19824
|
isStrokeDashed: z139.boolean().optional(),
|
|
19760
19825
|
color: z139.string().optional()
|
|
@@ -19860,7 +19925,7 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
19860
19925
|
});
|
|
19861
19926
|
|
|
19862
19927
|
// lib/components/voltagesource.ts
|
|
19863
|
-
import { frequency as
|
|
19928
|
+
import { frequency as frequency6, ms as ms6, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
19864
19929
|
import { z as z145 } from "zod";
|
|
19865
19930
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19866
19931
|
var percentage = z145.union([z145.string(), z145.number()]).transform((val) => {
|
|
@@ -19876,7 +19941,7 @@ var percentage = z145.union([z145.string(), z145.number()]).transform((val) => {
|
|
|
19876
19941
|
);
|
|
19877
19942
|
var voltageSourceProps = commonComponentProps.extend({
|
|
19878
19943
|
voltage: voltage6.optional(),
|
|
19879
|
-
frequency:
|
|
19944
|
+
frequency: frequency6.optional(),
|
|
19880
19945
|
peakToPeakVoltage: voltage6.optional(),
|
|
19881
19946
|
waveShape: z145.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19882
19947
|
phase: rotation6.optional(),
|
|
@@ -19894,7 +19959,7 @@ var voltageSourcePins = lrPolarPins;
|
|
|
19894
19959
|
expectTypesMatch(true);
|
|
19895
19960
|
|
|
19896
19961
|
// lib/components/currentsource.ts
|
|
19897
|
-
import { frequency as
|
|
19962
|
+
import { frequency as frequency7, rotation as rotation7, current as current3 } from "circuit-json";
|
|
19898
19963
|
import { z as z146 } from "zod";
|
|
19899
19964
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19900
19965
|
var percentage2 = z146.union([z146.string(), z146.number()]).transform((val) => {
|
|
@@ -19910,7 +19975,7 @@ var percentage2 = z146.union([z146.string(), z146.number()]).transform((val) =>
|
|
|
19910
19975
|
);
|
|
19911
19976
|
var currentSourceProps = commonComponentProps.extend({
|
|
19912
19977
|
current: current3.optional(),
|
|
19913
|
-
frequency:
|
|
19978
|
+
frequency: frequency7.optional(),
|
|
19914
19979
|
peakToPeakCurrent: current3.optional(),
|
|
19915
19980
|
waveShape: z146.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19916
19981
|
phase: rotation7.optional(),
|
|
@@ -20222,40 +20287,40 @@ expectTypesMatch(
|
|
|
20222
20287
|
);
|
|
20223
20288
|
|
|
20224
20289
|
// lib/components/copper-text.ts
|
|
20225
|
-
import { layer_ref as layer_ref14, length as
|
|
20290
|
+
import { layer_ref as layer_ref14, length as length9 } from "circuit-json";
|
|
20226
20291
|
import { z as z165 } from "zod";
|
|
20227
20292
|
var copperTextProps = pcbLayoutProps.extend({
|
|
20228
20293
|
text: z165.string(),
|
|
20229
20294
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
20230
20295
|
font: z165.enum(["tscircuit2024"]).optional(),
|
|
20231
|
-
fontSize:
|
|
20296
|
+
fontSize: length9.optional(),
|
|
20232
20297
|
layers: z165.array(layer_ref14).optional(),
|
|
20233
20298
|
knockout: z165.boolean().optional(),
|
|
20234
20299
|
mirrored: z165.boolean().optional()
|
|
20235
20300
|
});
|
|
20236
20301
|
|
|
20237
20302
|
// lib/components/silkscreen-text.ts
|
|
20238
|
-
import { layer_ref as layer_ref15, length as
|
|
20303
|
+
import { layer_ref as layer_ref15, length as length10 } from "circuit-json";
|
|
20239
20304
|
import { z as z166 } from "zod";
|
|
20240
20305
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
20241
20306
|
text: z166.string(),
|
|
20242
20307
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
20243
20308
|
font: z166.enum(["tscircuit2024"]).optional(),
|
|
20244
|
-
fontSize:
|
|
20309
|
+
fontSize: length10.optional(),
|
|
20245
20310
|
/**
|
|
20246
20311
|
* If true, text will knock out underlying silkscreen
|
|
20247
20312
|
*/
|
|
20248
20313
|
isKnockout: z166.boolean().optional(),
|
|
20249
|
-
knockoutPadding:
|
|
20250
|
-
knockoutPaddingLeft:
|
|
20251
|
-
knockoutPaddingRight:
|
|
20252
|
-
knockoutPaddingTop:
|
|
20253
|
-
knockoutPaddingBottom:
|
|
20314
|
+
knockoutPadding: length10.optional(),
|
|
20315
|
+
knockoutPaddingLeft: length10.optional(),
|
|
20316
|
+
knockoutPaddingRight: length10.optional(),
|
|
20317
|
+
knockoutPaddingTop: length10.optional(),
|
|
20318
|
+
knockoutPaddingBottom: length10.optional(),
|
|
20254
20319
|
layers: z166.array(layer_ref15).optional()
|
|
20255
20320
|
});
|
|
20256
20321
|
|
|
20257
20322
|
// lib/components/silkscreen-path.ts
|
|
20258
|
-
import { length as
|
|
20323
|
+
import { length as length11, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
20259
20324
|
import { z as z167 } from "zod";
|
|
20260
20325
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
20261
20326
|
pcbLeftEdgeX: true,
|
|
@@ -20269,7 +20334,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
20269
20334
|
pcbRotation: true
|
|
20270
20335
|
}).extend({
|
|
20271
20336
|
route: z167.array(route_hint_point5),
|
|
20272
|
-
strokeWidth:
|
|
20337
|
+
strokeWidth: length11.optional()
|
|
20273
20338
|
});
|
|
20274
20339
|
|
|
20275
20340
|
// lib/components/silkscreen-line.ts
|
|
@@ -20364,13 +20429,13 @@ var portProps = commonLayoutProps.extend({
|
|
|
20364
20429
|
});
|
|
20365
20430
|
|
|
20366
20431
|
// lib/components/pcb-note-text.ts
|
|
20367
|
-
import { length as
|
|
20432
|
+
import { length as length12 } from "circuit-json";
|
|
20368
20433
|
import { z as z173 } from "zod";
|
|
20369
20434
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
20370
20435
|
text: z173.string(),
|
|
20371
20436
|
anchorAlignment: z173.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
20372
20437
|
font: z173.enum(["tscircuit2024"]).optional(),
|
|
20373
|
-
fontSize:
|
|
20438
|
+
fontSize: length12.optional(),
|
|
20374
20439
|
color: z173.string().optional()
|
|
20375
20440
|
});
|
|
20376
20441
|
expectTypesMatch(true);
|
|
@@ -20392,7 +20457,7 @@ expectTypesMatch(true);
|
|
|
20392
20457
|
|
|
20393
20458
|
// lib/components/pcb-note-path.ts
|
|
20394
20459
|
import {
|
|
20395
|
-
length as
|
|
20460
|
+
length as length13,
|
|
20396
20461
|
route_hint_point as route_hint_point7
|
|
20397
20462
|
} from "circuit-json";
|
|
20398
20463
|
import { z as z175 } from "zod";
|
|
@@ -20408,7 +20473,7 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
20408
20473
|
pcbRotation: true
|
|
20409
20474
|
}).extend({
|
|
20410
20475
|
route: z175.array(route_hint_point7),
|
|
20411
|
-
strokeWidth:
|
|
20476
|
+
strokeWidth: length13.optional(),
|
|
20412
20477
|
color: z175.string().optional()
|
|
20413
20478
|
});
|
|
20414
20479
|
expectTypesMatch(true);
|
|
@@ -20438,7 +20503,7 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
20438
20503
|
expectTypesMatch(true);
|
|
20439
20504
|
|
|
20440
20505
|
// lib/components/pcb-note-dimension.ts
|
|
20441
|
-
import { distance as distance55, length as
|
|
20506
|
+
import { distance as distance55, length as length14 } from "circuit-json";
|
|
20442
20507
|
import { z as z177 } from "zod";
|
|
20443
20508
|
var dimensionTarget2 = z177.union([z177.string(), point]);
|
|
20444
20509
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
@@ -20458,7 +20523,7 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
20458
20523
|
offset: distance55.optional(),
|
|
20459
20524
|
offsetDirection: z177.object({ x: z177.number().finite(), y: z177.number().finite() }).optional(),
|
|
20460
20525
|
font: z177.enum(["tscircuit2024"]).optional(),
|
|
20461
|
-
fontSize:
|
|
20526
|
+
fontSize: length14.optional(),
|
|
20462
20527
|
color: z177.string().optional(),
|
|
20463
20528
|
arrowSize: distance55.optional(),
|
|
20464
20529
|
units: z177.enum(["in", "mm"]).optional(),
|
|
@@ -20806,6 +20871,7 @@ export {
|
|
|
20806
20871
|
pcbSameXConstraintProps,
|
|
20807
20872
|
pcbSameYConstraintProps,
|
|
20808
20873
|
pcbSoldermaskOpeningProps,
|
|
20874
|
+
pcbSpiceChannelProps,
|
|
20809
20875
|
pcbStiffenerProps,
|
|
20810
20876
|
pcbStyle,
|
|
20811
20877
|
pcbSx,
|