@tscircuit/props 0.0.683 → 0.0.684
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 +41 -4
- package/dist/index.d.ts +623 -17
- package/dist/index.js +854 -640
- package/dist/index.js.map +1 -1
- package/lib/common/impedanceTarget.ts +125 -0
- package/lib/common/routeLength.ts +102 -0
- package/lib/common/traceSpacing.ts +18 -0
- package/lib/components/bus.ts +85 -19
- package/lib/components/differentialpair.ts +79 -14
- package/lib/index.ts +11 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -17954,46 +17954,257 @@ var traceProps = z80.union([
|
|
|
17954
17954
|
})
|
|
17955
17955
|
]);
|
|
17956
17956
|
|
|
17957
|
-
// lib/
|
|
17958
|
-
import {
|
|
17959
|
-
distance as distance20,
|
|
17960
|
-
layer_ref as layer_ref7,
|
|
17961
|
-
resistance as resistance3
|
|
17962
|
-
} from "circuit-json";
|
|
17957
|
+
// lib/common/routeLength.ts
|
|
17958
|
+
import { distance as distance20 } from "circuit-json";
|
|
17963
17959
|
import { z as z81 } from "zod";
|
|
17964
|
-
var
|
|
17965
|
-
|
|
17966
|
-
|
|
17967
|
-
|
|
17968
|
-
|
|
17969
|
-
|
|
17970
|
-
|
|
17971
|
-
|
|
17960
|
+
var nonnegativeRouteDistance = distance20.pipe(
|
|
17961
|
+
z81.number().nonnegative().finite()
|
|
17962
|
+
);
|
|
17963
|
+
var routeLength = z81.union([
|
|
17964
|
+
nonnegativeRouteDistance,
|
|
17965
|
+
z81.object({
|
|
17966
|
+
reference: z81.literal("longest_manhattan"),
|
|
17967
|
+
of: z81.array(z81.string().min(1)).min(1).optional(),
|
|
17968
|
+
offset: distance20.pipe(z81.number().finite()).optional()
|
|
17969
|
+
}).strict()
|
|
17970
|
+
]);
|
|
17971
|
+
expectTypesMatch(true);
|
|
17972
|
+
function validateRouteLengths(props, ctx) {
|
|
17973
|
+
if (Boolean(props.targetLength !== void 0) !== Boolean(props.lengthTolerance !== void 0))
|
|
17974
|
+
ctx.addIssue({
|
|
17975
|
+
code: z81.ZodIssueCode.custom,
|
|
17976
|
+
path: ["lengthTolerance"],
|
|
17977
|
+
message: "targetLength and lengthTolerance must be supplied together"
|
|
17978
|
+
});
|
|
17979
|
+
if (props.lengthMatchTo !== void 0 && props.maxLengthSkew === void 0)
|
|
17980
|
+
ctx.addIssue({
|
|
17981
|
+
code: z81.ZodIssueCode.custom,
|
|
17982
|
+
path: ["maxLengthSkew"],
|
|
17983
|
+
message: "lengthMatchTo requires an explicit maxLengthSkew"
|
|
17984
|
+
});
|
|
17985
|
+
const comparable = (value) => typeof value === "number" ? { basis: "absolute", amount: value } : {
|
|
17986
|
+
basis: JSON.stringify([
|
|
17987
|
+
value.reference,
|
|
17988
|
+
value.of ? [...value.of].sort() : null
|
|
17989
|
+
]),
|
|
17990
|
+
amount: value.offset ?? 0
|
|
17991
|
+
};
|
|
17992
|
+
const min = props.minLength === void 0 ? void 0 : comparable(props.minLength);
|
|
17993
|
+
const max = props.maxLength === void 0 ? void 0 : comparable(props.maxLength);
|
|
17994
|
+
const target = props.targetLength === void 0 ? void 0 : comparable(props.targetLength);
|
|
17995
|
+
if (min && max && min.basis === max.basis && min.amount > max.amount)
|
|
17996
|
+
ctx.addIssue({
|
|
17997
|
+
code: z81.ZodIssueCode.custom,
|
|
17998
|
+
path: ["maxLength"],
|
|
17999
|
+
message: "maxLength cannot be below minLength for the same reference"
|
|
18000
|
+
});
|
|
18001
|
+
if (target && min && target.basis === min.basis && target.amount + (props.lengthTolerance ?? 0) < min.amount || target && max && target.basis === max.basis && target.amount - (props.lengthTolerance ?? 0) > max.amount)
|
|
18002
|
+
ctx.addIssue({
|
|
18003
|
+
code: z81.ZodIssueCode.custom,
|
|
18004
|
+
path: ["targetLength"],
|
|
18005
|
+
message: "targetLength tolerance window does not intersect the declared length bounds"
|
|
18006
|
+
});
|
|
18007
|
+
}
|
|
18008
|
+
var lengthMatchTo = z81.union([
|
|
18009
|
+
z81.string().min(1),
|
|
18010
|
+
z81.array(z81.string().min(1)).min(1)
|
|
18011
|
+
]);
|
|
18012
|
+
|
|
18013
|
+
// lib/common/traceSpacing.ts
|
|
18014
|
+
import { distance as distance21 } from "circuit-json";
|
|
18015
|
+
import { z as z82 } from "zod";
|
|
18016
|
+
var widthSpacing = z82.string().regex(/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*w\s*$/i).transform((value) => ({
|
|
18017
|
+
widthMultiplier: Number(value.trim().replace(/w$/i, ""))
|
|
18018
|
+
})).pipe(z82.object({ widthMultiplier: z82.number().positive().finite() }));
|
|
18019
|
+
var absoluteSpacing = distance21.pipe(z82.number().positive().finite());
|
|
18020
|
+
var traceSpacing = z82.union([widthSpacing, absoluteSpacing]);
|
|
18021
|
+
expectTypesMatch(true);
|
|
18022
|
+
|
|
18023
|
+
// lib/common/impedanceTarget.ts
|
|
18024
|
+
import { resistance as resistance3 } from "circuit-json";
|
|
18025
|
+
import { z as z83 } from "zod";
|
|
18026
|
+
var positiveImpedance = z83.union([
|
|
18027
|
+
z83.number(),
|
|
18028
|
+
z83.string().refine(
|
|
18029
|
+
(value) => !/(?:±|\+\/-)/.test(value),
|
|
18030
|
+
"Use a scalar impedance for explicit bounds"
|
|
18031
|
+
)
|
|
18032
|
+
]).pipe(resistance3).pipe(z83.number().positive().finite());
|
|
18033
|
+
var quantity = /^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(.*?)$/i;
|
|
18034
|
+
var tolerantImpedance = z83.string().regex(/(?:±|\+\/-)/).transform((value, ctx) => {
|
|
18035
|
+
const parts = value.trim().split(/\s*(?:±|\+\/-)\s*/);
|
|
18036
|
+
const nominal = parts.length === 2 ? parts[0].match(quantity) : null;
|
|
18037
|
+
const tolerance = parts.length === 2 ? parts[1].match(quantity) : null;
|
|
18038
|
+
if (!nominal || !tolerance) {
|
|
18039
|
+
ctx.addIssue({
|
|
18040
|
+
code: z83.ZodIssueCode.custom,
|
|
18041
|
+
message: "Use a nominal impedance \xB1 an absolute ohm tolerance"
|
|
18042
|
+
});
|
|
18043
|
+
return z83.NEVER;
|
|
18044
|
+
}
|
|
18045
|
+
const ohmUnit = /^(?:[yzafpnumkKMGTPEZYµμ])?(?:ohms?|Ω)$/i;
|
|
18046
|
+
if (nominal[2] && !ohmUnit.test(nominal[2]) || tolerance[2] && !ohmUnit.test(tolerance[2])) {
|
|
18047
|
+
ctx.addIssue({
|
|
18048
|
+
code: z83.ZodIssueCode.custom,
|
|
18049
|
+
message: "Use an absolute ohm tolerance, not a percentage or another unit"
|
|
18050
|
+
});
|
|
18051
|
+
return z83.NEVER;
|
|
18052
|
+
}
|
|
18053
|
+
const nominalValue = resistance3.safeParse(
|
|
18054
|
+
`${nominal[1]}${nominal[2] || tolerance[2] || "ohm"}`
|
|
18055
|
+
);
|
|
18056
|
+
const toleranceValue = resistance3.safeParse(
|
|
18057
|
+
`${tolerance[1]}${tolerance[2] || nominal[2] || "ohm"}`
|
|
18058
|
+
);
|
|
18059
|
+
if (!nominalValue.success || !toleranceValue.success || !Number.isFinite(nominalValue.data) || !Number.isFinite(toleranceValue.data) || nominalValue.data <= 0 || toleranceValue.data < 0) {
|
|
18060
|
+
ctx.addIssue({
|
|
18061
|
+
code: z83.ZodIssueCode.custom,
|
|
18062
|
+
message: "Nominal impedance must be positive and tolerance nonnegative, in ohms"
|
|
18063
|
+
});
|
|
18064
|
+
return z83.NEVER;
|
|
18065
|
+
}
|
|
18066
|
+
return {
|
|
18067
|
+
nominal: nominalValue.data,
|
|
18068
|
+
min: nominalValue.data - toleranceValue.data,
|
|
18069
|
+
max: nominalValue.data + toleranceValue.data
|
|
18070
|
+
};
|
|
18071
|
+
}).pipe(
|
|
18072
|
+
z83.object({
|
|
18073
|
+
nominal: z83.number().positive().finite(),
|
|
18074
|
+
min: z83.number().positive().finite(),
|
|
18075
|
+
max: z83.number().positive().finite()
|
|
18076
|
+
})
|
|
18077
|
+
);
|
|
18078
|
+
var scalarImpedance = positiveImpedance;
|
|
18079
|
+
var impedanceTarget = z83.union([tolerantImpedance, scalarImpedance]);
|
|
18080
|
+
expectTypesMatch(true);
|
|
18081
|
+
function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
18082
|
+
if (min !== void 0 && max !== void 0 && min > max)
|
|
18083
|
+
ctx.addIssue({
|
|
18084
|
+
code: z83.ZodIssueCode.custom,
|
|
18085
|
+
path: [`${propName}Max`],
|
|
18086
|
+
message: "Maximum impedance cannot be below minimum impedance"
|
|
18087
|
+
});
|
|
18088
|
+
if (typeof target === "object") {
|
|
18089
|
+
for (const [suffix, explicit, derived] of [
|
|
18090
|
+
["Min", min, target.min],
|
|
18091
|
+
["Max", max, target.max]
|
|
18092
|
+
])
|
|
18093
|
+
if (explicit !== void 0 && Math.abs(explicit - derived) > 1e-9 * Math.max(1, Math.abs(derived)))
|
|
18094
|
+
ctx.addIssue({
|
|
18095
|
+
code: z83.ZodIssueCode.custom,
|
|
18096
|
+
path: [`${propName}${suffix}`],
|
|
18097
|
+
message: "Explicit impedance bound conflicts with the target tolerance"
|
|
18098
|
+
});
|
|
18099
|
+
} else if (target !== void 0 && (min !== void 0 && target < min || max !== void 0 && target > max))
|
|
18100
|
+
ctx.addIssue({
|
|
18101
|
+
code: z83.ZodIssueCode.custom,
|
|
18102
|
+
path: [propName],
|
|
18103
|
+
message: "Target impedance must lie within its declared bounds"
|
|
18104
|
+
});
|
|
18105
|
+
}
|
|
18106
|
+
|
|
18107
|
+
// lib/components/bus.ts
|
|
18108
|
+
import { distance as distance22, layer_ref as layer_ref7 } from "circuit-json";
|
|
18109
|
+
import { z as z84 } from "zod";
|
|
18110
|
+
var busProps = z84.object({
|
|
18111
|
+
name: z84.string().optional(),
|
|
18112
|
+
lengthMatchTo: lengthMatchTo.optional(),
|
|
18113
|
+
minLength: routeLength.optional(),
|
|
18114
|
+
maxLength: routeLength.optional(),
|
|
18115
|
+
targetLength: routeLength.optional(),
|
|
18116
|
+
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18117
|
+
pcbTraceSpacing: traceSpacing.optional(),
|
|
18118
|
+
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18119
|
+
connections: z84.array(z84.string()).min(1),
|
|
18120
|
+
routingPhaseIndex: z84.number().nullable().optional(),
|
|
18121
|
+
maxLengthSkew: distance22.pipe(z84.number().min(0).finite()).optional(),
|
|
18122
|
+
targetImpedance: impedanceTarget.optional(),
|
|
18123
|
+
targetImpedanceMin: positiveImpedance.optional(),
|
|
18124
|
+
targetImpedanceMax: positiveImpedance.optional(),
|
|
18125
|
+
pcbTraceWidth: distance22.pipe(z84.number().positive().finite()).optional(),
|
|
18126
|
+
pcbAllowedLayers: z84.array(layer_ref7).min(1).optional(),
|
|
17972
18127
|
preferredLayer: layer_ref7.optional(),
|
|
17973
|
-
preferredLayers:
|
|
17974
|
-
})
|
|
18128
|
+
preferredLayers: z84.array(layer_ref7).min(1).optional()
|
|
18129
|
+
}).superRefine((props, ctx) => {
|
|
18130
|
+
validateRouteLengths(props, ctx);
|
|
18131
|
+
validateImpedanceTarget(
|
|
18132
|
+
props.targetImpedance,
|
|
18133
|
+
props.targetImpedanceMin,
|
|
18134
|
+
props.targetImpedanceMax,
|
|
18135
|
+
ctx,
|
|
18136
|
+
"targetImpedance"
|
|
18137
|
+
);
|
|
18138
|
+
}).transform(
|
|
18139
|
+
({
|
|
18140
|
+
targetImpedance,
|
|
18141
|
+
...props
|
|
18142
|
+
}) => {
|
|
18143
|
+
if (targetImpedance === void 0) return props;
|
|
18144
|
+
if (typeof targetImpedance === "number")
|
|
18145
|
+
return { ...props, targetImpedance };
|
|
18146
|
+
return {
|
|
18147
|
+
...props,
|
|
18148
|
+
targetImpedance: targetImpedance.nominal,
|
|
18149
|
+
targetImpedanceMin: targetImpedance.min,
|
|
18150
|
+
targetImpedanceMax: targetImpedance.max
|
|
18151
|
+
};
|
|
18152
|
+
}
|
|
18153
|
+
);
|
|
17975
18154
|
expectTypesMatch(true);
|
|
17976
18155
|
|
|
17977
18156
|
// lib/components/differentialpair.ts
|
|
17978
|
-
import { distance as
|
|
17979
|
-
import { z as
|
|
17980
|
-
var differentialPairProps =
|
|
17981
|
-
name:
|
|
17982
|
-
|
|
17983
|
-
|
|
17984
|
-
|
|
17985
|
-
|
|
17986
|
-
|
|
17987
|
-
|
|
17988
|
-
|
|
18157
|
+
import { distance as distance23 } from "circuit-json";
|
|
18158
|
+
import { z as z85 } from "zod";
|
|
18159
|
+
var differentialPairProps = z85.object({
|
|
18160
|
+
name: z85.string().optional(),
|
|
18161
|
+
lengthMatchTo: lengthMatchTo.optional(),
|
|
18162
|
+
minLength: routeLength.optional(),
|
|
18163
|
+
maxLength: routeLength.optional(),
|
|
18164
|
+
targetLength: routeLength.optional(),
|
|
18165
|
+
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18166
|
+
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18167
|
+
positiveConnection: z85.string(),
|
|
18168
|
+
negativeConnection: z85.string(),
|
|
18169
|
+
maxLengthSkew: distance23.pipe(z85.number().min(0).finite()).optional(),
|
|
18170
|
+
targetDifferentialImpedance: impedanceTarget.optional(),
|
|
18171
|
+
targetDifferentialImpedanceMin: positiveImpedance.optional(),
|
|
18172
|
+
targetDifferentialImpedanceMax: positiveImpedance.optional(),
|
|
18173
|
+
pcbTraceGap: distance23.pipe(z85.number().positive().finite()).optional(),
|
|
18174
|
+
maxUncoupledLength: distance23.pipe(z85.number().min(0).finite()).optional()
|
|
18175
|
+
}).superRefine((props, ctx) => {
|
|
18176
|
+
validateRouteLengths(props, ctx);
|
|
18177
|
+
validateImpedanceTarget(
|
|
18178
|
+
props.targetDifferentialImpedance,
|
|
18179
|
+
props.targetDifferentialImpedanceMin,
|
|
18180
|
+
props.targetDifferentialImpedanceMax,
|
|
18181
|
+
ctx,
|
|
18182
|
+
"targetDifferentialImpedance"
|
|
18183
|
+
);
|
|
18184
|
+
}).transform(
|
|
18185
|
+
({
|
|
18186
|
+
targetDifferentialImpedance,
|
|
18187
|
+
...props
|
|
18188
|
+
}) => {
|
|
18189
|
+
if (targetDifferentialImpedance === void 0) return props;
|
|
18190
|
+
if (typeof targetDifferentialImpedance === "number")
|
|
18191
|
+
return { ...props, targetDifferentialImpedance };
|
|
18192
|
+
return {
|
|
18193
|
+
...props,
|
|
18194
|
+
targetDifferentialImpedance: targetDifferentialImpedance.nominal,
|
|
18195
|
+
targetDifferentialImpedanceMin: targetDifferentialImpedance.min,
|
|
18196
|
+
targetDifferentialImpedanceMax: targetDifferentialImpedance.max
|
|
18197
|
+
};
|
|
18198
|
+
}
|
|
18199
|
+
);
|
|
17989
18200
|
expectTypesMatch(true);
|
|
17990
18201
|
|
|
17991
18202
|
// lib/components/footprint.ts
|
|
17992
18203
|
import {
|
|
17993
18204
|
layer_ref as layer_ref8
|
|
17994
18205
|
} from "circuit-json";
|
|
17995
|
-
import { z as
|
|
17996
|
-
var footprintInsertionDirection =
|
|
18206
|
+
import { z as z86 } from "zod";
|
|
18207
|
+
var footprintInsertionDirection = z86.enum([
|
|
17997
18208
|
"from_left",
|
|
17998
18209
|
"from_right",
|
|
17999
18210
|
"from_top",
|
|
@@ -18011,11 +18222,11 @@ var footprintInsertionDirection = z83.enum([
|
|
|
18011
18222
|
"from_back"
|
|
18012
18223
|
]);
|
|
18013
18224
|
expectTypesMatch(true);
|
|
18014
|
-
var footprintProps =
|
|
18015
|
-
children:
|
|
18016
|
-
name:
|
|
18225
|
+
var footprintProps = z86.object({
|
|
18226
|
+
children: z86.any().optional(),
|
|
18227
|
+
name: z86.string().optional(),
|
|
18017
18228
|
originalLayer: layer_ref8.default("top").optional(),
|
|
18018
|
-
circuitJson:
|
|
18229
|
+
circuitJson: z86.array(z86.any()).optional(),
|
|
18019
18230
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
18020
18231
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
18021
18232
|
"Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
|
|
@@ -18027,19 +18238,19 @@ var footprintProps = z83.object({
|
|
|
18027
18238
|
expectTypesMatch(true);
|
|
18028
18239
|
|
|
18029
18240
|
// lib/components/symbol.ts
|
|
18030
|
-
import { z as
|
|
18031
|
-
var symbolProps =
|
|
18032
|
-
originalFacingDirection:
|
|
18241
|
+
import { z as z87 } from "zod";
|
|
18242
|
+
var symbolProps = z87.object({
|
|
18243
|
+
originalFacingDirection: z87.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
18033
18244
|
width: distance.optional(),
|
|
18034
18245
|
height: distance.optional(),
|
|
18035
|
-
name:
|
|
18246
|
+
name: z87.string().optional()
|
|
18036
18247
|
});
|
|
18037
18248
|
expectTypesMatch(true);
|
|
18038
18249
|
|
|
18039
18250
|
// lib/components/battery.ts
|
|
18040
18251
|
import { voltage as voltage2 } from "circuit-json";
|
|
18041
|
-
import { z as
|
|
18042
|
-
var capacity =
|
|
18252
|
+
import { z as z88 } from "zod";
|
|
18253
|
+
var capacity = z88.number().or(z88.string().endsWith("mAh")).transform((v) => {
|
|
18043
18254
|
if (typeof v === "string") {
|
|
18044
18255
|
const valString = v.replace("mAh", "");
|
|
18045
18256
|
const num = Number.parseFloat(valString);
|
|
@@ -18054,14 +18265,14 @@ var batteryPins = lrPolarPins;
|
|
|
18054
18265
|
var batteryProps = commonComponentProps.extend({
|
|
18055
18266
|
capacity: capacity.optional(),
|
|
18056
18267
|
voltage: voltage2.optional(),
|
|
18057
|
-
standard:
|
|
18268
|
+
standard: z88.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
18058
18269
|
schOrientation: schematicOrientation.optional(),
|
|
18059
18270
|
connections: createConnectionsProp(batteryPins).optional()
|
|
18060
18271
|
});
|
|
18061
18272
|
expectTypesMatch(true);
|
|
18062
18273
|
|
|
18063
18274
|
// lib/components/mountedboard.ts
|
|
18064
|
-
import { z as
|
|
18275
|
+
import { z as z89 } from "zod";
|
|
18065
18276
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
18066
18277
|
mpn: chipProps.shape.mpn,
|
|
18067
18278
|
mfn: chipProps.shape.mfn,
|
|
@@ -18075,48 +18286,48 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
18075
18286
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
18076
18287
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
18077
18288
|
boardToBoardDistance: distance.optional(),
|
|
18078
|
-
mountOrientation:
|
|
18289
|
+
mountOrientation: z89.enum(["faceDown", "faceUp"]).optional()
|
|
18079
18290
|
});
|
|
18080
18291
|
expectTypesMatch(true);
|
|
18081
18292
|
|
|
18082
18293
|
// lib/components/pin-header.ts
|
|
18083
|
-
import { distance as
|
|
18294
|
+
import { distance as distance24 } from "circuit-json";
|
|
18084
18295
|
|
|
18085
18296
|
// lib/common/pcbOrientation.ts
|
|
18086
|
-
import { z as
|
|
18087
|
-
var pcbOrientation =
|
|
18297
|
+
import { z as z90 } from "zod";
|
|
18298
|
+
var pcbOrientation = z90.enum(["vertical", "horizontal"]).describe(
|
|
18088
18299
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
18089
18300
|
);
|
|
18090
18301
|
expectTypesMatch(true);
|
|
18091
18302
|
|
|
18092
18303
|
// lib/components/pin-header.ts
|
|
18093
|
-
import { z as
|
|
18304
|
+
import { z as z91 } from "zod";
|
|
18094
18305
|
var pinHeaderProps = commonComponentProps.extend({
|
|
18095
|
-
pinCount:
|
|
18096
|
-
pitch:
|
|
18097
|
-
schFacingDirection:
|
|
18098
|
-
gender:
|
|
18099
|
-
showSilkscreenPinLabels:
|
|
18100
|
-
pcbPinLabels:
|
|
18101
|
-
doubleRow:
|
|
18102
|
-
rightAngle:
|
|
18306
|
+
pinCount: z91.number(),
|
|
18307
|
+
pitch: distance24.optional(),
|
|
18308
|
+
schFacingDirection: z91.enum(["up", "down", "left", "right"]).optional(),
|
|
18309
|
+
gender: z91.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
18310
|
+
showSilkscreenPinLabels: z91.boolean().optional(),
|
|
18311
|
+
pcbPinLabels: z91.record(z91.string(), z91.string()).optional(),
|
|
18312
|
+
doubleRow: z91.boolean().optional(),
|
|
18313
|
+
rightAngle: z91.boolean().optional(),
|
|
18103
18314
|
pcbOrientation: pcbOrientation.optional(),
|
|
18104
|
-
holeDiameter:
|
|
18105
|
-
platedDiameter:
|
|
18106
|
-
pinLabels:
|
|
18107
|
-
connections:
|
|
18108
|
-
facingDirection:
|
|
18315
|
+
holeDiameter: distance24.optional(),
|
|
18316
|
+
platedDiameter: distance24.optional(),
|
|
18317
|
+
pinLabels: z91.record(z91.string(), schematicPinLabel).or(z91.array(schematicPinLabel)).optional(),
|
|
18318
|
+
connections: z91.custom().pipe(z91.record(z91.string(), connectionTarget)).optional(),
|
|
18319
|
+
facingDirection: z91.enum(["left", "right"]).optional(),
|
|
18109
18320
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18110
18321
|
schPinStyle: schematicPinStyle.optional(),
|
|
18111
|
-
schPinSpacing:
|
|
18112
|
-
schWidth:
|
|
18113
|
-
schHeight:
|
|
18114
|
-
connectsFromAbove:
|
|
18115
|
-
connectsFromBelow:
|
|
18322
|
+
schPinSpacing: distance24.optional(),
|
|
18323
|
+
schWidth: distance24.optional(),
|
|
18324
|
+
schHeight: distance24.optional(),
|
|
18325
|
+
connectsFromAbove: z91.boolean().optional(),
|
|
18326
|
+
connectsFromBelow: z91.boolean().optional()
|
|
18116
18327
|
}).superRefine((props, ctx) => {
|
|
18117
18328
|
if (props.connectsFromAbove && props.connectsFromBelow) {
|
|
18118
18329
|
ctx.addIssue({
|
|
18119
|
-
code:
|
|
18330
|
+
code: z91.ZodIssueCode.custom,
|
|
18120
18331
|
message: "connectsFromAbove and connectsFromBelow are opposites; set at most one"
|
|
18121
18332
|
});
|
|
18122
18333
|
}
|
|
@@ -18127,30 +18338,30 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
18127
18338
|
expectTypesMatch(true);
|
|
18128
18339
|
|
|
18129
18340
|
// lib/components/netalias.ts
|
|
18130
|
-
import { z as
|
|
18341
|
+
import { z as z92 } from "zod";
|
|
18131
18342
|
import { rotation as rotation4 } from "circuit-json";
|
|
18132
|
-
var netAliasProps =
|
|
18133
|
-
net:
|
|
18134
|
-
connection:
|
|
18343
|
+
var netAliasProps = z92.object({
|
|
18344
|
+
net: z92.string().optional(),
|
|
18345
|
+
connection: z92.string().optional(),
|
|
18135
18346
|
schX: distance.optional(),
|
|
18136
18347
|
schY: distance.optional(),
|
|
18137
18348
|
schRotation: rotation4.optional(),
|
|
18138
|
-
anchorSide:
|
|
18349
|
+
anchorSide: z92.enum(["left", "top", "right", "bottom"]).optional()
|
|
18139
18350
|
});
|
|
18140
18351
|
expectTypesMatch(true);
|
|
18141
18352
|
|
|
18142
18353
|
// lib/components/netlabel.ts
|
|
18143
|
-
import { z as
|
|
18354
|
+
import { z as z93 } from "zod";
|
|
18144
18355
|
import { rotation as rotation5 } from "circuit-json";
|
|
18145
|
-
var netLabelProps =
|
|
18146
|
-
net:
|
|
18147
|
-
connection:
|
|
18148
|
-
connectsTo:
|
|
18149
|
-
inline:
|
|
18356
|
+
var netLabelProps = z93.object({
|
|
18357
|
+
net: z93.string().optional(),
|
|
18358
|
+
connection: z93.string().optional(),
|
|
18359
|
+
connectsTo: z93.string().or(z93.array(z93.string())).optional(),
|
|
18360
|
+
inline: z93.boolean().optional(),
|
|
18150
18361
|
schX: distance.optional(),
|
|
18151
18362
|
schY: distance.optional(),
|
|
18152
18363
|
schRotation: rotation5.optional(),
|
|
18153
|
-
anchorSide:
|
|
18364
|
+
anchorSide: z93.enum(["left", "top", "right", "bottom"]).optional()
|
|
18154
18365
|
});
|
|
18155
18366
|
expectTypesMatch(true);
|
|
18156
18367
|
|
|
@@ -18165,32 +18376,32 @@ expectTypesMatch(true);
|
|
|
18165
18376
|
|
|
18166
18377
|
// lib/components/analogsimulation.ts
|
|
18167
18378
|
import { ms } from "circuit-json";
|
|
18168
|
-
import { z as
|
|
18169
|
-
var spiceEngine =
|
|
18379
|
+
import { z as z95 } from "zod";
|
|
18380
|
+
var spiceEngine = z95.custom(
|
|
18170
18381
|
(value) => typeof value === "string"
|
|
18171
18382
|
);
|
|
18172
|
-
var spiceOptions =
|
|
18173
|
-
method:
|
|
18174
|
-
reltol:
|
|
18175
|
-
abstol:
|
|
18176
|
-
vntol:
|
|
18383
|
+
var spiceOptions = z95.object({
|
|
18384
|
+
method: z95.enum(["trap", "gear"]).optional(),
|
|
18385
|
+
reltol: z95.union([z95.number(), z95.string()]).optional(),
|
|
18386
|
+
abstol: z95.union([z95.number(), z95.string()]).optional(),
|
|
18387
|
+
vntol: z95.union([z95.number(), z95.string()]).optional()
|
|
18177
18388
|
});
|
|
18178
18389
|
var analogAnalysisSimulationBaseProps = {
|
|
18179
|
-
name:
|
|
18390
|
+
name: z95.string().optional(),
|
|
18180
18391
|
spiceEngine: spiceEngine.optional(),
|
|
18181
18392
|
spiceOptions: spiceOptions.optional(),
|
|
18182
|
-
graphIndependentAxes:
|
|
18183
|
-
children:
|
|
18393
|
+
graphIndependentAxes: z95.boolean().optional(),
|
|
18394
|
+
children: z95.custom().optional()
|
|
18184
18395
|
};
|
|
18185
|
-
var analogSimulationProps =
|
|
18186
|
-
name:
|
|
18187
|
-
simulationType:
|
|
18396
|
+
var analogSimulationProps = z95.object({
|
|
18397
|
+
name: z95.string().optional(),
|
|
18398
|
+
simulationType: z95.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
18188
18399
|
duration: ms.optional(),
|
|
18189
18400
|
startTime: ms.optional(),
|
|
18190
18401
|
timePerStep: ms.optional(),
|
|
18191
18402
|
spiceEngine: spiceEngine.optional(),
|
|
18192
18403
|
spiceOptions: spiceOptions.optional(),
|
|
18193
|
-
graphIndependentAxes:
|
|
18404
|
+
graphIndependentAxes: z95.boolean().optional()
|
|
18194
18405
|
});
|
|
18195
18406
|
expectTypesMatch(
|
|
18196
18407
|
true
|
|
@@ -18198,12 +18409,12 @@ expectTypesMatch(
|
|
|
18198
18409
|
|
|
18199
18410
|
// lib/components/analogtransientsimulation.ts
|
|
18200
18411
|
import { ms as ms2 } from "circuit-json";
|
|
18201
|
-
import { z as
|
|
18412
|
+
import { z as z96 } from "zod";
|
|
18202
18413
|
var positiveMilliseconds = ms2.refine(
|
|
18203
18414
|
(milliseconds) => milliseconds > 0,
|
|
18204
18415
|
"Time must be positive"
|
|
18205
18416
|
);
|
|
18206
|
-
var analogTransientSimulationProps =
|
|
18417
|
+
var analogTransientSimulationProps = z96.object({
|
|
18207
18418
|
...analogAnalysisSimulationBaseProps,
|
|
18208
18419
|
duration: positiveMilliseconds.default("10ms"),
|
|
18209
18420
|
startTime: ms2.default("0ms"),
|
|
@@ -18211,7 +18422,7 @@ var analogTransientSimulationProps = z93.object({
|
|
|
18211
18422
|
}).superRefine((simulation, context) => {
|
|
18212
18423
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
18213
18424
|
context.addIssue({
|
|
18214
|
-
code:
|
|
18425
|
+
code: z96.ZodIssueCode.custom,
|
|
18215
18426
|
path: ["startTime"],
|
|
18216
18427
|
message: "startTime must be between zero and duration"
|
|
18217
18428
|
});
|
|
@@ -18220,19 +18431,19 @@ var analogTransientSimulationProps = z93.object({
|
|
|
18220
18431
|
expectTypesMatch(true);
|
|
18221
18432
|
|
|
18222
18433
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
18223
|
-
import { z as
|
|
18224
|
-
var analogDcOperatingPointSimulationProps =
|
|
18434
|
+
import { z as z97 } from "zod";
|
|
18435
|
+
var analogDcOperatingPointSimulationProps = z97.object({
|
|
18225
18436
|
...analogAnalysisSimulationBaseProps
|
|
18226
18437
|
});
|
|
18227
18438
|
expectTypesMatch(true);
|
|
18228
18439
|
|
|
18229
18440
|
// lib/components/analogdcsweepsimulation.ts
|
|
18230
18441
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
18231
|
-
import { z as
|
|
18232
|
-
var dcSweepQuantity =
|
|
18233
|
-
var analogDcSweepSimulationProps =
|
|
18442
|
+
import { z as z98 } from "zod";
|
|
18443
|
+
var dcSweepQuantity = z98.union([voltage3, current]);
|
|
18444
|
+
var analogDcSweepSimulationProps = z98.object({
|
|
18234
18445
|
...analogAnalysisSimulationBaseProps,
|
|
18235
|
-
sweepSource:
|
|
18446
|
+
sweepSource: z98.string().min(1),
|
|
18236
18447
|
sweepStart: dcSweepQuantity,
|
|
18237
18448
|
sweepStop: dcSweepQuantity,
|
|
18238
18449
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -18242,7 +18453,7 @@ var analogDcSweepSimulationProps = z95.object({
|
|
|
18242
18453
|
}).superRefine((simulation, context) => {
|
|
18243
18454
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
18244
18455
|
context.addIssue({
|
|
18245
|
-
code:
|
|
18456
|
+
code: z98.ZodIssueCode.custom,
|
|
18246
18457
|
path: ["sweepStep"],
|
|
18247
18458
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
18248
18459
|
});
|
|
@@ -18252,10 +18463,10 @@ expectTypesMatch(true);
|
|
|
18252
18463
|
|
|
18253
18464
|
// lib/components/analogacsweepsimulation.ts
|
|
18254
18465
|
import { frequency as frequency3 } from "circuit-json";
|
|
18255
|
-
import { z as
|
|
18256
|
-
var analogAcSweepSimulationProps =
|
|
18466
|
+
import { z as z99 } from "zod";
|
|
18467
|
+
var analogAcSweepSimulationProps = z99.object({
|
|
18257
18468
|
...analogAnalysisSimulationBaseProps,
|
|
18258
|
-
sweepType:
|
|
18469
|
+
sweepType: z99.enum(["linear", "decade", "octave"]),
|
|
18259
18470
|
startFrequency: frequency3.refine(
|
|
18260
18471
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
18261
18472
|
"startFrequency must be positive"
|
|
@@ -18264,12 +18475,12 @@ var analogAcSweepSimulationProps = z96.object({
|
|
|
18264
18475
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
18265
18476
|
"stopFrequency must be positive"
|
|
18266
18477
|
),
|
|
18267
|
-
samplesPerInterval:
|
|
18268
|
-
sampleCount:
|
|
18478
|
+
samplesPerInterval: z99.number().int().positive().optional(),
|
|
18479
|
+
sampleCount: z99.number().int().positive().optional()
|
|
18269
18480
|
}).superRefine((simulation, context) => {
|
|
18270
18481
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
18271
18482
|
context.addIssue({
|
|
18272
|
-
code:
|
|
18483
|
+
code: z99.ZodIssueCode.custom,
|
|
18273
18484
|
path: ["stopFrequency"],
|
|
18274
18485
|
message: "stopFrequency must be greater than startFrequency"
|
|
18275
18486
|
});
|
|
@@ -18277,14 +18488,14 @@ var analogAcSweepSimulationProps = z96.object({
|
|
|
18277
18488
|
if (simulation.sweepType === "linear") {
|
|
18278
18489
|
if (simulation.sampleCount === void 0) {
|
|
18279
18490
|
context.addIssue({
|
|
18280
|
-
code:
|
|
18491
|
+
code: z99.ZodIssueCode.custom,
|
|
18281
18492
|
path: ["sampleCount"],
|
|
18282
18493
|
message: "sampleCount is required for a linear AC sweep"
|
|
18283
18494
|
});
|
|
18284
18495
|
}
|
|
18285
18496
|
if (simulation.samplesPerInterval !== void 0) {
|
|
18286
18497
|
context.addIssue({
|
|
18287
|
-
code:
|
|
18498
|
+
code: z99.ZodIssueCode.custom,
|
|
18288
18499
|
path: ["samplesPerInterval"],
|
|
18289
18500
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
18290
18501
|
});
|
|
@@ -18293,14 +18504,14 @@ var analogAcSweepSimulationProps = z96.object({
|
|
|
18293
18504
|
}
|
|
18294
18505
|
if (simulation.samplesPerInterval === void 0) {
|
|
18295
18506
|
context.addIssue({
|
|
18296
|
-
code:
|
|
18507
|
+
code: z99.ZodIssueCode.custom,
|
|
18297
18508
|
path: ["samplesPerInterval"],
|
|
18298
18509
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
18299
18510
|
});
|
|
18300
18511
|
}
|
|
18301
18512
|
if (simulation.sampleCount !== void 0) {
|
|
18302
18513
|
context.addIssue({
|
|
18303
|
-
code:
|
|
18514
|
+
code: z99.ZodIssueCode.custom,
|
|
18304
18515
|
path: ["sampleCount"],
|
|
18305
18516
|
message: "sampleCount is only valid for a linear sweep"
|
|
18306
18517
|
});
|
|
@@ -18313,46 +18524,46 @@ import {
|
|
|
18313
18524
|
capacitance as capacitance4,
|
|
18314
18525
|
current as current2,
|
|
18315
18526
|
inductance,
|
|
18316
|
-
resistance as
|
|
18527
|
+
resistance as resistance4,
|
|
18317
18528
|
voltage as voltage4
|
|
18318
18529
|
} from "circuit-json";
|
|
18319
|
-
import { z as
|
|
18320
|
-
var resistanceSweepQuantity =
|
|
18321
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
18322
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
18323
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
18324
|
-
var currentSweepQuantity = current2.pipe(
|
|
18530
|
+
import { z as z100 } from "zod";
|
|
18531
|
+
var resistanceSweepQuantity = resistance4.pipe(z100.number());
|
|
18532
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z100.number());
|
|
18533
|
+
var inductanceSweepQuantity = inductance.pipe(z100.number());
|
|
18534
|
+
var voltageSweepQuantity = voltage4.pipe(z100.number());
|
|
18535
|
+
var currentSweepQuantity = current2.pipe(z100.number());
|
|
18325
18536
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
18326
|
-
name:
|
|
18327
|
-
values:
|
|
18537
|
+
name: z100.string().optional(),
|
|
18538
|
+
values: z100.array(sweepQuantity).min(1).optional(),
|
|
18328
18539
|
start: sweepQuantity.optional(),
|
|
18329
18540
|
stop: sweepQuantity.optional(),
|
|
18330
18541
|
step: sweepQuantity.optional()
|
|
18331
18542
|
});
|
|
18332
|
-
var analogResistanceSweepParameterProps =
|
|
18543
|
+
var analogResistanceSweepParameterProps = z100.object({
|
|
18333
18544
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
18334
|
-
parameterType:
|
|
18335
|
-
resistorRef:
|
|
18545
|
+
parameterType: z100.literal("resistance"),
|
|
18546
|
+
resistorRef: z100.string().min(1)
|
|
18336
18547
|
}).strict();
|
|
18337
|
-
var analogCapacitanceSweepParameterProps =
|
|
18548
|
+
var analogCapacitanceSweepParameterProps = z100.object({
|
|
18338
18549
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
18339
|
-
parameterType:
|
|
18340
|
-
capacitorRef:
|
|
18550
|
+
parameterType: z100.literal("capacitance"),
|
|
18551
|
+
capacitorRef: z100.string().min(1)
|
|
18341
18552
|
}).strict();
|
|
18342
|
-
var analogInductanceSweepParameterProps =
|
|
18553
|
+
var analogInductanceSweepParameterProps = z100.object({
|
|
18343
18554
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
18344
|
-
parameterType:
|
|
18345
|
-
inductorRef:
|
|
18555
|
+
parameterType: z100.literal("inductance"),
|
|
18556
|
+
inductorRef: z100.string().min(1)
|
|
18346
18557
|
}).strict();
|
|
18347
|
-
var analogVoltageSweepParameterProps =
|
|
18558
|
+
var analogVoltageSweepParameterProps = z100.object({
|
|
18348
18559
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
18349
|
-
parameterType:
|
|
18350
|
-
net:
|
|
18560
|
+
parameterType: z100.literal("voltage"),
|
|
18561
|
+
net: z100.string().min(1)
|
|
18351
18562
|
}).strict();
|
|
18352
|
-
var analogCurrentSweepParameterProps =
|
|
18563
|
+
var analogCurrentSweepParameterProps = z100.object({
|
|
18353
18564
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
18354
|
-
parameterType:
|
|
18355
|
-
currentSourceRef:
|
|
18565
|
+
parameterType: z100.literal("current"),
|
|
18566
|
+
currentSourceRef: z100.string().min(1)
|
|
18356
18567
|
}).strict();
|
|
18357
18568
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
18358
18569
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -18364,34 +18575,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
18364
18575
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
18365
18576
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
18366
18577
|
context.addIssue({
|
|
18367
|
-
code:
|
|
18578
|
+
code: z100.ZodIssueCode.custom,
|
|
18368
18579
|
message: "Provide either values or start/stop/step"
|
|
18369
18580
|
});
|
|
18370
18581
|
return;
|
|
18371
18582
|
}
|
|
18372
18583
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
18373
18584
|
context.addIssue({
|
|
18374
|
-
code:
|
|
18585
|
+
code: z100.ZodIssueCode.custom,
|
|
18375
18586
|
message: "start, stop, and step must be provided together"
|
|
18376
18587
|
});
|
|
18377
18588
|
return;
|
|
18378
18589
|
}
|
|
18379
18590
|
if (sweepCoordinates.step === 0) {
|
|
18380
18591
|
context.addIssue({
|
|
18381
|
-
code:
|
|
18592
|
+
code: z100.ZodIssueCode.custom,
|
|
18382
18593
|
path: ["step"],
|
|
18383
18594
|
message: "step must be nonzero"
|
|
18384
18595
|
});
|
|
18385
18596
|
}
|
|
18386
18597
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
18387
18598
|
context.addIssue({
|
|
18388
|
-
code:
|
|
18599
|
+
code: z100.ZodIssueCode.custom,
|
|
18389
18600
|
path: ["step"],
|
|
18390
18601
|
message: "step must move from start toward stop"
|
|
18391
18602
|
});
|
|
18392
18603
|
}
|
|
18393
18604
|
};
|
|
18394
|
-
var analogSweepParameterProps =
|
|
18605
|
+
var analogSweepParameterProps = z100.discriminatedUnion("parameterType", [
|
|
18395
18606
|
analogResistanceSweepParameterProps,
|
|
18396
18607
|
analogCapacitanceSweepParameterProps,
|
|
18397
18608
|
analogInductanceSweepParameterProps,
|
|
@@ -18406,26 +18617,26 @@ expectTypesMatch(true);
|
|
|
18406
18617
|
expectTypesMatch(true);
|
|
18407
18618
|
|
|
18408
18619
|
// lib/components/autoroutingphase.ts
|
|
18409
|
-
import { z as
|
|
18410
|
-
var autoroutingPhaseProps =
|
|
18411
|
-
key:
|
|
18412
|
-
name:
|
|
18620
|
+
import { z as z101 } from "zod";
|
|
18621
|
+
var autoroutingPhaseProps = z101.object({
|
|
18622
|
+
key: z101.any().optional(),
|
|
18623
|
+
name: z101.string().optional(),
|
|
18413
18624
|
autorouter: autorouterProp.optional(),
|
|
18414
18625
|
algorithmFn: autorouterConfig.shape.algorithmFn,
|
|
18415
18626
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
18416
|
-
phaseIndex:
|
|
18417
|
-
pcbTracePaths:
|
|
18627
|
+
phaseIndex: z101.number().optional(),
|
|
18628
|
+
pcbTracePaths: z101.array(fanoutTracePath).optional(),
|
|
18418
18629
|
...routingTolerances.shape,
|
|
18419
|
-
region:
|
|
18420
|
-
shape:
|
|
18421
|
-
minX:
|
|
18422
|
-
maxX:
|
|
18423
|
-
minY:
|
|
18424
|
-
maxY:
|
|
18630
|
+
region: z101.object({
|
|
18631
|
+
shape: z101.literal("rect").optional(),
|
|
18632
|
+
minX: z101.number(),
|
|
18633
|
+
maxX: z101.number(),
|
|
18634
|
+
minY: z101.number(),
|
|
18635
|
+
maxY: z101.number()
|
|
18425
18636
|
}).optional(),
|
|
18426
|
-
connection:
|
|
18427
|
-
connections:
|
|
18428
|
-
reroute:
|
|
18637
|
+
connection: z101.string().optional(),
|
|
18638
|
+
connections: z101.array(z101.string()).optional(),
|
|
18639
|
+
reroute: z101.boolean().optional(),
|
|
18429
18640
|
...fanoutProps.shape
|
|
18430
18641
|
}).superRefine((value, ctx) => {
|
|
18431
18642
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
@@ -18436,7 +18647,7 @@ var autoroutingPhaseProps = z98.object({
|
|
|
18436
18647
|
}
|
|
18437
18648
|
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
18438
18649
|
ctx.addIssue({
|
|
18439
|
-
code:
|
|
18650
|
+
code: z101.ZodIssueCode.custom,
|
|
18440
18651
|
message: "region, connection, or connections is required when reroute is provided",
|
|
18441
18652
|
path: ["region"]
|
|
18442
18653
|
});
|
|
@@ -18445,15 +18656,15 @@ var autoroutingPhaseProps = z98.object({
|
|
|
18445
18656
|
expectTypesMatch(true);
|
|
18446
18657
|
|
|
18447
18658
|
// lib/components/spicemodel.ts
|
|
18448
|
-
import { z as
|
|
18449
|
-
var spicemodelProps =
|
|
18450
|
-
source:
|
|
18451
|
-
spicePinMapping:
|
|
18659
|
+
import { z as z102 } from "zod";
|
|
18660
|
+
var spicemodelProps = z102.object({
|
|
18661
|
+
source: z102.string(),
|
|
18662
|
+
spicePinMapping: z102.record(z102.string(), z102.string()).optional()
|
|
18452
18663
|
});
|
|
18453
18664
|
expectTypesMatch(true);
|
|
18454
18665
|
|
|
18455
18666
|
// lib/components/transistor.ts
|
|
18456
|
-
import { z as
|
|
18667
|
+
import { z as z103 } from "zod";
|
|
18457
18668
|
var transistorPinsLabels = [
|
|
18458
18669
|
"pin1",
|
|
18459
18670
|
"pin2",
|
|
@@ -18466,7 +18677,7 @@ var transistorPinsLabels = [
|
|
|
18466
18677
|
"drain"
|
|
18467
18678
|
];
|
|
18468
18679
|
var transistorProps = commonComponentProps.extend({
|
|
18469
|
-
type:
|
|
18680
|
+
type: z103.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
18470
18681
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
18471
18682
|
});
|
|
18472
18683
|
var transistorPins = [
|
|
@@ -18480,7 +18691,7 @@ var transistorPins = [
|
|
|
18480
18691
|
expectTypesMatch(true);
|
|
18481
18692
|
|
|
18482
18693
|
// lib/components/mosfet.ts
|
|
18483
|
-
import { z as
|
|
18694
|
+
import { z as z104 } from "zod";
|
|
18484
18695
|
var mosfetPins = [
|
|
18485
18696
|
"pin1",
|
|
18486
18697
|
"drain",
|
|
@@ -18490,11 +18701,11 @@ var mosfetPins = [
|
|
|
18490
18701
|
"gate"
|
|
18491
18702
|
];
|
|
18492
18703
|
var mosfetProps = commonComponentProps.extend({
|
|
18493
|
-
channelType:
|
|
18494
|
-
mosfetMode:
|
|
18495
|
-
symbolDrainSide:
|
|
18496
|
-
symbolSourceSide:
|
|
18497
|
-
symbolGateSide:
|
|
18704
|
+
channelType: z104.enum(["n", "p"]),
|
|
18705
|
+
mosfetMode: z104.enum(["enhancement", "depletion"]),
|
|
18706
|
+
symbolDrainSide: z104.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18707
|
+
symbolSourceSide: z104.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18708
|
+
symbolGateSide: z104.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18498
18709
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
18499
18710
|
});
|
|
18500
18711
|
expectTypesMatch(true);
|
|
@@ -18516,29 +18727,29 @@ expectTypesMatch(true);
|
|
|
18516
18727
|
|
|
18517
18728
|
// lib/components/inductor.ts
|
|
18518
18729
|
import { inductance as inductance2 } from "circuit-json";
|
|
18519
|
-
import { z as
|
|
18730
|
+
import { z as z106 } from "zod";
|
|
18520
18731
|
var inductorPins = lrPins;
|
|
18521
18732
|
var inductorProps = commonComponentProps.extend({
|
|
18522
18733
|
inductance: inductance2,
|
|
18523
|
-
maxCurrentRating:
|
|
18734
|
+
maxCurrentRating: z106.union([z106.string(), z106.number()]).optional(),
|
|
18524
18735
|
schOrientation: schematicOrientation.optional(),
|
|
18525
18736
|
connections: createConnectionsProp(inductorPins).optional()
|
|
18526
18737
|
});
|
|
18527
18738
|
expectTypesMatch(true);
|
|
18528
18739
|
|
|
18529
18740
|
// lib/components/internal-circuit.ts
|
|
18530
|
-
import { z as
|
|
18531
|
-
var internalCircuitProps =
|
|
18532
|
-
children:
|
|
18741
|
+
import { z as z107 } from "zod";
|
|
18742
|
+
var internalCircuitProps = z107.object({
|
|
18743
|
+
children: z107.custom().optional()
|
|
18533
18744
|
});
|
|
18534
18745
|
expectTypesMatch(
|
|
18535
18746
|
true
|
|
18536
18747
|
);
|
|
18537
18748
|
|
|
18538
18749
|
// lib/components/diode.ts
|
|
18539
|
-
import { z as
|
|
18750
|
+
import { z as z108 } from "zod";
|
|
18540
18751
|
var diodePins = lrPolarPins;
|
|
18541
|
-
var diodeConnectionKeys =
|
|
18752
|
+
var diodeConnectionKeys = z108.enum([
|
|
18542
18753
|
"anode",
|
|
18543
18754
|
"cathode",
|
|
18544
18755
|
"pin1",
|
|
@@ -18546,13 +18757,13 @@ var diodeConnectionKeys = z105.enum([
|
|
|
18546
18757
|
"pos",
|
|
18547
18758
|
"neg"
|
|
18548
18759
|
]);
|
|
18549
|
-
var connectionTarget3 =
|
|
18550
|
-
var connectionsProp2 =
|
|
18551
|
-
var diodePinLabelsProp =
|
|
18552
|
-
|
|
18553
|
-
schematicPinLabel.or(
|
|
18760
|
+
var connectionTarget3 = z108.string().or(z108.array(z108.string()).readonly()).or(z108.array(z108.string()));
|
|
18761
|
+
var connectionsProp2 = z108.record(diodeConnectionKeys, connectionTarget3);
|
|
18762
|
+
var diodePinLabelsProp = z108.record(
|
|
18763
|
+
z108.enum(diodePins),
|
|
18764
|
+
schematicPinLabel.or(z108.array(schematicPinLabel).readonly()).or(z108.array(schematicPinLabel))
|
|
18554
18765
|
);
|
|
18555
|
-
var diodeVariant =
|
|
18766
|
+
var diodeVariant = z108.enum([
|
|
18556
18767
|
"standard",
|
|
18557
18768
|
"schottky",
|
|
18558
18769
|
"zener",
|
|
@@ -18563,12 +18774,12 @@ var diodeVariant = z105.enum([
|
|
|
18563
18774
|
var diodeProps = commonComponentProps.extend({
|
|
18564
18775
|
connections: connectionsProp2.optional(),
|
|
18565
18776
|
variant: diodeVariant.optional().default("standard"),
|
|
18566
|
-
standard:
|
|
18567
|
-
schottky:
|
|
18568
|
-
zener:
|
|
18569
|
-
avalanche:
|
|
18570
|
-
photo:
|
|
18571
|
-
tvs:
|
|
18777
|
+
standard: z108.boolean().optional(),
|
|
18778
|
+
schottky: z108.boolean().optional(),
|
|
18779
|
+
zener: z108.boolean().optional(),
|
|
18780
|
+
avalanche: z108.boolean().optional(),
|
|
18781
|
+
photo: z108.boolean().optional(),
|
|
18782
|
+
tvs: z108.boolean().optional(),
|
|
18572
18783
|
schOrientation: schematicOrientation.optional(),
|
|
18573
18784
|
schSize: schematicSymbolSize.optional(),
|
|
18574
18785
|
pinLabels: diodePinLabelsProp.optional()
|
|
@@ -18583,11 +18794,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18583
18794
|
].filter(Boolean).length;
|
|
18584
18795
|
if (enabledFlags > 1) {
|
|
18585
18796
|
ctx.addIssue({
|
|
18586
|
-
code:
|
|
18797
|
+
code: z108.ZodIssueCode.custom,
|
|
18587
18798
|
message: "Exactly one diode variant must be enabled",
|
|
18588
18799
|
path: []
|
|
18589
18800
|
});
|
|
18590
|
-
return
|
|
18801
|
+
return z108.INVALID;
|
|
18591
18802
|
}
|
|
18592
18803
|
}).transform((data) => {
|
|
18593
18804
|
const result = {
|
|
@@ -18633,18 +18844,18 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18633
18844
|
expectTypesMatch(true);
|
|
18634
18845
|
|
|
18635
18846
|
// lib/components/led.ts
|
|
18636
|
-
import { z as
|
|
18637
|
-
var legacyNumericLedPinLabelsProp =
|
|
18638
|
-
|
|
18639
|
-
schematicPinLabel.or(
|
|
18847
|
+
import { z as z109 } from "zod";
|
|
18848
|
+
var legacyNumericLedPinLabelsProp = z109.record(
|
|
18849
|
+
z109.enum(["1", "2"]),
|
|
18850
|
+
schematicPinLabel.or(z109.array(schematicPinLabel).readonly()).or(z109.array(schematicPinLabel))
|
|
18640
18851
|
).transform((pinLabels) => ({
|
|
18641
18852
|
...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
|
|
18642
18853
|
...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
|
|
18643
18854
|
}));
|
|
18644
18855
|
var ledProps = commonComponentProps.extend({
|
|
18645
|
-
color:
|
|
18646
|
-
wavelength:
|
|
18647
|
-
schDisplayValue:
|
|
18856
|
+
color: z109.string().optional(),
|
|
18857
|
+
wavelength: z109.string().optional(),
|
|
18858
|
+
schDisplayValue: z109.string().optional(),
|
|
18648
18859
|
schOrientation: schematicOrientation.optional(),
|
|
18649
18860
|
/** Select a compact schematic symbol; omitted, default, and md retain the standard symbol. */
|
|
18650
18861
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -18652,28 +18863,28 @@ var ledProps = commonComponentProps.extend({
|
|
|
18652
18863
|
// wrappers, then normalized to the canonical pin1/pin2 representation.
|
|
18653
18864
|
pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
|
|
18654
18865
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
18655
|
-
laser:
|
|
18866
|
+
laser: z109.boolean().optional()
|
|
18656
18867
|
});
|
|
18657
18868
|
var ledPins = lrPolarPins;
|
|
18658
18869
|
|
|
18659
18870
|
// lib/components/switch.ts
|
|
18660
18871
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
18661
|
-
import { z as
|
|
18872
|
+
import { z as z110 } from "zod";
|
|
18662
18873
|
var switchProps = commonComponentProps.extend({
|
|
18663
|
-
type:
|
|
18664
|
-
isNormallyClosed:
|
|
18665
|
-
spst:
|
|
18666
|
-
spdt:
|
|
18667
|
-
dpst:
|
|
18668
|
-
dpdt:
|
|
18874
|
+
type: z110.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18875
|
+
isNormallyClosed: z110.boolean().optional().default(false),
|
|
18876
|
+
spst: z110.boolean().optional(),
|
|
18877
|
+
spdt: z110.boolean().optional(),
|
|
18878
|
+
dpst: z110.boolean().optional(),
|
|
18879
|
+
dpdt: z110.boolean().optional(),
|
|
18669
18880
|
pinLabels: pinLabelsProp.optional(),
|
|
18670
18881
|
noConnect: noConnectProp.optional(),
|
|
18671
18882
|
simSwitchFrequency: frequency4.optional(),
|
|
18672
18883
|
simCloseAt: ms3.optional(),
|
|
18673
18884
|
simOpenAt: ms3.optional(),
|
|
18674
|
-
simStartClosed:
|
|
18675
|
-
simStartOpen:
|
|
18676
|
-
connections:
|
|
18885
|
+
simStartClosed: z110.boolean().optional(),
|
|
18886
|
+
simStartOpen: z110.boolean().optional(),
|
|
18887
|
+
connections: z110.custom().pipe(z110.record(z110.string(), connectionTarget)).optional()
|
|
18677
18888
|
}).transform((props) => {
|
|
18678
18889
|
const updatedProps = { ...props };
|
|
18679
18890
|
if (updatedProps.dpdt) {
|
|
@@ -18705,33 +18916,33 @@ expectTypesMatch(true);
|
|
|
18705
18916
|
|
|
18706
18917
|
// lib/components/fabrication-note-text.ts
|
|
18707
18918
|
import { length as length4 } from "circuit-json";
|
|
18708
|
-
import { z as
|
|
18919
|
+
import { z as z111 } from "zod";
|
|
18709
18920
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18710
|
-
text:
|
|
18711
|
-
anchorAlignment:
|
|
18712
|
-
font:
|
|
18921
|
+
text: z111.string(),
|
|
18922
|
+
anchorAlignment: z111.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18923
|
+
font: z111.enum(["tscircuit2024"]).optional(),
|
|
18713
18924
|
fontSize: length4.optional(),
|
|
18714
|
-
color:
|
|
18925
|
+
color: z111.string().optional()
|
|
18715
18926
|
});
|
|
18716
18927
|
expectTypesMatch(true);
|
|
18717
18928
|
|
|
18718
18929
|
// lib/components/fabrication-note-rect.ts
|
|
18719
|
-
import { distance as
|
|
18720
|
-
import { z as
|
|
18930
|
+
import { distance as distance25 } from "circuit-json";
|
|
18931
|
+
import { z as z112 } from "zod";
|
|
18721
18932
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18722
|
-
width:
|
|
18723
|
-
height:
|
|
18724
|
-
strokeWidth:
|
|
18725
|
-
isFilled:
|
|
18726
|
-
hasStroke:
|
|
18727
|
-
isStrokeDashed:
|
|
18728
|
-
color:
|
|
18729
|
-
cornerRadius:
|
|
18933
|
+
width: distance25,
|
|
18934
|
+
height: distance25,
|
|
18935
|
+
strokeWidth: distance25.optional(),
|
|
18936
|
+
isFilled: z112.boolean().optional(),
|
|
18937
|
+
hasStroke: z112.boolean().optional(),
|
|
18938
|
+
isStrokeDashed: z112.boolean().optional(),
|
|
18939
|
+
color: z112.string().optional(),
|
|
18940
|
+
cornerRadius: distance25.optional()
|
|
18730
18941
|
});
|
|
18731
18942
|
|
|
18732
18943
|
// lib/components/fabrication-note-path.ts
|
|
18733
18944
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18734
|
-
import { z as
|
|
18945
|
+
import { z as z113 } from "zod";
|
|
18735
18946
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18736
18947
|
pcbLeftEdgeX: true,
|
|
18737
18948
|
pcbRightEdgeX: true,
|
|
@@ -18743,15 +18954,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18743
18954
|
pcbOffsetY: true,
|
|
18744
18955
|
pcbRotation: true
|
|
18745
18956
|
}).extend({
|
|
18746
|
-
route:
|
|
18957
|
+
route: z113.array(route_hint_point3),
|
|
18747
18958
|
strokeWidth: length5.optional(),
|
|
18748
|
-
color:
|
|
18959
|
+
color: z113.string().optional()
|
|
18749
18960
|
});
|
|
18750
18961
|
|
|
18751
18962
|
// lib/components/fabrication-note-dimension.ts
|
|
18752
|
-
import { distance as
|
|
18753
|
-
import { z as
|
|
18754
|
-
var dimensionTarget =
|
|
18963
|
+
import { distance as distance26, length as length6 } from "circuit-json";
|
|
18964
|
+
import { z as z114 } from "zod";
|
|
18965
|
+
var dimensionTarget = z114.union([z114.string(), point]);
|
|
18755
18966
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18756
18967
|
pcbLeftEdgeX: true,
|
|
18757
18968
|
pcbRightEdgeX: true,
|
|
@@ -18765,44 +18976,44 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18765
18976
|
}).extend({
|
|
18766
18977
|
from: dimensionTarget,
|
|
18767
18978
|
to: dimensionTarget,
|
|
18768
|
-
text:
|
|
18769
|
-
offset:
|
|
18770
|
-
offsetDirection:
|
|
18771
|
-
font:
|
|
18979
|
+
text: z114.string().optional(),
|
|
18980
|
+
offset: distance26.optional(),
|
|
18981
|
+
offsetDirection: z114.object({ x: z114.number().finite(), y: z114.number().finite() }).optional(),
|
|
18982
|
+
font: z114.enum(["tscircuit2024"]).optional(),
|
|
18772
18983
|
fontSize: length6.optional(),
|
|
18773
|
-
color:
|
|
18774
|
-
arrowSize:
|
|
18775
|
-
units:
|
|
18776
|
-
outerEdgeToEdge:
|
|
18777
|
-
centerToCenter:
|
|
18778
|
-
innerEdgeToEdge:
|
|
18984
|
+
color: z114.string().optional(),
|
|
18985
|
+
arrowSize: distance26.optional(),
|
|
18986
|
+
units: z114.enum(["in", "mm"]).optional(),
|
|
18987
|
+
outerEdgeToEdge: z114.literal(true).optional(),
|
|
18988
|
+
centerToCenter: z114.literal(true).optional(),
|
|
18989
|
+
innerEdgeToEdge: z114.literal(true).optional()
|
|
18779
18990
|
});
|
|
18780
18991
|
expectTypesMatch(true);
|
|
18781
18992
|
|
|
18782
18993
|
// lib/components/pcb-trace.ts
|
|
18783
|
-
import { distance as
|
|
18784
|
-
import { z as
|
|
18785
|
-
var pcbTraceProps =
|
|
18786
|
-
layer:
|
|
18787
|
-
thickness:
|
|
18788
|
-
route:
|
|
18994
|
+
import { distance as distance27, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18995
|
+
import { z as z115 } from "zod";
|
|
18996
|
+
var pcbTraceProps = z115.object({
|
|
18997
|
+
layer: z115.string().optional(),
|
|
18998
|
+
thickness: distance27.optional(),
|
|
18999
|
+
route: z115.array(route_hint_point4)
|
|
18789
19000
|
});
|
|
18790
19001
|
|
|
18791
19002
|
// lib/components/via.ts
|
|
18792
|
-
import { distance as
|
|
18793
|
-
import { z as
|
|
19003
|
+
import { distance as distance28, layer_ref as layer_ref9 } from "circuit-json";
|
|
19004
|
+
import { z as z116 } from "zod";
|
|
18794
19005
|
var viaProps = commonLayoutProps.extend({
|
|
18795
|
-
name:
|
|
19006
|
+
name: z116.string().optional(),
|
|
18796
19007
|
fromLayer: layer_ref9.optional(),
|
|
18797
19008
|
toLayer: layer_ref9.optional(),
|
|
18798
|
-
holeDiameter:
|
|
18799
|
-
outerDiameter:
|
|
18800
|
-
layers:
|
|
18801
|
-
connectsTo:
|
|
18802
|
-
netIsAssignable:
|
|
18803
|
-
tented:
|
|
18804
|
-
|
|
18805
|
-
|
|
19009
|
+
holeDiameter: distance28.optional(),
|
|
19010
|
+
outerDiameter: distance28.optional(),
|
|
19011
|
+
layers: z116.array(layer_ref9).optional(),
|
|
19012
|
+
connectsTo: z116.string().or(z116.array(z116.string())).optional(),
|
|
19013
|
+
netIsAssignable: z116.boolean().optional(),
|
|
19014
|
+
tented: z116.union([
|
|
19015
|
+
z116.boolean(),
|
|
19016
|
+
z116.enum([
|
|
18806
19017
|
"both_sides",
|
|
18807
19018
|
"top_and_bottom_tented",
|
|
18808
19019
|
"top_tented",
|
|
@@ -18820,20 +19031,20 @@ var viaProps = commonLayoutProps.extend({
|
|
|
18820
19031
|
expectTypesMatch(true);
|
|
18821
19032
|
|
|
18822
19033
|
// lib/components/testpoint.ts
|
|
18823
|
-
import { distance as
|
|
18824
|
-
import { z as
|
|
19034
|
+
import { distance as distance29 } from "circuit-json";
|
|
19035
|
+
import { z as z117 } from "zod";
|
|
18825
19036
|
var testpointPins = ["pin1"];
|
|
18826
|
-
var testpointConnectionsProp =
|
|
19037
|
+
var testpointConnectionsProp = z117.object({
|
|
18827
19038
|
pin1: connectionTarget
|
|
18828
19039
|
}).strict();
|
|
18829
19040
|
var testpointProps = commonComponentProps.extend({
|
|
18830
19041
|
connections: testpointConnectionsProp.optional(),
|
|
18831
|
-
footprintVariant:
|
|
18832
|
-
padShape:
|
|
18833
|
-
padDiameter:
|
|
18834
|
-
holeDiameter:
|
|
18835
|
-
width:
|
|
18836
|
-
height:
|
|
19042
|
+
footprintVariant: z117.enum(["pad", "through_hole"]).optional(),
|
|
19043
|
+
padShape: z117.enum(["rect", "circle"]).optional().default("circle"),
|
|
19044
|
+
padDiameter: distance29.optional(),
|
|
19045
|
+
holeDiameter: distance29.optional(),
|
|
19046
|
+
width: distance29.optional(),
|
|
19047
|
+
height: distance29.optional()
|
|
18837
19048
|
}).refine(
|
|
18838
19049
|
(props) => props.footprintVariant !== "through_hole" || props.holeDiameter !== void 0,
|
|
18839
19050
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
@@ -18841,63 +19052,63 @@ var testpointProps = commonComponentProps.extend({
|
|
|
18841
19052
|
expectTypesMatch(true);
|
|
18842
19053
|
|
|
18843
19054
|
// lib/components/breakoutpoint.ts
|
|
18844
|
-
import { z as
|
|
19055
|
+
import { z as z118 } from "zod";
|
|
18845
19056
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
18846
|
-
connection:
|
|
19057
|
+
connection: z118.string()
|
|
18847
19058
|
});
|
|
18848
19059
|
expectTypesMatch(true);
|
|
18849
19060
|
|
|
18850
19061
|
// lib/components/pcb-keepout.ts
|
|
18851
|
-
import { distance as
|
|
18852
|
-
import { z as
|
|
18853
|
-
var pcbKeepoutProps =
|
|
19062
|
+
import { distance as distance30, layer_ref as layer_ref10 } from "circuit-json";
|
|
19063
|
+
import { z as z119 } from "zod";
|
|
19064
|
+
var pcbKeepoutProps = z119.union([
|
|
18854
19065
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18855
|
-
shape:
|
|
18856
|
-
radius:
|
|
18857
|
-
layers:
|
|
19066
|
+
shape: z119.literal("circle"),
|
|
19067
|
+
radius: distance30,
|
|
19068
|
+
layers: z119.array(layer_ref10).optional(),
|
|
18858
19069
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
18859
|
-
warningOnly:
|
|
19070
|
+
warningOnly: z119.boolean().optional(),
|
|
18860
19071
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18861
|
-
allowTraces:
|
|
19072
|
+
allowTraces: z119.boolean().optional(),
|
|
18862
19073
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18863
|
-
allowPlacements:
|
|
18864
|
-
excludeRefs:
|
|
19074
|
+
allowPlacements: z119.boolean().optional(),
|
|
19075
|
+
excludeRefs: z119.array(z119.string()).optional().describe(
|
|
18865
19076
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
18866
19077
|
)
|
|
18867
19078
|
}),
|
|
18868
19079
|
pcbLayoutProps.extend({
|
|
18869
|
-
shape:
|
|
18870
|
-
width:
|
|
18871
|
-
height:
|
|
18872
|
-
layers:
|
|
19080
|
+
shape: z119.literal("rect"),
|
|
19081
|
+
width: distance30,
|
|
19082
|
+
height: distance30,
|
|
19083
|
+
layers: z119.array(layer_ref10).optional(),
|
|
18873
19084
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
18874
|
-
warningOnly:
|
|
19085
|
+
warningOnly: z119.boolean().optional(),
|
|
18875
19086
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18876
|
-
allowTraces:
|
|
19087
|
+
allowTraces: z119.boolean().optional(),
|
|
18877
19088
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
18878
|
-
allowPlacements:
|
|
18879
|
-
excludeRefs:
|
|
19089
|
+
allowPlacements: z119.boolean().optional(),
|
|
19090
|
+
excludeRefs: z119.array(z119.string()).optional().describe(
|
|
18880
19091
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
18881
19092
|
)
|
|
18882
19093
|
})
|
|
18883
19094
|
]);
|
|
18884
19095
|
|
|
18885
19096
|
// lib/components/courtyard-rect.ts
|
|
18886
|
-
import { distance as
|
|
18887
|
-
import { z as
|
|
19097
|
+
import { distance as distance31 } from "circuit-json";
|
|
19098
|
+
import { z as z120 } from "zod";
|
|
18888
19099
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
18889
|
-
width:
|
|
18890
|
-
height:
|
|
18891
|
-
strokeWidth:
|
|
18892
|
-
isFilled:
|
|
18893
|
-
hasStroke:
|
|
18894
|
-
isStrokeDashed:
|
|
18895
|
-
color:
|
|
19100
|
+
width: distance31,
|
|
19101
|
+
height: distance31,
|
|
19102
|
+
strokeWidth: distance31.optional(),
|
|
19103
|
+
isFilled: z120.boolean().optional(),
|
|
19104
|
+
hasStroke: z120.boolean().optional(),
|
|
19105
|
+
isStrokeDashed: z120.boolean().optional(),
|
|
19106
|
+
color: z120.string().optional()
|
|
18896
19107
|
});
|
|
18897
19108
|
|
|
18898
19109
|
// lib/components/courtyard-outline.ts
|
|
18899
19110
|
import { length as length7 } from "circuit-json";
|
|
18900
|
-
import { z as
|
|
19111
|
+
import { z as z121 } from "zod";
|
|
18901
19112
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
18902
19113
|
pcbLeftEdgeX: true,
|
|
18903
19114
|
pcbRightEdgeX: true,
|
|
@@ -18909,40 +19120,40 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
18909
19120
|
pcbOffsetY: true,
|
|
18910
19121
|
pcbRotation: true
|
|
18911
19122
|
}).extend({
|
|
18912
|
-
outline:
|
|
19123
|
+
outline: z121.array(point),
|
|
18913
19124
|
strokeWidth: length7.optional(),
|
|
18914
|
-
isClosed:
|
|
18915
|
-
isStrokeDashed:
|
|
18916
|
-
color:
|
|
19125
|
+
isClosed: z121.boolean().optional(),
|
|
19126
|
+
isStrokeDashed: z121.boolean().optional(),
|
|
19127
|
+
color: z121.string().optional()
|
|
18917
19128
|
});
|
|
18918
19129
|
|
|
18919
19130
|
// lib/components/courtyard-circle.ts
|
|
18920
|
-
import { distance as
|
|
19131
|
+
import { distance as distance32 } from "circuit-json";
|
|
18921
19132
|
import "zod";
|
|
18922
19133
|
var courtyardCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18923
|
-
radius:
|
|
19134
|
+
radius: distance32
|
|
18924
19135
|
});
|
|
18925
19136
|
|
|
18926
19137
|
// lib/components/courtyard-pill.ts
|
|
18927
|
-
import { distance as
|
|
19138
|
+
import { distance as distance33 } from "circuit-json";
|
|
18928
19139
|
import "zod";
|
|
18929
19140
|
var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18930
|
-
width:
|
|
18931
|
-
height:
|
|
18932
|
-
radius:
|
|
19141
|
+
width: distance33,
|
|
19142
|
+
height: distance33,
|
|
19143
|
+
radius: distance33
|
|
18933
19144
|
});
|
|
18934
19145
|
|
|
18935
19146
|
// lib/components/copper-pour.ts
|
|
18936
|
-
import { z as
|
|
19147
|
+
import { z as z124 } from "zod";
|
|
18937
19148
|
import { layer_ref as layer_ref11 } from "circuit-json";
|
|
18938
|
-
var copperPourProps =
|
|
18939
|
-
name:
|
|
19149
|
+
var copperPourProps = z124.object({
|
|
19150
|
+
name: z124.string().optional(),
|
|
18940
19151
|
layer: layer_ref11,
|
|
18941
|
-
connectsTo:
|
|
18942
|
-
crosshatch:
|
|
18943
|
-
crosshatchPitch: distance.pipe(
|
|
18944
|
-
crosshatchWidth: distance.pipe(
|
|
18945
|
-
unbroken:
|
|
19152
|
+
connectsTo: z124.string(),
|
|
19153
|
+
crosshatch: z124.boolean().optional(),
|
|
19154
|
+
crosshatchPitch: distance.pipe(z124.number().finite().positive()).optional(),
|
|
19155
|
+
crosshatchWidth: distance.pipe(z124.number().finite().positive()).optional(),
|
|
19156
|
+
unbroken: z124.boolean().optional().describe(
|
|
18946
19157
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
18947
19158
|
),
|
|
18948
19159
|
padMargin: distance.optional(),
|
|
@@ -18950,13 +19161,13 @@ var copperPourProps = z121.object({
|
|
|
18950
19161
|
clearance: distance.optional(),
|
|
18951
19162
|
boardEdgeMargin: distance.optional(),
|
|
18952
19163
|
cutoutMargin: distance.optional(),
|
|
18953
|
-
useThermalReliefs:
|
|
18954
|
-
outline:
|
|
18955
|
-
coveredWithSolderMask:
|
|
19164
|
+
useThermalReliefs: z124.boolean().optional(),
|
|
19165
|
+
outline: z124.array(point).optional(),
|
|
19166
|
+
coveredWithSolderMask: z124.boolean().optional().default(true)
|
|
18956
19167
|
}).superRefine((props, ctx) => {
|
|
18957
19168
|
if (props.crosshatch && (props.crosshatchWidth ?? 0.25) >= (props.crosshatchPitch ?? 1)) {
|
|
18958
19169
|
ctx.addIssue({
|
|
18959
|
-
code:
|
|
19170
|
+
code: z124.ZodIssueCode.custom,
|
|
18960
19171
|
path: ["crosshatchWidth"],
|
|
18961
19172
|
message: "crosshatchWidth must be less than crosshatchPitch"
|
|
18962
19173
|
});
|
|
@@ -18966,16 +19177,16 @@ expectTypesMatch(true);
|
|
|
18966
19177
|
|
|
18967
19178
|
// lib/components/cadassembly.ts
|
|
18968
19179
|
import { layer_ref as layer_ref12 } from "circuit-json";
|
|
18969
|
-
import { z as
|
|
18970
|
-
var cadassemblyProps =
|
|
19180
|
+
import { z as z125 } from "zod";
|
|
19181
|
+
var cadassemblyProps = z125.object({
|
|
18971
19182
|
originalLayer: layer_ref12.default("top").optional(),
|
|
18972
|
-
children:
|
|
19183
|
+
children: z125.any().optional()
|
|
18973
19184
|
});
|
|
18974
19185
|
expectTypesMatch(true);
|
|
18975
19186
|
|
|
18976
19187
|
// lib/components/cadmodel.ts
|
|
18977
|
-
import { z as
|
|
18978
|
-
var pcbPosition =
|
|
19188
|
+
import { z as z126 } from "zod";
|
|
19189
|
+
var pcbPosition = z126.object({
|
|
18979
19190
|
pcbX: pcbCoordinate.optional(),
|
|
18980
19191
|
pcbY: pcbCoordinate.optional(),
|
|
18981
19192
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -18992,7 +19203,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
18992
19203
|
});
|
|
18993
19204
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
18994
19205
|
expectTypesMatch(true);
|
|
18995
|
-
var cadmodelProps =
|
|
19206
|
+
var cadmodelProps = z126.union([z126.null(), url, cadModelObject]);
|
|
18996
19207
|
|
|
18997
19208
|
// lib/components/power-source.ts
|
|
18998
19209
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -19002,9 +19213,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
19002
19213
|
|
|
19003
19214
|
// lib/components/voltagesource.ts
|
|
19004
19215
|
import { frequency as frequency5, ms as ms4, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
19005
|
-
import { z as
|
|
19216
|
+
import { z as z127 } from "zod";
|
|
19006
19217
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19007
|
-
var percentage =
|
|
19218
|
+
var percentage = z127.union([z127.string(), z127.number()]).transform((val) => {
|
|
19008
19219
|
if (typeof val === "string") {
|
|
19009
19220
|
if (val.endsWith("%")) {
|
|
19010
19221
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19013,13 +19224,13 @@ var percentage = z124.union([z124.string(), z124.number()]).transform((val) => {
|
|
|
19013
19224
|
}
|
|
19014
19225
|
return val;
|
|
19015
19226
|
}).pipe(
|
|
19016
|
-
|
|
19227
|
+
z127.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19017
19228
|
);
|
|
19018
19229
|
var voltageSourceProps = commonComponentProps.extend({
|
|
19019
19230
|
voltage: voltage6.optional(),
|
|
19020
19231
|
frequency: frequency5.optional(),
|
|
19021
19232
|
peakToPeakVoltage: voltage6.optional(),
|
|
19022
|
-
waveShape:
|
|
19233
|
+
waveShape: z127.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19023
19234
|
phase: rotation6.optional(),
|
|
19024
19235
|
dutyCycle: percentage.optional(),
|
|
19025
19236
|
pulseDelay: ms4.optional(),
|
|
@@ -19036,9 +19247,9 @@ expectTypesMatch(true);
|
|
|
19036
19247
|
|
|
19037
19248
|
// lib/components/currentsource.ts
|
|
19038
19249
|
import { frequency as frequency6, rotation as rotation7, current as current3 } from "circuit-json";
|
|
19039
|
-
import { z as
|
|
19250
|
+
import { z as z128 } from "zod";
|
|
19040
19251
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19041
|
-
var percentage2 =
|
|
19252
|
+
var percentage2 = z128.union([z128.string(), z128.number()]).transform((val) => {
|
|
19042
19253
|
if (typeof val === "string") {
|
|
19043
19254
|
if (val.endsWith("%")) {
|
|
19044
19255
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19047,13 +19258,13 @@ var percentage2 = z125.union([z125.string(), z125.number()]).transform((val) =>
|
|
|
19047
19258
|
}
|
|
19048
19259
|
return val;
|
|
19049
19260
|
}).pipe(
|
|
19050
|
-
|
|
19261
|
+
z128.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19051
19262
|
);
|
|
19052
19263
|
var currentSourceProps = commonComponentProps.extend({
|
|
19053
19264
|
current: current3.optional(),
|
|
19054
19265
|
frequency: frequency6.optional(),
|
|
19055
19266
|
peakToPeakCurrent: current3.optional(),
|
|
19056
|
-
waveShape:
|
|
19267
|
+
waveShape: z128.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19057
19268
|
phase: rotation7.optional(),
|
|
19058
19269
|
dutyCycle: percentage2.optional(),
|
|
19059
19270
|
acMagnitude: current3.optional(),
|
|
@@ -19064,21 +19275,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
19064
19275
|
expectTypesMatch(true);
|
|
19065
19276
|
|
|
19066
19277
|
// lib/components/voltageprobe.ts
|
|
19067
|
-
import { z as
|
|
19278
|
+
import { z as z129 } from "zod";
|
|
19068
19279
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
19069
|
-
name:
|
|
19070
|
-
connectsTo:
|
|
19071
|
-
referenceTo:
|
|
19072
|
-
color:
|
|
19073
|
-
graphDisplayName:
|
|
19074
|
-
graphCenter:
|
|
19075
|
-
graphVerticalOffset:
|
|
19076
|
-
graphVoltagePerDiv:
|
|
19280
|
+
name: z129.string().optional(),
|
|
19281
|
+
connectsTo: z129.string(),
|
|
19282
|
+
referenceTo: z129.string().optional(),
|
|
19283
|
+
color: z129.string().optional(),
|
|
19284
|
+
graphDisplayName: z129.string().optional(),
|
|
19285
|
+
graphCenter: z129.number().optional(),
|
|
19286
|
+
graphVerticalOffset: z129.number().or(z129.string()).optional(),
|
|
19287
|
+
graphVoltagePerDiv: z129.number().or(z129.string()).optional()
|
|
19077
19288
|
});
|
|
19078
19289
|
expectTypesMatch(true);
|
|
19079
19290
|
|
|
19080
19291
|
// lib/components/ammeter.ts
|
|
19081
|
-
import { z as
|
|
19292
|
+
import { z as z130 } from "zod";
|
|
19082
19293
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19083
19294
|
var hasAmmeterConnectionPair = (connections) => {
|
|
19084
19295
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -19088,64 +19299,64 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
19088
19299
|
hasAmmeterConnectionPair,
|
|
19089
19300
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
19090
19301
|
),
|
|
19091
|
-
color:
|
|
19092
|
-
graphDisplayName:
|
|
19093
|
-
graphCenter:
|
|
19094
|
-
graphVerticalOffset:
|
|
19095
|
-
graphCurrentPerDiv:
|
|
19302
|
+
color: z130.string().optional(),
|
|
19303
|
+
graphDisplayName: z130.string().optional(),
|
|
19304
|
+
graphCenter: z130.number().optional(),
|
|
19305
|
+
graphVerticalOffset: z130.number().or(z130.string()).optional(),
|
|
19306
|
+
graphCurrentPerDiv: z130.number().or(z130.string()).optional()
|
|
19096
19307
|
});
|
|
19097
19308
|
var ammeterPins = ammeterPinLabels;
|
|
19098
19309
|
expectTypesMatch(true);
|
|
19099
19310
|
|
|
19100
19311
|
// lib/components/schematic-arc.ts
|
|
19101
|
-
import { distance as
|
|
19102
|
-
import { z as
|
|
19103
|
-
var schematicArcProps =
|
|
19312
|
+
import { distance as distance34, point as point5, rotation as rotation8 } from "circuit-json";
|
|
19313
|
+
import { z as z131 } from "zod";
|
|
19314
|
+
var schematicArcProps = z131.object({
|
|
19104
19315
|
center: point5,
|
|
19105
|
-
radius:
|
|
19316
|
+
radius: distance34,
|
|
19106
19317
|
startAngleDegrees: rotation8,
|
|
19107
19318
|
endAngleDegrees: rotation8,
|
|
19108
|
-
direction:
|
|
19109
|
-
strokeWidth:
|
|
19110
|
-
color:
|
|
19111
|
-
isDashed:
|
|
19319
|
+
direction: z131.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
19320
|
+
strokeWidth: distance34.optional(),
|
|
19321
|
+
color: z131.string().optional(),
|
|
19322
|
+
isDashed: z131.boolean().optional().default(false)
|
|
19112
19323
|
});
|
|
19113
19324
|
expectTypesMatch(true);
|
|
19114
19325
|
|
|
19115
19326
|
// lib/components/toolingrail.ts
|
|
19116
|
-
import { z as
|
|
19117
|
-
var toolingrailProps =
|
|
19118
|
-
children:
|
|
19327
|
+
import { z as z132 } from "zod";
|
|
19328
|
+
var toolingrailProps = z132.object({
|
|
19329
|
+
children: z132.any().optional()
|
|
19119
19330
|
});
|
|
19120
19331
|
expectTypesMatch(true);
|
|
19121
19332
|
|
|
19122
19333
|
// lib/components/schematic-box.ts
|
|
19123
|
-
import { distance as
|
|
19124
|
-
import { z as
|
|
19125
|
-
var schematicBoxProps =
|
|
19126
|
-
name:
|
|
19127
|
-
chipRef:
|
|
19334
|
+
import { distance as distance35 } from "circuit-json";
|
|
19335
|
+
import { z as z133 } from "zod";
|
|
19336
|
+
var schematicBoxProps = z133.object({
|
|
19337
|
+
name: z133.string().optional(),
|
|
19338
|
+
chipRef: z133.string().optional(),
|
|
19128
19339
|
pinLabels: pinLabelsProp.optional(),
|
|
19129
19340
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
19130
19341
|
schPinStyle: schematicPinStyle.optional(),
|
|
19131
|
-
schX:
|
|
19132
|
-
schY:
|
|
19133
|
-
schSectionName:
|
|
19134
|
-
schSheetName:
|
|
19135
|
-
width:
|
|
19136
|
-
height:
|
|
19137
|
-
overlay:
|
|
19138
|
-
padding:
|
|
19139
|
-
paddingLeft:
|
|
19140
|
-
paddingRight:
|
|
19141
|
-
paddingTop:
|
|
19142
|
-
paddingBottom:
|
|
19143
|
-
title:
|
|
19342
|
+
schX: distance35.optional(),
|
|
19343
|
+
schY: distance35.optional(),
|
|
19344
|
+
schSectionName: z133.string().optional(),
|
|
19345
|
+
schSheetName: z133.string().optional(),
|
|
19346
|
+
width: distance35.optional(),
|
|
19347
|
+
height: distance35.optional(),
|
|
19348
|
+
overlay: z133.array(z133.string()).optional(),
|
|
19349
|
+
padding: distance35.optional(),
|
|
19350
|
+
paddingLeft: distance35.optional(),
|
|
19351
|
+
paddingRight: distance35.optional(),
|
|
19352
|
+
paddingTop: distance35.optional(),
|
|
19353
|
+
paddingBottom: distance35.optional(),
|
|
19354
|
+
title: z133.string().optional(),
|
|
19144
19355
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
19145
|
-
titleColor:
|
|
19146
|
-
titleFontSize:
|
|
19147
|
-
titleInside:
|
|
19148
|
-
strokeStyle:
|
|
19356
|
+
titleColor: z133.string().optional(),
|
|
19357
|
+
titleFontSize: distance35.optional(),
|
|
19358
|
+
titleInside: z133.boolean().default(false),
|
|
19359
|
+
strokeStyle: z133.enum(["solid", "dashed"]).default("solid")
|
|
19149
19360
|
}).refine(
|
|
19150
19361
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
19151
19362
|
{
|
|
@@ -19161,82 +19372,82 @@ expectTypesMatch(true);
|
|
|
19161
19372
|
|
|
19162
19373
|
// lib/components/schematic-symbol.ts
|
|
19163
19374
|
import { rotation as rotation9 } from "circuit-json";
|
|
19164
|
-
import { z as
|
|
19165
|
-
var schematicSymbolConnections =
|
|
19375
|
+
import { z as z134 } from "zod";
|
|
19376
|
+
var schematicSymbolConnections = z134.custom().pipe(z134.record(z134.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
19166
19377
|
message: "connections must map at least one schematic symbol port"
|
|
19167
19378
|
});
|
|
19168
|
-
var schematicSymbolProps =
|
|
19169
|
-
name:
|
|
19170
|
-
displayName:
|
|
19171
|
-
chipRef:
|
|
19172
|
-
symbolName:
|
|
19379
|
+
var schematicSymbolProps = z134.object({
|
|
19380
|
+
name: z134.string().min(1),
|
|
19381
|
+
displayName: z134.string().optional(),
|
|
19382
|
+
chipRef: z134.string().min(1).optional(),
|
|
19383
|
+
symbolName: z134.string().min(1),
|
|
19173
19384
|
connections: schematicSymbolConnections.optional(),
|
|
19174
19385
|
schX: distance.optional(),
|
|
19175
19386
|
schY: distance.optional(),
|
|
19176
19387
|
schRotation: rotation9.optional(),
|
|
19177
|
-
schSectionName:
|
|
19178
|
-
schSheetName:
|
|
19388
|
+
schSectionName: z134.string().optional(),
|
|
19389
|
+
schSheetName: z134.string().optional()
|
|
19179
19390
|
});
|
|
19180
19391
|
expectTypesMatch(
|
|
19181
19392
|
true
|
|
19182
19393
|
);
|
|
19183
19394
|
|
|
19184
19395
|
// lib/components/schematic-circle.ts
|
|
19185
|
-
import { distance as
|
|
19186
|
-
import { z as
|
|
19187
|
-
var schematicCircleProps =
|
|
19396
|
+
import { distance as distance36, point as point6 } from "circuit-json";
|
|
19397
|
+
import { z as z135 } from "zod";
|
|
19398
|
+
var schematicCircleProps = z135.object({
|
|
19188
19399
|
center: point6,
|
|
19189
|
-
radius:
|
|
19190
|
-
strokeWidth:
|
|
19191
|
-
color:
|
|
19192
|
-
isFilled:
|
|
19193
|
-
fillColor:
|
|
19194
|
-
isDashed:
|
|
19400
|
+
radius: distance36,
|
|
19401
|
+
strokeWidth: distance36.optional(),
|
|
19402
|
+
color: z135.string().optional(),
|
|
19403
|
+
isFilled: z135.boolean().optional().default(false),
|
|
19404
|
+
fillColor: z135.string().optional(),
|
|
19405
|
+
isDashed: z135.boolean().optional().default(false)
|
|
19195
19406
|
});
|
|
19196
19407
|
expectTypesMatch(
|
|
19197
19408
|
true
|
|
19198
19409
|
);
|
|
19199
19410
|
|
|
19200
19411
|
// lib/components/schematic-rect.ts
|
|
19201
|
-
import { distance as
|
|
19202
|
-
import { z as
|
|
19203
|
-
var schematicRectProps =
|
|
19204
|
-
schX:
|
|
19205
|
-
schY:
|
|
19206
|
-
width:
|
|
19207
|
-
height:
|
|
19412
|
+
import { distance as distance37, rotation as rotation10 } from "circuit-json";
|
|
19413
|
+
import { z as z136 } from "zod";
|
|
19414
|
+
var schematicRectProps = z136.object({
|
|
19415
|
+
schX: distance37.optional(),
|
|
19416
|
+
schY: distance37.optional(),
|
|
19417
|
+
width: distance37,
|
|
19418
|
+
height: distance37,
|
|
19208
19419
|
rotation: rotation10.default(0),
|
|
19209
|
-
strokeWidth:
|
|
19210
|
-
color:
|
|
19211
|
-
isFilled:
|
|
19212
|
-
fillColor:
|
|
19213
|
-
isDashed:
|
|
19420
|
+
strokeWidth: distance37.optional(),
|
|
19421
|
+
color: z136.string().optional(),
|
|
19422
|
+
isFilled: z136.boolean().optional().default(false),
|
|
19423
|
+
fillColor: z136.string().optional(),
|
|
19424
|
+
isDashed: z136.boolean().optional().default(false)
|
|
19214
19425
|
});
|
|
19215
19426
|
expectTypesMatch(true);
|
|
19216
19427
|
|
|
19217
19428
|
// lib/components/schematic-line.ts
|
|
19218
|
-
import { distance as
|
|
19219
|
-
import { z as
|
|
19220
|
-
var schematicLineProps =
|
|
19221
|
-
x1:
|
|
19222
|
-
y1:
|
|
19223
|
-
x2:
|
|
19224
|
-
y2:
|
|
19225
|
-
strokeWidth:
|
|
19226
|
-
color:
|
|
19227
|
-
isDashed:
|
|
19228
|
-
dashLength:
|
|
19229
|
-
dashGap:
|
|
19429
|
+
import { distance as distance38 } from "circuit-json";
|
|
19430
|
+
import { z as z137 } from "zod";
|
|
19431
|
+
var schematicLineProps = z137.object({
|
|
19432
|
+
x1: distance38,
|
|
19433
|
+
y1: distance38,
|
|
19434
|
+
x2: distance38,
|
|
19435
|
+
y2: distance38,
|
|
19436
|
+
strokeWidth: distance38.optional(),
|
|
19437
|
+
color: z137.string().optional(),
|
|
19438
|
+
isDashed: z137.boolean().optional().default(false),
|
|
19439
|
+
dashLength: distance38.optional(),
|
|
19440
|
+
dashGap: distance38.optional()
|
|
19230
19441
|
});
|
|
19231
19442
|
expectTypesMatch(true);
|
|
19232
19443
|
|
|
19233
19444
|
// lib/components/schematic-text.ts
|
|
19234
|
-
import { distance as
|
|
19235
|
-
import { z as
|
|
19445
|
+
import { distance as distance39, rotation as rotation11 } from "circuit-json";
|
|
19446
|
+
import { z as z139 } from "zod";
|
|
19236
19447
|
|
|
19237
19448
|
// lib/common/fivePointAnchor.ts
|
|
19238
|
-
import { z as
|
|
19239
|
-
var fivePointAnchor =
|
|
19449
|
+
import { z as z138 } from "zod";
|
|
19450
|
+
var fivePointAnchor = z138.enum([
|
|
19240
19451
|
"center",
|
|
19241
19452
|
"left",
|
|
19242
19453
|
"right",
|
|
@@ -19245,107 +19456,107 @@ var fivePointAnchor = z135.enum([
|
|
|
19245
19456
|
]);
|
|
19246
19457
|
|
|
19247
19458
|
// lib/components/schematic-text.ts
|
|
19248
|
-
var schematicTextProps =
|
|
19249
|
-
schX:
|
|
19250
|
-
schY:
|
|
19251
|
-
text:
|
|
19252
|
-
fontSize:
|
|
19253
|
-
anchor:
|
|
19254
|
-
color:
|
|
19459
|
+
var schematicTextProps = z139.object({
|
|
19460
|
+
schX: distance39.optional(),
|
|
19461
|
+
schY: distance39.optional(),
|
|
19462
|
+
text: z139.string(),
|
|
19463
|
+
fontSize: z139.number().default(1),
|
|
19464
|
+
anchor: z139.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
19465
|
+
color: z139.string().default("#000000"),
|
|
19255
19466
|
schRotation: rotation11.default(0)
|
|
19256
19467
|
});
|
|
19257
19468
|
expectTypesMatch(true);
|
|
19258
19469
|
|
|
19259
19470
|
// lib/components/schematic-path.ts
|
|
19260
|
-
import { distance as
|
|
19261
|
-
import { z as
|
|
19262
|
-
var schematicPathProps =
|
|
19263
|
-
points:
|
|
19264
|
-
svgPath:
|
|
19265
|
-
strokeWidth:
|
|
19266
|
-
strokeColor:
|
|
19267
|
-
dashLength:
|
|
19268
|
-
dashGap:
|
|
19269
|
-
isFilled:
|
|
19270
|
-
fillColor:
|
|
19471
|
+
import { distance as distance40, point as point7 } from "circuit-json";
|
|
19472
|
+
import { z as z140 } from "zod";
|
|
19473
|
+
var schematicPathProps = z140.object({
|
|
19474
|
+
points: z140.array(point7).optional(),
|
|
19475
|
+
svgPath: z140.string().optional(),
|
|
19476
|
+
strokeWidth: distance40.optional(),
|
|
19477
|
+
strokeColor: z140.string().optional(),
|
|
19478
|
+
dashLength: distance40.optional(),
|
|
19479
|
+
dashGap: distance40.optional(),
|
|
19480
|
+
isFilled: z140.boolean().optional().default(false),
|
|
19481
|
+
fillColor: z140.string().optional()
|
|
19271
19482
|
});
|
|
19272
19483
|
expectTypesMatch(true);
|
|
19273
19484
|
|
|
19274
19485
|
// lib/components/schematic-table.ts
|
|
19275
|
-
import { distance as
|
|
19276
|
-
import { z as
|
|
19277
|
-
var schematicTableProps =
|
|
19278
|
-
schX:
|
|
19279
|
-
schY:
|
|
19280
|
-
children:
|
|
19281
|
-
cellPadding:
|
|
19282
|
-
borderWidth:
|
|
19486
|
+
import { distance as distance41 } from "circuit-json";
|
|
19487
|
+
import { z as z141 } from "zod";
|
|
19488
|
+
var schematicTableProps = z141.object({
|
|
19489
|
+
schX: distance41.optional(),
|
|
19490
|
+
schY: distance41.optional(),
|
|
19491
|
+
children: z141.any().optional(),
|
|
19492
|
+
cellPadding: distance41.optional(),
|
|
19493
|
+
borderWidth: distance41.optional(),
|
|
19283
19494
|
anchor: ninePointAnchor.optional(),
|
|
19284
|
-
fontSize:
|
|
19495
|
+
fontSize: distance41.optional()
|
|
19285
19496
|
});
|
|
19286
19497
|
expectTypesMatch(true);
|
|
19287
19498
|
|
|
19288
19499
|
// lib/components/schematic-row.ts
|
|
19289
|
-
import { distance as
|
|
19290
|
-
import { z as
|
|
19291
|
-
var schematicRowProps =
|
|
19292
|
-
children:
|
|
19293
|
-
height:
|
|
19500
|
+
import { distance as distance42 } from "circuit-json";
|
|
19501
|
+
import { z as z142 } from "zod";
|
|
19502
|
+
var schematicRowProps = z142.object({
|
|
19503
|
+
children: z142.any().optional(),
|
|
19504
|
+
height: distance42.optional()
|
|
19294
19505
|
});
|
|
19295
19506
|
expectTypesMatch(true);
|
|
19296
19507
|
|
|
19297
19508
|
// lib/components/schematic-cell.ts
|
|
19298
|
-
import { distance as
|
|
19299
|
-
import { z as
|
|
19300
|
-
var schematicCellProps =
|
|
19301
|
-
children:
|
|
19302
|
-
horizontalAlign:
|
|
19303
|
-
verticalAlign:
|
|
19304
|
-
fontSize:
|
|
19305
|
-
rowSpan:
|
|
19306
|
-
colSpan:
|
|
19307
|
-
width:
|
|
19308
|
-
text:
|
|
19509
|
+
import { distance as distance43 } from "circuit-json";
|
|
19510
|
+
import { z as z143 } from "zod";
|
|
19511
|
+
var schematicCellProps = z143.object({
|
|
19512
|
+
children: z143.string().optional(),
|
|
19513
|
+
horizontalAlign: z143.enum(["left", "center", "right"]).optional(),
|
|
19514
|
+
verticalAlign: z143.enum(["top", "middle", "bottom"]).optional(),
|
|
19515
|
+
fontSize: distance43.optional(),
|
|
19516
|
+
rowSpan: z143.number().optional(),
|
|
19517
|
+
colSpan: z143.number().optional(),
|
|
19518
|
+
width: distance43.optional(),
|
|
19519
|
+
text: z143.string().optional()
|
|
19309
19520
|
});
|
|
19310
19521
|
expectTypesMatch(true);
|
|
19311
19522
|
|
|
19312
19523
|
// lib/components/schematic-section.ts
|
|
19313
|
-
import { distance as
|
|
19314
|
-
import { z as
|
|
19315
|
-
var schematicSectionProps =
|
|
19316
|
-
displayName:
|
|
19317
|
-
name:
|
|
19318
|
-
sectionTitleFontSize:
|
|
19524
|
+
import { distance as distance44 } from "circuit-json";
|
|
19525
|
+
import { z as z144 } from "zod";
|
|
19526
|
+
var schematicSectionProps = z144.object({
|
|
19527
|
+
displayName: z144.string().optional(),
|
|
19528
|
+
name: z144.string(),
|
|
19529
|
+
sectionTitleFontSize: distance44.optional()
|
|
19319
19530
|
});
|
|
19320
19531
|
expectTypesMatch(
|
|
19321
19532
|
true
|
|
19322
19533
|
);
|
|
19323
19534
|
|
|
19324
19535
|
// lib/components/schematic-sheet.ts
|
|
19325
|
-
import { z as
|
|
19326
|
-
import { distance as
|
|
19327
|
-
var schematicSheetProps =
|
|
19328
|
-
name:
|
|
19329
|
-
displayName:
|
|
19330
|
-
sheetIndex:
|
|
19331
|
-
sheetSize:
|
|
19332
|
-
sheetWidth:
|
|
19333
|
-
sheetHeight:
|
|
19334
|
-
children:
|
|
19536
|
+
import { z as z145 } from "zod";
|
|
19537
|
+
import { distance as distance45 } from "circuit-json";
|
|
19538
|
+
var schematicSheetProps = z145.object({
|
|
19539
|
+
name: z145.string().optional(),
|
|
19540
|
+
displayName: z145.string().optional(),
|
|
19541
|
+
sheetIndex: z145.number().optional(),
|
|
19542
|
+
sheetSize: z145.enum(["A4", "ANSI_B"]).default("A4"),
|
|
19543
|
+
sheetWidth: distance45.pipe(z145.number().positive()).optional(),
|
|
19544
|
+
sheetHeight: distance45.pipe(z145.number().positive()).optional(),
|
|
19545
|
+
children: z145.any().optional()
|
|
19335
19546
|
});
|
|
19336
19547
|
expectTypesMatch(true);
|
|
19337
19548
|
|
|
19338
19549
|
// lib/components/schematic-graphic.ts
|
|
19339
|
-
import { z as
|
|
19550
|
+
import { z as z146 } from "zod";
|
|
19340
19551
|
var nonemptyUrl = url.refine((value) => value.trim().length > 0, {
|
|
19341
19552
|
message: "imageUrl cannot be empty"
|
|
19342
19553
|
});
|
|
19343
19554
|
var positiveDistance5 = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19344
19555
|
message: `${fieldName} must be a positive finite distance`
|
|
19345
19556
|
});
|
|
19346
|
-
var schematicGraphicProps =
|
|
19557
|
+
var schematicGraphicProps = z146.object({
|
|
19347
19558
|
imageUrl: nonemptyUrl.optional(),
|
|
19348
|
-
svgContent:
|
|
19559
|
+
svgContent: z146.string().refine((value) => value.trim().length > 0, {
|
|
19349
19560
|
message: "svgContent cannot be empty"
|
|
19350
19561
|
}).optional(),
|
|
19351
19562
|
width: positiveDistance5("width").optional(),
|
|
@@ -19353,7 +19564,7 @@ var schematicGraphicProps = z143.object({
|
|
|
19353
19564
|
}).superRefine(({ imageUrl, svgContent }, ctx) => {
|
|
19354
19565
|
if (imageUrl === void 0 && svgContent === void 0) {
|
|
19355
19566
|
ctx.addIssue({
|
|
19356
|
-
code:
|
|
19567
|
+
code: z146.ZodIssueCode.custom,
|
|
19357
19568
|
message: "At least one of imageUrl or svgContent is required"
|
|
19358
19569
|
});
|
|
19359
19570
|
}
|
|
@@ -19364,40 +19575,40 @@ expectTypesMatch(
|
|
|
19364
19575
|
|
|
19365
19576
|
// lib/components/copper-text.ts
|
|
19366
19577
|
import { layer_ref as layer_ref13, length as length8 } from "circuit-json";
|
|
19367
|
-
import { z as
|
|
19578
|
+
import { z as z147 } from "zod";
|
|
19368
19579
|
var copperTextProps = pcbLayoutProps.extend({
|
|
19369
|
-
text:
|
|
19580
|
+
text: z147.string(),
|
|
19370
19581
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19371
|
-
font:
|
|
19582
|
+
font: z147.enum(["tscircuit2024"]).optional(),
|
|
19372
19583
|
fontSize: length8.optional(),
|
|
19373
|
-
layers:
|
|
19374
|
-
knockout:
|
|
19375
|
-
mirrored:
|
|
19584
|
+
layers: z147.array(layer_ref13).optional(),
|
|
19585
|
+
knockout: z147.boolean().optional(),
|
|
19586
|
+
mirrored: z147.boolean().optional()
|
|
19376
19587
|
});
|
|
19377
19588
|
|
|
19378
19589
|
// lib/components/silkscreen-text.ts
|
|
19379
19590
|
import { layer_ref as layer_ref14, length as length9 } from "circuit-json";
|
|
19380
|
-
import { z as
|
|
19591
|
+
import { z as z148 } from "zod";
|
|
19381
19592
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
19382
|
-
text:
|
|
19593
|
+
text: z148.string(),
|
|
19383
19594
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19384
|
-
font:
|
|
19595
|
+
font: z148.enum(["tscircuit2024"]).optional(),
|
|
19385
19596
|
fontSize: length9.optional(),
|
|
19386
19597
|
/**
|
|
19387
19598
|
* If true, text will knock out underlying silkscreen
|
|
19388
19599
|
*/
|
|
19389
|
-
isKnockout:
|
|
19600
|
+
isKnockout: z148.boolean().optional(),
|
|
19390
19601
|
knockoutPadding: length9.optional(),
|
|
19391
19602
|
knockoutPaddingLeft: length9.optional(),
|
|
19392
19603
|
knockoutPaddingRight: length9.optional(),
|
|
19393
19604
|
knockoutPaddingTop: length9.optional(),
|
|
19394
19605
|
knockoutPaddingBottom: length9.optional(),
|
|
19395
|
-
layers:
|
|
19606
|
+
layers: z148.array(layer_ref14).optional()
|
|
19396
19607
|
});
|
|
19397
19608
|
|
|
19398
19609
|
// lib/components/silkscreen-path.ts
|
|
19399
19610
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
19400
|
-
import { z as
|
|
19611
|
+
import { z as z149 } from "zod";
|
|
19401
19612
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
19402
19613
|
pcbLeftEdgeX: true,
|
|
19403
19614
|
pcbRightEdgeX: true,
|
|
@@ -19409,12 +19620,12 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
19409
19620
|
pcbOffsetY: true,
|
|
19410
19621
|
pcbRotation: true
|
|
19411
19622
|
}).extend({
|
|
19412
|
-
route:
|
|
19623
|
+
route: z149.array(route_hint_point5),
|
|
19413
19624
|
strokeWidth: length10.optional()
|
|
19414
19625
|
});
|
|
19415
19626
|
|
|
19416
19627
|
// lib/components/silkscreen-line.ts
|
|
19417
|
-
import { distance as
|
|
19628
|
+
import { distance as distance46 } from "circuit-json";
|
|
19418
19629
|
var silkscreenLineProps = pcbLayoutProps.omit({
|
|
19419
19630
|
pcbX: true,
|
|
19420
19631
|
pcbY: true,
|
|
@@ -19422,33 +19633,33 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
19422
19633
|
pcbOffsetY: true,
|
|
19423
19634
|
pcbRotation: true
|
|
19424
19635
|
}).extend({
|
|
19425
|
-
strokeWidth:
|
|
19426
|
-
x1:
|
|
19427
|
-
y1:
|
|
19428
|
-
x2:
|
|
19429
|
-
y2:
|
|
19636
|
+
strokeWidth: distance46,
|
|
19637
|
+
x1: distance46,
|
|
19638
|
+
y1: distance46,
|
|
19639
|
+
x2: distance46,
|
|
19640
|
+
y2: distance46
|
|
19430
19641
|
});
|
|
19431
19642
|
|
|
19432
19643
|
// lib/components/silkscreen-rect.ts
|
|
19433
|
-
import { distance as
|
|
19434
|
-
import { z as
|
|
19644
|
+
import { distance as distance47 } from "circuit-json";
|
|
19645
|
+
import { z as z150 } from "zod";
|
|
19435
19646
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19436
|
-
filled:
|
|
19437
|
-
stroke:
|
|
19438
|
-
strokeWidth:
|
|
19439
|
-
width:
|
|
19440
|
-
height:
|
|
19441
|
-
cornerRadius:
|
|
19647
|
+
filled: z150.boolean().default(true).optional(),
|
|
19648
|
+
stroke: z150.enum(["dashed", "solid", "none"]).optional(),
|
|
19649
|
+
strokeWidth: distance47.optional(),
|
|
19650
|
+
width: distance47,
|
|
19651
|
+
height: distance47,
|
|
19652
|
+
cornerRadius: distance47.optional()
|
|
19442
19653
|
});
|
|
19443
19654
|
|
|
19444
19655
|
// lib/components/silkscreen-circle.ts
|
|
19445
|
-
import { distance as
|
|
19446
|
-
import { z as
|
|
19656
|
+
import { distance as distance48 } from "circuit-json";
|
|
19657
|
+
import { z as z151 } from "zod";
|
|
19447
19658
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19448
|
-
isFilled:
|
|
19449
|
-
isOutline:
|
|
19450
|
-
strokeWidth:
|
|
19451
|
-
radius:
|
|
19659
|
+
isFilled: z151.boolean().optional(),
|
|
19660
|
+
isOutline: z151.boolean().optional(),
|
|
19661
|
+
strokeWidth: distance48.optional(),
|
|
19662
|
+
radius: distance48
|
|
19452
19663
|
});
|
|
19453
19664
|
|
|
19454
19665
|
// lib/components/silkscreen-graphic.ts
|
|
@@ -19463,71 +19674,71 @@ var silkscreenGraphicProps = pcbLayoutProps.omit({ layer: true, pcbStyle: true,
|
|
|
19463
19674
|
expectTypesMatch(true);
|
|
19464
19675
|
|
|
19465
19676
|
// lib/components/trace-hint.ts
|
|
19466
|
-
import { distance as
|
|
19467
|
-
import { z as
|
|
19468
|
-
var routeHintPointProps =
|
|
19469
|
-
x:
|
|
19470
|
-
y:
|
|
19471
|
-
via:
|
|
19677
|
+
import { distance as distance49, layer_ref as layer_ref15, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
19678
|
+
import { z as z153 } from "zod";
|
|
19679
|
+
var routeHintPointProps = z153.object({
|
|
19680
|
+
x: distance49,
|
|
19681
|
+
y: distance49,
|
|
19682
|
+
via: z153.boolean().optional(),
|
|
19472
19683
|
toLayer: layer_ref15.optional()
|
|
19473
19684
|
});
|
|
19474
|
-
var traceHintProps =
|
|
19475
|
-
for:
|
|
19685
|
+
var traceHintProps = z153.object({
|
|
19686
|
+
for: z153.string().optional().describe(
|
|
19476
19687
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
19477
19688
|
),
|
|
19478
|
-
order:
|
|
19689
|
+
order: z153.number().optional(),
|
|
19479
19690
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
19480
|
-
offsets:
|
|
19481
|
-
traceWidth:
|
|
19691
|
+
offsets: z153.array(route_hint_point6).or(z153.array(routeHintPointProps)).optional(),
|
|
19692
|
+
traceWidth: z153.number().optional()
|
|
19482
19693
|
});
|
|
19483
19694
|
|
|
19484
19695
|
// lib/components/port.ts
|
|
19485
|
-
import { distance as
|
|
19486
|
-
import { z as
|
|
19696
|
+
import { distance as distance50 } from "circuit-json";
|
|
19697
|
+
import { z as z154 } from "zod";
|
|
19487
19698
|
var portProps = commonLayoutProps.extend({
|
|
19488
|
-
name:
|
|
19489
|
-
pinNumber:
|
|
19490
|
-
schStemLength:
|
|
19491
|
-
schPinLabelFontSize:
|
|
19492
|
-
|
|
19699
|
+
name: z154.string().optional(),
|
|
19700
|
+
pinNumber: z154.number().optional(),
|
|
19701
|
+
schStemLength: z154.number().optional(),
|
|
19702
|
+
schPinLabelFontSize: z154.enum(["default", "sm"]).or(
|
|
19703
|
+
distance50.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19493
19704
|
message: "Schematic pin-label font size must be positive and finite"
|
|
19494
19705
|
})
|
|
19495
19706
|
).optional(),
|
|
19496
|
-
aliases:
|
|
19497
|
-
layer:
|
|
19498
|
-
layers:
|
|
19499
|
-
schX:
|
|
19500
|
-
schY:
|
|
19707
|
+
aliases: z154.array(z154.string()).optional(),
|
|
19708
|
+
layer: z154.string().optional(),
|
|
19709
|
+
layers: z154.array(z154.string()).optional(),
|
|
19710
|
+
schX: z154.number().optional(),
|
|
19711
|
+
schY: z154.number().optional(),
|
|
19501
19712
|
direction: direction.optional(),
|
|
19502
|
-
connectsTo:
|
|
19713
|
+
connectsTo: z154.string().or(z154.array(z154.string())).optional(),
|
|
19503
19714
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
19504
|
-
hasInversionCircle:
|
|
19715
|
+
hasInversionCircle: z154.boolean().optional()
|
|
19505
19716
|
});
|
|
19506
19717
|
|
|
19507
19718
|
// lib/components/pcb-note-text.ts
|
|
19508
19719
|
import { length as length11 } from "circuit-json";
|
|
19509
|
-
import { z as
|
|
19720
|
+
import { z as z155 } from "zod";
|
|
19510
19721
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
19511
|
-
text:
|
|
19512
|
-
anchorAlignment:
|
|
19513
|
-
font:
|
|
19722
|
+
text: z155.string(),
|
|
19723
|
+
anchorAlignment: z155.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19724
|
+
font: z155.enum(["tscircuit2024"]).optional(),
|
|
19514
19725
|
fontSize: length11.optional(),
|
|
19515
|
-
color:
|
|
19726
|
+
color: z155.string().optional()
|
|
19516
19727
|
});
|
|
19517
19728
|
expectTypesMatch(true);
|
|
19518
19729
|
|
|
19519
19730
|
// lib/components/pcb-note-rect.ts
|
|
19520
|
-
import { distance as
|
|
19521
|
-
import { z as
|
|
19731
|
+
import { distance as distance51 } from "circuit-json";
|
|
19732
|
+
import { z as z156 } from "zod";
|
|
19522
19733
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19523
|
-
width:
|
|
19524
|
-
height:
|
|
19525
|
-
strokeWidth:
|
|
19526
|
-
isFilled:
|
|
19527
|
-
hasStroke:
|
|
19528
|
-
isStrokeDashed:
|
|
19529
|
-
color:
|
|
19530
|
-
cornerRadius:
|
|
19734
|
+
width: distance51,
|
|
19735
|
+
height: distance51,
|
|
19736
|
+
strokeWidth: distance51.optional(),
|
|
19737
|
+
isFilled: z156.boolean().optional(),
|
|
19738
|
+
hasStroke: z156.boolean().optional(),
|
|
19739
|
+
isStrokeDashed: z156.boolean().optional(),
|
|
19740
|
+
color: z156.string().optional(),
|
|
19741
|
+
cornerRadius: distance51.optional()
|
|
19531
19742
|
});
|
|
19532
19743
|
expectTypesMatch(true);
|
|
19533
19744
|
|
|
@@ -19536,7 +19747,7 @@ import {
|
|
|
19536
19747
|
length as length12,
|
|
19537
19748
|
route_hint_point as route_hint_point7
|
|
19538
19749
|
} from "circuit-json";
|
|
19539
|
-
import { z as
|
|
19750
|
+
import { z as z157 } from "zod";
|
|
19540
19751
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
19541
19752
|
pcbLeftEdgeX: true,
|
|
19542
19753
|
pcbRightEdgeX: true,
|
|
@@ -19548,15 +19759,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
19548
19759
|
pcbOffsetY: true,
|
|
19549
19760
|
pcbRotation: true
|
|
19550
19761
|
}).extend({
|
|
19551
|
-
route:
|
|
19762
|
+
route: z157.array(route_hint_point7),
|
|
19552
19763
|
strokeWidth: length12.optional(),
|
|
19553
|
-
color:
|
|
19764
|
+
color: z157.string().optional()
|
|
19554
19765
|
});
|
|
19555
19766
|
expectTypesMatch(true);
|
|
19556
19767
|
|
|
19557
19768
|
// lib/components/pcb-note-line.ts
|
|
19558
|
-
import { distance as
|
|
19559
|
-
import { z as
|
|
19769
|
+
import { distance as distance52 } from "circuit-json";
|
|
19770
|
+
import { z as z158 } from "zod";
|
|
19560
19771
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
19561
19772
|
pcbLeftEdgeX: true,
|
|
19562
19773
|
pcbRightEdgeX: true,
|
|
@@ -19568,20 +19779,20 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
19568
19779
|
pcbOffsetY: true,
|
|
19569
19780
|
pcbRotation: true
|
|
19570
19781
|
}).extend({
|
|
19571
|
-
x1:
|
|
19572
|
-
y1:
|
|
19573
|
-
x2:
|
|
19574
|
-
y2:
|
|
19575
|
-
strokeWidth:
|
|
19576
|
-
color:
|
|
19577
|
-
isDashed:
|
|
19782
|
+
x1: distance52,
|
|
19783
|
+
y1: distance52,
|
|
19784
|
+
x2: distance52,
|
|
19785
|
+
y2: distance52,
|
|
19786
|
+
strokeWidth: distance52.optional(),
|
|
19787
|
+
color: z158.string().optional(),
|
|
19788
|
+
isDashed: z158.boolean().optional()
|
|
19578
19789
|
});
|
|
19579
19790
|
expectTypesMatch(true);
|
|
19580
19791
|
|
|
19581
19792
|
// lib/components/pcb-note-dimension.ts
|
|
19582
|
-
import { distance as
|
|
19583
|
-
import { z as
|
|
19584
|
-
var dimensionTarget2 =
|
|
19793
|
+
import { distance as distance53, length as length13 } from "circuit-json";
|
|
19794
|
+
import { z as z159 } from "zod";
|
|
19795
|
+
var dimensionTarget2 = z159.union([z159.string(), point]);
|
|
19585
19796
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
19586
19797
|
pcbLeftEdgeX: true,
|
|
19587
19798
|
pcbRightEdgeX: true,
|
|
@@ -19595,114 +19806,114 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19595
19806
|
}).extend({
|
|
19596
19807
|
from: dimensionTarget2,
|
|
19597
19808
|
to: dimensionTarget2,
|
|
19598
|
-
text:
|
|
19599
|
-
offset:
|
|
19600
|
-
offsetDirection:
|
|
19601
|
-
font:
|
|
19809
|
+
text: z159.string().optional(),
|
|
19810
|
+
offset: distance53.optional(),
|
|
19811
|
+
offsetDirection: z159.object({ x: z159.number().finite(), y: z159.number().finite() }).optional(),
|
|
19812
|
+
font: z159.enum(["tscircuit2024"]).optional(),
|
|
19602
19813
|
fontSize: length13.optional(),
|
|
19603
|
-
color:
|
|
19604
|
-
arrowSize:
|
|
19605
|
-
units:
|
|
19606
|
-
outerEdgeToEdge:
|
|
19607
|
-
centerToCenter:
|
|
19608
|
-
innerEdgeToEdge:
|
|
19814
|
+
color: z159.string().optional(),
|
|
19815
|
+
arrowSize: distance53.optional(),
|
|
19816
|
+
units: z159.enum(["in", "mm"]).optional(),
|
|
19817
|
+
outerEdgeToEdge: z159.literal(true).optional(),
|
|
19818
|
+
centerToCenter: z159.literal(true).optional(),
|
|
19819
|
+
innerEdgeToEdge: z159.literal(true).optional()
|
|
19609
19820
|
});
|
|
19610
19821
|
expectTypesMatch(
|
|
19611
19822
|
true
|
|
19612
19823
|
);
|
|
19613
19824
|
|
|
19614
19825
|
// lib/platformConfig.ts
|
|
19615
|
-
import { z as
|
|
19616
|
-
var unvalidatedCircuitJson =
|
|
19617
|
-
var footprintLibraryResult =
|
|
19618
|
-
footprintCircuitJson:
|
|
19826
|
+
import { z as z160 } from "zod";
|
|
19827
|
+
var unvalidatedCircuitJson = z160.array(z160.any()).describe("Circuit JSON");
|
|
19828
|
+
var footprintLibraryResult = z160.object({
|
|
19829
|
+
footprintCircuitJson: z160.array(z160.any()),
|
|
19619
19830
|
cadModel: cadModelProp.optional()
|
|
19620
19831
|
});
|
|
19621
|
-
var pathToCircuitJsonFn =
|
|
19622
|
-
|
|
19623
|
-
|
|
19624
|
-
|
|
19625
|
-
).returns(
|
|
19832
|
+
var pathToCircuitJsonFn = z160.function().args(z160.string()).returns(z160.promise(footprintLibraryResult)).or(
|
|
19833
|
+
z160.function().args(
|
|
19834
|
+
z160.string(),
|
|
19835
|
+
z160.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
19836
|
+
).returns(z160.promise(footprintLibraryResult))
|
|
19626
19837
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
19627
|
-
var footprintFileParserEntry =
|
|
19628
|
-
loadFromUrl:
|
|
19838
|
+
var footprintFileParserEntry = z160.object({
|
|
19839
|
+
loadFromUrl: z160.function().args(z160.string()).returns(z160.promise(footprintLibraryResult)).describe(
|
|
19629
19840
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
19630
19841
|
)
|
|
19631
19842
|
});
|
|
19632
|
-
var spiceEngineSimulationResult =
|
|
19633
|
-
engineVersionString:
|
|
19843
|
+
var spiceEngineSimulationResult = z160.object({
|
|
19844
|
+
engineVersionString: z160.string().optional(),
|
|
19634
19845
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
19635
19846
|
});
|
|
19636
|
-
var spiceEngineZod =
|
|
19637
|
-
simulate:
|
|
19847
|
+
var spiceEngineZod = z160.object({
|
|
19848
|
+
simulate: z160.function().args(z160.string()).returns(z160.promise(spiceEngineSimulationResult)).describe(
|
|
19638
19849
|
"A function that takes a SPICE string and returns a simulation result"
|
|
19639
19850
|
)
|
|
19640
19851
|
});
|
|
19641
|
-
var defaultSpiceEngine =
|
|
19852
|
+
var defaultSpiceEngine = z160.custom(
|
|
19642
19853
|
(value) => typeof value === "string"
|
|
19643
19854
|
);
|
|
19644
|
-
var autorouterInstance =
|
|
19645
|
-
run:
|
|
19646
|
-
getOutputSimpleRouteJson:
|
|
19855
|
+
var autorouterInstance = z160.object({
|
|
19856
|
+
run: z160.function().args().returns(z160.promise(z160.unknown())).describe("Run the autorouter"),
|
|
19857
|
+
getOutputSimpleRouteJson: z160.function().args().returns(z160.promise(z160.any())).describe("Get the resulting SimpleRouteJson")
|
|
19647
19858
|
});
|
|
19648
|
-
var autorouterDefinition =
|
|
19649
|
-
createAutorouter:
|
|
19859
|
+
var autorouterDefinition = z160.object({
|
|
19860
|
+
createAutorouter: z160.function().args(z160.any(), z160.any().optional()).returns(z160.union([autorouterInstance, z160.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
19650
19861
|
});
|
|
19651
|
-
var platformFetch =
|
|
19652
|
-
var localCacheEngine =
|
|
19862
|
+
var platformFetch = z160.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
19863
|
+
var localCacheEngine = z160.custom(
|
|
19653
19864
|
(value) => typeof value === "object" && value !== null && "getItem" in value && typeof value.getItem === "function" && "setItem" in value && typeof value.setItem === "function"
|
|
19654
19865
|
);
|
|
19655
|
-
var fabricatorEngine =
|
|
19866
|
+
var fabricatorEngine = z160.custom(
|
|
19656
19867
|
(value) => typeof value === "object" && value !== null && "runDrcChecks" in value && typeof value.runDrcChecks === "function"
|
|
19657
19868
|
);
|
|
19658
|
-
var platformConfig =
|
|
19869
|
+
var platformConfig = z160.object({
|
|
19659
19870
|
partsEngine: partsEngine.optional(),
|
|
19660
19871
|
fabricatorEngine: fabricatorEngine.optional(),
|
|
19661
19872
|
autorouter: autorouterProp.optional(),
|
|
19662
|
-
autorouterMap:
|
|
19663
|
-
allowLegacyAutorouters:
|
|
19873
|
+
autorouterMap: z160.record(z160.string(), autorouterDefinition).optional(),
|
|
19874
|
+
allowLegacyAutorouters: z160.boolean().optional(),
|
|
19664
19875
|
registryApiUrl: url.optional(),
|
|
19665
19876
|
cloudAutorouterUrl: url.optional(),
|
|
19666
|
-
projectName:
|
|
19877
|
+
projectName: z160.string().optional(),
|
|
19667
19878
|
projectBaseUrl: url.optional(),
|
|
19668
|
-
version:
|
|
19879
|
+
version: z160.string().optional(),
|
|
19669
19880
|
url: url.optional(),
|
|
19670
|
-
printBoardInformationToSilkscreen:
|
|
19671
|
-
includeBoardFiles:
|
|
19881
|
+
printBoardInformationToSilkscreen: z160.boolean().optional(),
|
|
19882
|
+
includeBoardFiles: z160.array(z160.string()).describe(
|
|
19672
19883
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
19673
19884
|
).optional(),
|
|
19674
|
-
snapshotsDir:
|
|
19885
|
+
snapshotsDir: z160.string().describe(
|
|
19675
19886
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
19676
19887
|
).optional(),
|
|
19677
19888
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
19678
|
-
unitPreference:
|
|
19889
|
+
unitPreference: z160.enum(["mm", "in", "mil"]).optional(),
|
|
19679
19890
|
localCacheEngine: localCacheEngine.optional(),
|
|
19680
|
-
useCloudAutorouter:
|
|
19681
|
-
enablePartOrientationAnalysis:
|
|
19682
|
-
pcbPackSolverTimeoutMs:
|
|
19683
|
-
pcbDisabled:
|
|
19684
|
-
routingDisabled:
|
|
19685
|
-
schematicDisabled:
|
|
19686
|
-
partsEngineDisabled:
|
|
19687
|
-
analogSimulationDisabled:
|
|
19688
|
-
drcChecksDisabled:
|
|
19689
|
-
netlistDrcChecksDisabled:
|
|
19690
|
-
routingDrcChecksDisabled:
|
|
19691
|
-
placementDrcChecksDisabled:
|
|
19692
|
-
pinSpecificationDrcChecksDisabled:
|
|
19693
|
-
spiceEngineMap:
|
|
19694
|
-
footprintLibraryMap:
|
|
19695
|
-
|
|
19696
|
-
|
|
19891
|
+
useCloudAutorouter: z160.boolean().optional(),
|
|
19892
|
+
enablePartOrientationAnalysis: z160.boolean().optional(),
|
|
19893
|
+
pcbPackSolverTimeoutMs: z160.number().finite().positive().optional(),
|
|
19894
|
+
pcbDisabled: z160.boolean().optional(),
|
|
19895
|
+
routingDisabled: z160.boolean().optional(),
|
|
19896
|
+
schematicDisabled: z160.boolean().optional(),
|
|
19897
|
+
partsEngineDisabled: z160.boolean().optional(),
|
|
19898
|
+
analogSimulationDisabled: z160.boolean().optional(),
|
|
19899
|
+
drcChecksDisabled: z160.boolean().optional(),
|
|
19900
|
+
netlistDrcChecksDisabled: z160.boolean().optional(),
|
|
19901
|
+
routingDrcChecksDisabled: z160.boolean().optional(),
|
|
19902
|
+
placementDrcChecksDisabled: z160.boolean().optional(),
|
|
19903
|
+
pinSpecificationDrcChecksDisabled: z160.boolean().optional(),
|
|
19904
|
+
spiceEngineMap: z160.record(z160.string(), spiceEngineZod).optional(),
|
|
19905
|
+
footprintLibraryMap: z160.record(
|
|
19906
|
+
z160.string(),
|
|
19907
|
+
z160.union([
|
|
19697
19908
|
pathToCircuitJsonFn,
|
|
19698
|
-
|
|
19699
|
-
|
|
19700
|
-
|
|
19909
|
+
z160.record(
|
|
19910
|
+
z160.string(),
|
|
19911
|
+
z160.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
19701
19912
|
)
|
|
19702
19913
|
])
|
|
19703
19914
|
).optional(),
|
|
19704
|
-
footprintFileParserMap:
|
|
19705
|
-
resolveProjectStaticFileImportUrl:
|
|
19915
|
+
footprintFileParserMap: z160.record(z160.string(), footprintFileParserEntry).optional(),
|
|
19916
|
+
resolveProjectStaticFileImportUrl: z160.function().args(z160.string()).returns(z160.promise(z160.string())).describe(
|
|
19706
19917
|
"A function that returns a string URL for static files for the project"
|
|
19707
19918
|
).optional(),
|
|
19708
19919
|
platformFetch: platformFetch.optional()
|
|
@@ -19854,6 +20065,7 @@ export {
|
|
|
19854
20065
|
fuseProps,
|
|
19855
20066
|
groupProps,
|
|
19856
20067
|
holeProps,
|
|
20068
|
+
impedanceTarget,
|
|
19857
20069
|
inductorPins,
|
|
19858
20070
|
inductorProps,
|
|
19859
20071
|
interconnectProps,
|
|
@@ -19957,6 +20169,7 @@ export {
|
|
|
19957
20169
|
rotatedRectSmtPadProps,
|
|
19958
20170
|
rotationPoint3,
|
|
19959
20171
|
routeHintPointProps,
|
|
20172
|
+
routeLength,
|
|
19960
20173
|
routingTolerances,
|
|
19961
20174
|
schStyle,
|
|
19962
20175
|
schematicArcProps,
|
|
@@ -20003,6 +20216,7 @@ export {
|
|
|
20003
20216
|
toolingrailProps,
|
|
20004
20217
|
traceHintProps,
|
|
20005
20218
|
traceProps,
|
|
20219
|
+
traceSpacing,
|
|
20006
20220
|
transistorPins,
|
|
20007
20221
|
transistorPinsLabels,
|
|
20008
20222
|
transistorProps,
|