@tscircuit/props 0.0.578 → 0.0.579
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +364 -310
- package/dist/index.js +1025 -1005
- package/dist/index.js.map +1 -1
- package/lib/enclosure/fdm/box.ts +24 -0
- package/lib/enclosure/fdm/index.ts +1 -0
- package/lib/enclosure/index.ts +9 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -18,9 +18,34 @@ var directionAlongEdge = z.enum([
|
|
|
18
18
|
expectTypesMatch(true);
|
|
19
19
|
expectTypesMatch(true);
|
|
20
20
|
|
|
21
|
-
// lib/common/
|
|
21
|
+
// lib/common/distance.ts
|
|
22
|
+
import { distance as baseDistance, length } from "circuit-json";
|
|
22
23
|
import { z as z2 } from "zod";
|
|
23
|
-
var
|
|
24
|
+
var calcString = z2.string().regex(/^calc\(.*\)$/);
|
|
25
|
+
var distance = baseDistance;
|
|
26
|
+
var pcbCoordinate = calcString.or(baseDistance);
|
|
27
|
+
|
|
28
|
+
// lib/enclosure/fdm/box.ts
|
|
29
|
+
import { z as z3 } from "zod";
|
|
30
|
+
var enclosureFdmBoxProps = z3.object({
|
|
31
|
+
boardRef: z3.string().min(1),
|
|
32
|
+
width: distance.optional(),
|
|
33
|
+
height: distance.optional(),
|
|
34
|
+
depth: distance.optional(),
|
|
35
|
+
wallThickness: distance.default("2mm")
|
|
36
|
+
});
|
|
37
|
+
expectTypesMatch(true);
|
|
38
|
+
|
|
39
|
+
// lib/enclosure/index.ts
|
|
40
|
+
var enclosureProps = {
|
|
41
|
+
fdm: {
|
|
42
|
+
Box: enclosureFdmBoxProps
|
|
43
|
+
}
|
|
44
|
+
};
|
|
45
|
+
|
|
46
|
+
// lib/common/portHints.ts
|
|
47
|
+
import { z as z4 } from "zod";
|
|
48
|
+
var portHints = z4.array(z4.string().or(z4.number()));
|
|
24
49
|
expectTypesMatch(true);
|
|
25
50
|
|
|
26
51
|
// lib/common/layout.ts
|
|
@@ -30,41 +55,34 @@ import {
|
|
|
30
55
|
rotation as rotation2,
|
|
31
56
|
supplier_name
|
|
32
57
|
} from "circuit-json";
|
|
33
|
-
import { z as
|
|
58
|
+
import { z as z17 } from "zod";
|
|
34
59
|
|
|
35
60
|
// lib/common/cadModel.ts
|
|
36
|
-
import { z as
|
|
37
|
-
|
|
38
|
-
// lib/common/distance.ts
|
|
39
|
-
import { distance as baseDistance, length } from "circuit-json";
|
|
40
|
-
import { z as z3 } from "zod";
|
|
41
|
-
var calcString = z3.string().regex(/^calc\(.*\)$/);
|
|
42
|
-
var distance = baseDistance;
|
|
43
|
-
var pcbCoordinate = calcString.or(baseDistance);
|
|
61
|
+
import { z as z7 } from "zod";
|
|
44
62
|
|
|
45
63
|
// lib/common/point3.ts
|
|
46
64
|
import { distance as distance2 } from "circuit-json";
|
|
47
|
-
import { z as
|
|
48
|
-
var point3 =
|
|
65
|
+
import { z as z5 } from "zod";
|
|
66
|
+
var point3 = z5.object({
|
|
49
67
|
x: distance2,
|
|
50
68
|
y: distance2,
|
|
51
69
|
z: distance2
|
|
52
70
|
});
|
|
53
71
|
|
|
54
72
|
// lib/common/url.ts
|
|
55
|
-
import { z as
|
|
56
|
-
var url =
|
|
73
|
+
import { z as z6 } from "zod";
|
|
74
|
+
var url = z6.preprocess((value) => {
|
|
57
75
|
if (value && typeof value === "object" && "default" in value) {
|
|
58
76
|
return value.default;
|
|
59
77
|
}
|
|
60
78
|
return value;
|
|
61
|
-
},
|
|
79
|
+
}, z6.string());
|
|
62
80
|
|
|
63
81
|
// lib/common/cadModel.ts
|
|
64
|
-
var rotationPoint3 =
|
|
65
|
-
x:
|
|
66
|
-
y:
|
|
67
|
-
z:
|
|
82
|
+
var rotationPoint3 = z7.object({
|
|
83
|
+
x: z7.union([z7.number(), z7.string()]),
|
|
84
|
+
y: z7.union([z7.number(), z7.string()]),
|
|
85
|
+
z: z7.union([z7.number(), z7.string()])
|
|
68
86
|
});
|
|
69
87
|
var cadModelAxisDirections = [
|
|
70
88
|
"x+",
|
|
@@ -74,17 +92,17 @@ var cadModelAxisDirections = [
|
|
|
74
92
|
"z+",
|
|
75
93
|
"z-"
|
|
76
94
|
];
|
|
77
|
-
var cadModelAxisDirection =
|
|
78
|
-
var cadModelBase =
|
|
79
|
-
rotationOffset:
|
|
95
|
+
var cadModelAxisDirection = z7.enum(cadModelAxisDirections);
|
|
96
|
+
var cadModelBase = z7.object({
|
|
97
|
+
rotationOffset: z7.number().or(rotationPoint3).optional(),
|
|
80
98
|
positionOffset: point3.optional(),
|
|
81
99
|
modelOriginPosition: point3.optional(),
|
|
82
100
|
size: point3.optional(),
|
|
83
101
|
modelUnitToMmScale: distance.optional(),
|
|
84
102
|
modelBoardNormalDirection: cadModelAxisDirection.optional(),
|
|
85
|
-
pcbRotationOffset:
|
|
103
|
+
pcbRotationOffset: z7.number().optional(),
|
|
86
104
|
zOffsetFromSurface: distance.optional(),
|
|
87
|
-
showAsTranslucentModel:
|
|
105
|
+
showAsTranslucentModel: z7.boolean().optional(),
|
|
88
106
|
stepUrl: url.optional()
|
|
89
107
|
});
|
|
90
108
|
expectTypesMatch(true);
|
|
@@ -108,12 +126,12 @@ var cadModelWrl = cadModelBase.extend({
|
|
|
108
126
|
wrlUrl: url
|
|
109
127
|
});
|
|
110
128
|
var cadModelJscad = cadModelBase.extend({
|
|
111
|
-
jscad:
|
|
129
|
+
jscad: z7.record(z7.any())
|
|
112
130
|
});
|
|
113
|
-
var cadModelProp =
|
|
114
|
-
|
|
131
|
+
var cadModelProp = z7.union([
|
|
132
|
+
z7.null(),
|
|
115
133
|
url,
|
|
116
|
-
|
|
134
|
+
z7.custom((v) => {
|
|
117
135
|
return v && typeof v === "object" && "type" in v && "props" in v;
|
|
118
136
|
}),
|
|
119
137
|
cadModelStl,
|
|
@@ -127,17 +145,17 @@ var cadModelProp = z6.union([
|
|
|
127
145
|
expectTypesMatch(true);
|
|
128
146
|
|
|
129
147
|
// lib/common/footprintProp.ts
|
|
130
|
-
import { z as
|
|
131
|
-
var footprintProp =
|
|
148
|
+
import { z as z8 } from "zod";
|
|
149
|
+
var footprintProp = z8.custom((v) => true);
|
|
132
150
|
|
|
133
151
|
// lib/common/kicadFootprintMetadata.ts
|
|
134
152
|
import { distance as distance4, rotation } from "circuit-json";
|
|
135
|
-
import { z as
|
|
153
|
+
import { z as z10 } from "zod";
|
|
136
154
|
|
|
137
155
|
// lib/common/point.ts
|
|
138
156
|
import { distance as distance3 } from "circuit-json";
|
|
139
|
-
import { z as
|
|
140
|
-
var point =
|
|
157
|
+
import { z as z9 } from "zod";
|
|
158
|
+
var point = z9.object({
|
|
141
159
|
x: distance3,
|
|
142
160
|
y: distance3
|
|
143
161
|
});
|
|
@@ -147,25 +165,25 @@ var kicadAt = point.extend({
|
|
|
147
165
|
rotation: rotation.optional()
|
|
148
166
|
});
|
|
149
167
|
expectTypesMatch(true);
|
|
150
|
-
var kicadFont =
|
|
168
|
+
var kicadFont = z10.object({
|
|
151
169
|
size: point.optional(),
|
|
152
170
|
thickness: distance4.optional()
|
|
153
171
|
});
|
|
154
172
|
expectTypesMatch(true);
|
|
155
|
-
var kicadEffects =
|
|
173
|
+
var kicadEffects = z10.object({
|
|
156
174
|
font: kicadFont.optional()
|
|
157
175
|
});
|
|
158
176
|
expectTypesMatch(true);
|
|
159
|
-
var kicadProperty =
|
|
160
|
-
value:
|
|
177
|
+
var kicadProperty = z10.object({
|
|
178
|
+
value: z10.string(),
|
|
161
179
|
at: kicadAt.optional(),
|
|
162
|
-
layer:
|
|
163
|
-
uuid:
|
|
164
|
-
hide:
|
|
180
|
+
layer: z10.string().optional(),
|
|
181
|
+
uuid: z10.string().optional(),
|
|
182
|
+
hide: z10.boolean().optional(),
|
|
165
183
|
effects: kicadEffects.optional()
|
|
166
184
|
});
|
|
167
185
|
expectTypesMatch(true);
|
|
168
|
-
var kicadFootprintProperties =
|
|
186
|
+
var kicadFootprintProperties = z10.object({
|
|
169
187
|
Reference: kicadProperty.optional(),
|
|
170
188
|
Value: kicadProperty.optional(),
|
|
171
189
|
Datasheet: kicadProperty.optional(),
|
|
@@ -174,74 +192,74 @@ var kicadFootprintProperties = z9.object({
|
|
|
174
192
|
expectTypesMatch(
|
|
175
193
|
true
|
|
176
194
|
);
|
|
177
|
-
var kicadFootprintAttributes =
|
|
178
|
-
through_hole:
|
|
179
|
-
smd:
|
|
180
|
-
exclude_from_pos_files:
|
|
181
|
-
exclude_from_bom:
|
|
195
|
+
var kicadFootprintAttributes = z10.object({
|
|
196
|
+
through_hole: z10.boolean().optional(),
|
|
197
|
+
smd: z10.boolean().optional(),
|
|
198
|
+
exclude_from_pos_files: z10.boolean().optional(),
|
|
199
|
+
exclude_from_bom: z10.boolean().optional()
|
|
182
200
|
});
|
|
183
201
|
expectTypesMatch(
|
|
184
202
|
true
|
|
185
203
|
);
|
|
186
|
-
var kicadFootprintPad =
|
|
187
|
-
name:
|
|
188
|
-
type:
|
|
189
|
-
shape:
|
|
204
|
+
var kicadFootprintPad = z10.object({
|
|
205
|
+
name: z10.string(),
|
|
206
|
+
type: z10.string(),
|
|
207
|
+
shape: z10.string().optional(),
|
|
190
208
|
at: kicadAt.optional(),
|
|
191
209
|
size: point.optional(),
|
|
192
210
|
drill: distance4.optional(),
|
|
193
|
-
layers:
|
|
194
|
-
removeUnusedLayers:
|
|
195
|
-
uuid:
|
|
211
|
+
layers: z10.array(z10.string()).optional(),
|
|
212
|
+
removeUnusedLayers: z10.boolean().optional(),
|
|
213
|
+
uuid: z10.string().optional()
|
|
196
214
|
});
|
|
197
215
|
expectTypesMatch(true);
|
|
198
|
-
var kicadFootprintModel =
|
|
199
|
-
path:
|
|
216
|
+
var kicadFootprintModel = z10.object({
|
|
217
|
+
path: z10.string(),
|
|
200
218
|
offset: point3.optional(),
|
|
201
219
|
scale: point3.optional(),
|
|
202
220
|
rotate: point3.optional()
|
|
203
221
|
});
|
|
204
222
|
expectTypesMatch(true);
|
|
205
|
-
var kicadFootprintMetadata =
|
|
206
|
-
footprintName:
|
|
207
|
-
version:
|
|
208
|
-
generator:
|
|
209
|
-
generatorVersion:
|
|
210
|
-
layer:
|
|
223
|
+
var kicadFootprintMetadata = z10.object({
|
|
224
|
+
footprintName: z10.string().optional(),
|
|
225
|
+
version: z10.union([z10.number(), z10.string()]).optional(),
|
|
226
|
+
generator: z10.string().optional(),
|
|
227
|
+
generatorVersion: z10.union([z10.number(), z10.string()]).optional(),
|
|
228
|
+
layer: z10.string().optional(),
|
|
211
229
|
properties: kicadFootprintProperties.optional(),
|
|
212
230
|
attributes: kicadFootprintAttributes.optional(),
|
|
213
|
-
pads:
|
|
214
|
-
embeddedFonts:
|
|
231
|
+
pads: z10.array(kicadFootprintPad).optional(),
|
|
232
|
+
embeddedFonts: z10.boolean().optional(),
|
|
215
233
|
model: kicadFootprintModel.optional()
|
|
216
234
|
});
|
|
217
235
|
expectTypesMatch(true);
|
|
218
236
|
|
|
219
237
|
// lib/common/kicadSymbolMetadata.ts
|
|
220
238
|
import { distance as distance5 } from "circuit-json";
|
|
221
|
-
import { z as
|
|
222
|
-
var kicadSymbolPinNumbers =
|
|
223
|
-
hide:
|
|
239
|
+
import { z as z11 } from "zod";
|
|
240
|
+
var kicadSymbolPinNumbers = z11.object({
|
|
241
|
+
hide: z11.boolean().optional()
|
|
224
242
|
});
|
|
225
243
|
expectTypesMatch(true);
|
|
226
|
-
var kicadSymbolPinNames =
|
|
244
|
+
var kicadSymbolPinNames = z11.object({
|
|
227
245
|
offset: distance5.optional(),
|
|
228
|
-
hide:
|
|
246
|
+
hide: z11.boolean().optional()
|
|
229
247
|
});
|
|
230
248
|
expectTypesMatch(true);
|
|
231
|
-
var kicadSymbolEffects =
|
|
249
|
+
var kicadSymbolEffects = z11.object({
|
|
232
250
|
font: kicadFont.optional(),
|
|
233
|
-
justify:
|
|
234
|
-
hide:
|
|
251
|
+
justify: z11.union([z11.string(), z11.array(z11.string())]).optional(),
|
|
252
|
+
hide: z11.boolean().optional()
|
|
235
253
|
});
|
|
236
254
|
expectTypesMatch(true);
|
|
237
|
-
var kicadSymbolProperty =
|
|
238
|
-
value:
|
|
239
|
-
id:
|
|
255
|
+
var kicadSymbolProperty = z11.object({
|
|
256
|
+
value: z11.string(),
|
|
257
|
+
id: z11.union([z11.number(), z11.string()]).optional(),
|
|
240
258
|
at: kicadAt.optional(),
|
|
241
259
|
effects: kicadSymbolEffects.optional()
|
|
242
260
|
});
|
|
243
261
|
expectTypesMatch(true);
|
|
244
|
-
var kicadSymbolProperties =
|
|
262
|
+
var kicadSymbolProperties = z11.object({
|
|
245
263
|
Reference: kicadSymbolProperty.optional(),
|
|
246
264
|
Value: kicadSymbolProperty.optional(),
|
|
247
265
|
Footprint: kicadSymbolProperty.optional(),
|
|
@@ -251,55 +269,55 @@ var kicadSymbolProperties = z10.object({
|
|
|
251
269
|
ki_fp_filters: kicadSymbolProperty.optional()
|
|
252
270
|
});
|
|
253
271
|
expectTypesMatch(true);
|
|
254
|
-
var kicadSymbolMetadata =
|
|
255
|
-
symbolName:
|
|
256
|
-
extends:
|
|
272
|
+
var kicadSymbolMetadata = z11.object({
|
|
273
|
+
symbolName: z11.string().optional(),
|
|
274
|
+
extends: z11.string().optional(),
|
|
257
275
|
pinNumbers: kicadSymbolPinNumbers.optional(),
|
|
258
276
|
pinNames: kicadSymbolPinNames.optional(),
|
|
259
|
-
excludeFromSim:
|
|
260
|
-
inBom:
|
|
261
|
-
onBoard:
|
|
277
|
+
excludeFromSim: z11.boolean().optional(),
|
|
278
|
+
inBom: z11.boolean().optional(),
|
|
279
|
+
onBoard: z11.boolean().optional(),
|
|
262
280
|
properties: kicadSymbolProperties.optional(),
|
|
263
|
-
embeddedFonts:
|
|
281
|
+
embeddedFonts: z11.boolean().optional()
|
|
264
282
|
});
|
|
265
283
|
expectTypesMatch(true);
|
|
266
284
|
|
|
267
285
|
// lib/common/pcbStyle.ts
|
|
268
286
|
import { distance as distance6 } from "circuit-json";
|
|
269
|
-
import { z as
|
|
270
|
-
var pcbStyle =
|
|
287
|
+
import { z as z12 } from "zod";
|
|
288
|
+
var pcbStyle = z12.object({
|
|
271
289
|
silkscreenFontSize: distance6.optional(),
|
|
272
290
|
viaPadDiameter: distance6.optional(),
|
|
273
291
|
viaHoleDiameter: distance6.optional(),
|
|
274
|
-
silkscreenTextPosition:
|
|
275
|
-
|
|
276
|
-
|
|
277
|
-
offsetX:
|
|
278
|
-
offsetY:
|
|
292
|
+
silkscreenTextPosition: z12.union([
|
|
293
|
+
z12.enum(["centered", "outside", "none"]),
|
|
294
|
+
z12.object({
|
|
295
|
+
offsetX: z12.number(),
|
|
296
|
+
offsetY: z12.number()
|
|
279
297
|
})
|
|
280
298
|
]).optional(),
|
|
281
|
-
silkscreenTextVisibility:
|
|
299
|
+
silkscreenTextVisibility: z12.enum(["hidden", "visible", "inherit"]).optional()
|
|
282
300
|
});
|
|
283
301
|
expectTypesMatch(true);
|
|
284
302
|
|
|
285
303
|
// lib/common/pcbSx.ts
|
|
286
304
|
import { length as length2 } from "circuit-json";
|
|
287
|
-
import { z as
|
|
288
|
-
var pcbSxValue =
|
|
305
|
+
import { z as z13 } from "zod";
|
|
306
|
+
var pcbSxValue = z13.object({
|
|
289
307
|
fontSize: length2.optional(),
|
|
290
308
|
pcbX: pcbCoordinate.optional(),
|
|
291
309
|
pcbY: pcbCoordinate.optional(),
|
|
292
|
-
visibility:
|
|
310
|
+
visibility: z13.enum(["hidden", "visible", "inherit"]).optional()
|
|
293
311
|
});
|
|
294
|
-
var pcbSx =
|
|
295
|
-
|
|
312
|
+
var pcbSx = z13.record(
|
|
313
|
+
z13.string(),
|
|
296
314
|
pcbSxValue
|
|
297
315
|
);
|
|
298
316
|
expectTypesMatch(true);
|
|
299
317
|
|
|
300
318
|
// lib/common/pinAttributeMap.ts
|
|
301
|
-
import { z as
|
|
302
|
-
var pinCapability =
|
|
319
|
+
import { z as z14 } from "zod";
|
|
320
|
+
var pinCapability = z14.enum([
|
|
303
321
|
"i2c_sda",
|
|
304
322
|
"i2c_scl",
|
|
305
323
|
"spi_cs",
|
|
@@ -309,51 +327,51 @@ var pinCapability = z13.enum([
|
|
|
309
327
|
"uart_tx",
|
|
310
328
|
"uart_rx"
|
|
311
329
|
]);
|
|
312
|
-
var pinAttributeMap =
|
|
313
|
-
capabilities:
|
|
314
|
-
activeCapabilities:
|
|
330
|
+
var pinAttributeMap = z14.object({
|
|
331
|
+
capabilities: z14.array(pinCapability).optional(),
|
|
332
|
+
activeCapabilities: z14.array(pinCapability).optional(),
|
|
315
333
|
activeCapability: pinCapability.optional(),
|
|
316
|
-
providesPower:
|
|
317
|
-
requiresPower:
|
|
318
|
-
providesGround:
|
|
319
|
-
requiresGround:
|
|
320
|
-
providesVoltage:
|
|
321
|
-
requiresVoltage:
|
|
322
|
-
doNotConnect:
|
|
323
|
-
includeInBoardPinout:
|
|
324
|
-
highlightColor:
|
|
325
|
-
mustBeConnected:
|
|
326
|
-
canUseInternalPullup:
|
|
327
|
-
isUsingInternalPullup:
|
|
328
|
-
needsExternalPullup:
|
|
329
|
-
canUseInternalPulldown:
|
|
330
|
-
isUsingInternalPulldown:
|
|
331
|
-
needsExternalPulldown:
|
|
332
|
-
canUseOpenDrain:
|
|
333
|
-
isUsingOpenDrain:
|
|
334
|
-
canUsePushPull:
|
|
335
|
-
isUsingPushPull:
|
|
336
|
-
shouldHaveDecouplingCapacitor:
|
|
337
|
-
recommendedDecouplingCapacitorCapacitance:
|
|
338
|
-
isGpio:
|
|
334
|
+
providesPower: z14.boolean().optional(),
|
|
335
|
+
requiresPower: z14.boolean().optional(),
|
|
336
|
+
providesGround: z14.boolean().optional(),
|
|
337
|
+
requiresGround: z14.boolean().optional(),
|
|
338
|
+
providesVoltage: z14.union([z14.string(), z14.number()]).optional(),
|
|
339
|
+
requiresVoltage: z14.union([z14.string(), z14.number()]).optional(),
|
|
340
|
+
doNotConnect: z14.boolean().optional(),
|
|
341
|
+
includeInBoardPinout: z14.boolean().optional(),
|
|
342
|
+
highlightColor: z14.string().optional(),
|
|
343
|
+
mustBeConnected: z14.boolean().optional(),
|
|
344
|
+
canUseInternalPullup: z14.boolean().optional(),
|
|
345
|
+
isUsingInternalPullup: z14.boolean().optional(),
|
|
346
|
+
needsExternalPullup: z14.boolean().optional(),
|
|
347
|
+
canUseInternalPulldown: z14.boolean().optional(),
|
|
348
|
+
isUsingInternalPulldown: z14.boolean().optional(),
|
|
349
|
+
needsExternalPulldown: z14.boolean().optional(),
|
|
350
|
+
canUseOpenDrain: z14.boolean().optional(),
|
|
351
|
+
isUsingOpenDrain: z14.boolean().optional(),
|
|
352
|
+
canUsePushPull: z14.boolean().optional(),
|
|
353
|
+
isUsingPushPull: z14.boolean().optional(),
|
|
354
|
+
shouldHaveDecouplingCapacitor: z14.boolean().optional(),
|
|
355
|
+
recommendedDecouplingCapacitorCapacitance: z14.union([z14.string(), z14.number()]).optional(),
|
|
356
|
+
isGpio: z14.boolean().optional()
|
|
339
357
|
});
|
|
340
358
|
expectTypesMatch(true);
|
|
341
359
|
|
|
342
360
|
// lib/common/schStyle.ts
|
|
343
361
|
import { distance as distance7 } from "circuit-json";
|
|
344
|
-
import { z as
|
|
345
|
-
var schStyle =
|
|
346
|
-
defaultPassiveSize:
|
|
347
|
-
defaultCapacitorOrientation:
|
|
362
|
+
import { z as z15 } from "zod";
|
|
363
|
+
var schStyle = z15.object({
|
|
364
|
+
defaultPassiveSize: z15.union([z15.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
365
|
+
defaultCapacitorOrientation: z15.enum(["vertical", "none"]).optional()
|
|
348
366
|
});
|
|
349
367
|
expectTypesMatch(true);
|
|
350
368
|
|
|
351
369
|
// lib/common/symbolProp.ts
|
|
352
|
-
import { z as
|
|
353
|
-
var symbolProp =
|
|
370
|
+
import { z as z16 } from "zod";
|
|
371
|
+
var symbolProp = z16.custom((v) => true);
|
|
354
372
|
|
|
355
373
|
// lib/common/layout.ts
|
|
356
|
-
var pcbLayoutProps =
|
|
374
|
+
var pcbLayoutProps = z17.object({
|
|
357
375
|
pcbX: pcbCoordinate.optional(),
|
|
358
376
|
pcbY: pcbCoordinate.optional(),
|
|
359
377
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -363,14 +381,14 @@ var pcbLayoutProps = z16.object({
|
|
|
363
381
|
pcbOffsetX: distance8.optional(),
|
|
364
382
|
pcbOffsetY: distance8.optional(),
|
|
365
383
|
pcbRotation: rotation2.optional(),
|
|
366
|
-
pcbPositionAnchor:
|
|
367
|
-
pcbPositionMode:
|
|
384
|
+
pcbPositionAnchor: z17.string().optional(),
|
|
385
|
+
pcbPositionMode: z17.enum([
|
|
368
386
|
"relative_to_group_anchor",
|
|
369
387
|
"auto",
|
|
370
388
|
"relative_to_board_anchor",
|
|
371
389
|
"relative_to_component_anchor"
|
|
372
390
|
]).optional(),
|
|
373
|
-
shouldBeOnEdgeOfBoard:
|
|
391
|
+
shouldBeOnEdgeOfBoard: z17.boolean().optional(),
|
|
374
392
|
layer: layer_ref.optional(),
|
|
375
393
|
pcbMarginTop: distance8.optional(),
|
|
376
394
|
pcbMarginRight: distance8.optional(),
|
|
@@ -380,11 +398,11 @@ var pcbLayoutProps = z16.object({
|
|
|
380
398
|
pcbMarginY: distance8.optional(),
|
|
381
399
|
pcbStyle: pcbStyle.optional(),
|
|
382
400
|
pcbSx: pcbSx.optional(),
|
|
383
|
-
pcbRelative:
|
|
384
|
-
relative:
|
|
401
|
+
pcbRelative: z17.boolean().optional(),
|
|
402
|
+
relative: z17.boolean().optional()
|
|
385
403
|
});
|
|
386
404
|
expectTypesMatch(true);
|
|
387
|
-
var commonLayoutProps =
|
|
405
|
+
var commonLayoutProps = z17.object({
|
|
388
406
|
pcbX: pcbCoordinate.optional(),
|
|
389
407
|
pcbY: pcbCoordinate.optional(),
|
|
390
408
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -394,14 +412,14 @@ var commonLayoutProps = z16.object({
|
|
|
394
412
|
pcbOffsetX: distance8.optional(),
|
|
395
413
|
pcbOffsetY: distance8.optional(),
|
|
396
414
|
pcbRotation: rotation2.optional(),
|
|
397
|
-
pcbPositionAnchor:
|
|
398
|
-
pcbPositionMode:
|
|
415
|
+
pcbPositionAnchor: z17.string().optional(),
|
|
416
|
+
pcbPositionMode: z17.enum([
|
|
399
417
|
"relative_to_group_anchor",
|
|
400
418
|
"auto",
|
|
401
419
|
"relative_to_board_anchor",
|
|
402
420
|
"relative_to_component_anchor"
|
|
403
421
|
]).optional(),
|
|
404
|
-
shouldBeOnEdgeOfBoard:
|
|
422
|
+
shouldBeOnEdgeOfBoard: z17.boolean().optional(),
|
|
405
423
|
pcbMarginTop: distance8.optional(),
|
|
406
424
|
pcbMarginRight: distance8.optional(),
|
|
407
425
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -423,44 +441,44 @@ var commonLayoutProps = z16.object({
|
|
|
423
441
|
footprint: footprintProp.optional(),
|
|
424
442
|
symbol: symbolProp.optional(),
|
|
425
443
|
schStyle: schStyle.optional(),
|
|
426
|
-
relative:
|
|
427
|
-
schRelative:
|
|
428
|
-
pcbRelative:
|
|
444
|
+
relative: z17.boolean().optional(),
|
|
445
|
+
schRelative: z17.boolean().optional(),
|
|
446
|
+
pcbRelative: z17.boolean().optional()
|
|
429
447
|
});
|
|
430
448
|
expectTypesMatch(true);
|
|
431
|
-
var supplierProps =
|
|
432
|
-
supplierPartNumbers:
|
|
449
|
+
var supplierProps = z17.object({
|
|
450
|
+
supplierPartNumbers: z17.record(supplier_name, z17.array(z17.string())).optional()
|
|
433
451
|
});
|
|
434
452
|
expectTypesMatch(true);
|
|
435
453
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
436
|
-
key:
|
|
437
|
-
name:
|
|
438
|
-
displayName:
|
|
439
|
-
schSectionName:
|
|
454
|
+
key: z17.any().optional(),
|
|
455
|
+
name: z17.string(),
|
|
456
|
+
displayName: z17.string().optional(),
|
|
457
|
+
schSectionName: z17.string().optional().describe(
|
|
440
458
|
'This component will be drawn as part of this section e.g. "Power"'
|
|
441
459
|
),
|
|
442
|
-
schSheetName:
|
|
460
|
+
schSheetName: z17.string().optional().describe(
|
|
443
461
|
'This component will be drawn as part of this sheet e.g. "Main"'
|
|
444
462
|
),
|
|
445
463
|
datasheetUrl: url.optional(),
|
|
446
464
|
cadModel: cadModelProp.optional(),
|
|
447
465
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
448
466
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
449
|
-
children:
|
|
450
|
-
symbolName:
|
|
451
|
-
doNotPlace:
|
|
452
|
-
allowOffBoard:
|
|
467
|
+
children: z17.any().optional(),
|
|
468
|
+
symbolName: z17.string().optional(),
|
|
469
|
+
doNotPlace: z17.boolean().optional(),
|
|
470
|
+
allowOffBoard: z17.boolean().optional().describe(
|
|
453
471
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
454
472
|
),
|
|
455
|
-
obstructsWithinBounds:
|
|
473
|
+
obstructsWithinBounds: z17.boolean().optional().describe(
|
|
456
474
|
"Does this component take up all the space within its bounds on a layer. This is generally true except for when separated pin headers are being represented by a single component (in which case, chips can be placed between the pin headers) or for tall modules where chips fit underneath"
|
|
457
475
|
),
|
|
458
|
-
showAsTranslucentModel:
|
|
476
|
+
showAsTranslucentModel: z17.boolean().optional().describe(
|
|
459
477
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
460
478
|
),
|
|
461
|
-
pinAttributes:
|
|
462
|
-
mfn:
|
|
463
|
-
manufacturerPartNumber:
|
|
479
|
+
pinAttributes: z17.record(z17.string(), pinAttributeMap).optional(),
|
|
480
|
+
mfn: z17.string().describe("Manufacturer Part Number").optional(),
|
|
481
|
+
manufacturerPartNumber: z17.string().optional()
|
|
464
482
|
});
|
|
465
483
|
expectTypesMatch(true);
|
|
466
484
|
var componentProps = commonComponentProps;
|
|
@@ -475,7 +493,7 @@ var lrPolarPins = [
|
|
|
475
493
|
"cathode",
|
|
476
494
|
"neg"
|
|
477
495
|
];
|
|
478
|
-
var distanceOrMultiplier = distance8.or(
|
|
496
|
+
var distanceOrMultiplier = distance8.or(z17.enum(["2x", "3x", "4x"]));
|
|
479
497
|
|
|
480
498
|
// lib/generated/kicad-autocomplete.ts
|
|
481
499
|
var kicadFootprintKeys = [
|
|
@@ -15941,8 +15959,8 @@ var footprinterStringExamples = [
|
|
|
15941
15959
|
];
|
|
15942
15960
|
|
|
15943
15961
|
// lib/common/schematicOrientation.ts
|
|
15944
|
-
import { z as
|
|
15945
|
-
var schematicOrientation =
|
|
15962
|
+
import { z as z18 } from "zod";
|
|
15963
|
+
var schematicOrientation = z18.enum([
|
|
15946
15964
|
"vertical",
|
|
15947
15965
|
"horizontal",
|
|
15948
15966
|
"pos_top",
|
|
@@ -15961,32 +15979,32 @@ expectTypesMatch(
|
|
|
15961
15979
|
);
|
|
15962
15980
|
|
|
15963
15981
|
// lib/common/schematicPinDefinitions.ts
|
|
15964
|
-
import { z as
|
|
15965
|
-
var explicitPinSideDefinition =
|
|
15966
|
-
pins:
|
|
15967
|
-
direction:
|
|
15968
|
-
|
|
15969
|
-
|
|
15970
|
-
|
|
15971
|
-
|
|
15982
|
+
import { z as z19 } from "zod";
|
|
15983
|
+
var explicitPinSideDefinition = z19.object({
|
|
15984
|
+
pins: z19.array(z19.union([z19.number(), z19.string()])),
|
|
15985
|
+
direction: z19.union([
|
|
15986
|
+
z19.literal("top-to-bottom"),
|
|
15987
|
+
z19.literal("left-to-right"),
|
|
15988
|
+
z19.literal("bottom-to-top"),
|
|
15989
|
+
z19.literal("right-to-left")
|
|
15972
15990
|
])
|
|
15973
15991
|
});
|
|
15974
|
-
var pinSideDefinitionInput =
|
|
15975
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
15992
|
+
var pinSideDefinitionInput = z19.array(z19.union([z19.number(), z19.string()]));
|
|
15993
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z19.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
15976
15994
|
(value) => Array.isArray(value) ? {
|
|
15977
15995
|
pins: value,
|
|
15978
15996
|
direction: direction2
|
|
15979
15997
|
} : value
|
|
15980
15998
|
);
|
|
15981
|
-
var schematicPortArrangement =
|
|
15982
|
-
leftSize:
|
|
15983
|
-
topSize:
|
|
15984
|
-
rightSize:
|
|
15985
|
-
bottomSize:
|
|
15986
|
-
leftPinCount:
|
|
15987
|
-
rightPinCount:
|
|
15988
|
-
topPinCount:
|
|
15989
|
-
bottomPinCount:
|
|
15999
|
+
var schematicPortArrangement = z19.object({
|
|
16000
|
+
leftSize: z19.number().optional().describe("@deprecated, use leftPinCount"),
|
|
16001
|
+
topSize: z19.number().optional().describe("@deprecated, use topPinCount"),
|
|
16002
|
+
rightSize: z19.number().optional().describe("@deprecated, use rightPinCount"),
|
|
16003
|
+
bottomSize: z19.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
16004
|
+
leftPinCount: z19.number().optional(),
|
|
16005
|
+
rightPinCount: z19.number().optional(),
|
|
16006
|
+
topPinCount: z19.number().optional(),
|
|
16007
|
+
bottomPinCount: z19.number().optional(),
|
|
15990
16008
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
15991
16009
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
15992
16010
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -15997,9 +16015,9 @@ expectTypesMatch(true);
|
|
|
15997
16015
|
|
|
15998
16016
|
// lib/common/schematicPinStyle.ts
|
|
15999
16017
|
import { distance as distance9 } from "circuit-json";
|
|
16000
|
-
import { z as
|
|
16001
|
-
var schematicPinStyle =
|
|
16002
|
-
|
|
16018
|
+
import { z as z20 } from "zod";
|
|
16019
|
+
var schematicPinStyle = z20.record(
|
|
16020
|
+
z20.object({
|
|
16003
16021
|
marginLeft: distance9.optional(),
|
|
16004
16022
|
marginRight: distance9.optional(),
|
|
16005
16023
|
marginTop: distance9.optional(),
|
|
@@ -16013,17 +16031,17 @@ var schematicPinStyle = z19.record(
|
|
|
16013
16031
|
expectTypesMatch(true);
|
|
16014
16032
|
|
|
16015
16033
|
// lib/common/schematicPinLabel.ts
|
|
16016
|
-
import { z as
|
|
16017
|
-
var schematicPinLabel =
|
|
16034
|
+
import { z as z21 } from "zod";
|
|
16035
|
+
var schematicPinLabel = z21.string().regex(/^[A-Za-z0-9_]+$/);
|
|
16018
16036
|
|
|
16019
16037
|
// lib/common/schematicSize.ts
|
|
16020
16038
|
import { distance as distance10 } from "circuit-json";
|
|
16021
|
-
import { z as
|
|
16022
|
-
var schematicSymbolSize = distance10.or(
|
|
16039
|
+
import { z as z22 } from "zod";
|
|
16040
|
+
var schematicSymbolSize = distance10.or(z22.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
16023
16041
|
|
|
16024
16042
|
// lib/common/kicadPinMetadata.ts
|
|
16025
|
-
import { z as
|
|
16026
|
-
var kicadPinElectricalType =
|
|
16043
|
+
import { z as z23 } from "zod";
|
|
16044
|
+
var kicadPinElectricalType = z23.enum([
|
|
16027
16045
|
"input",
|
|
16028
16046
|
"output",
|
|
16029
16047
|
"bidirectional",
|
|
@@ -16037,7 +16055,7 @@ var kicadPinElectricalType = z22.enum([
|
|
|
16037
16055
|
"open_emitter",
|
|
16038
16056
|
"no_connect"
|
|
16039
16057
|
]);
|
|
16040
|
-
var kicadPinGraphicStyle =
|
|
16058
|
+
var kicadPinGraphicStyle = z23.enum([
|
|
16041
16059
|
"line",
|
|
16042
16060
|
"inverted",
|
|
16043
16061
|
"clock",
|
|
@@ -16048,7 +16066,7 @@ var kicadPinGraphicStyle = z22.enum([
|
|
|
16048
16066
|
"falling_edge_clock",
|
|
16049
16067
|
"nonlogic"
|
|
16050
16068
|
]);
|
|
16051
|
-
var kicadPinMetadata =
|
|
16069
|
+
var kicadPinMetadata = z23.object({
|
|
16052
16070
|
electricalType: kicadPinElectricalType.optional(),
|
|
16053
16071
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
16054
16072
|
pinLength: distance.optional(),
|
|
@@ -16058,14 +16076,14 @@ var kicadPinMetadata = z22.object({
|
|
|
16058
16076
|
expectTypesMatch(true);
|
|
16059
16077
|
|
|
16060
16078
|
// lib/customDrc.ts
|
|
16061
|
-
import { z as
|
|
16062
|
-
var customDrcCheckFn =
|
|
16079
|
+
import { z as z24 } from "zod";
|
|
16080
|
+
var customDrcCheckFn = z24.custom(
|
|
16063
16081
|
(value) => typeof value === "function"
|
|
16064
16082
|
);
|
|
16065
16083
|
|
|
16066
16084
|
// lib/common/ninePointAnchor.ts
|
|
16067
|
-
import { z as
|
|
16068
|
-
var ninePointAnchor =
|
|
16085
|
+
import { z as z25 } from "zod";
|
|
16086
|
+
var ninePointAnchor = z25.enum([
|
|
16069
16087
|
"top_left",
|
|
16070
16088
|
"top_center",
|
|
16071
16089
|
"top_right",
|
|
@@ -16078,47 +16096,47 @@ var ninePointAnchor = z24.enum([
|
|
|
16078
16096
|
]);
|
|
16079
16097
|
|
|
16080
16098
|
// lib/components/board.ts
|
|
16081
|
-
import { z as
|
|
16099
|
+
import { z as z39 } from "zod";
|
|
16082
16100
|
|
|
16083
16101
|
// lib/components/group.ts
|
|
16084
16102
|
import {
|
|
16085
16103
|
length as length3,
|
|
16086
16104
|
distance as distance11
|
|
16087
16105
|
} from "circuit-json";
|
|
16088
|
-
import { z as
|
|
16106
|
+
import { z as z38 } from "zod";
|
|
16089
16107
|
|
|
16090
16108
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
16091
|
-
import { z as
|
|
16092
|
-
var base_manual_edit_event =
|
|
16093
|
-
edit_event_id:
|
|
16094
|
-
in_progress:
|
|
16095
|
-
created_at:
|
|
16109
|
+
import { z as z26 } from "zod";
|
|
16110
|
+
var base_manual_edit_event = z26.object({
|
|
16111
|
+
edit_event_id: z26.string(),
|
|
16112
|
+
in_progress: z26.boolean().optional(),
|
|
16113
|
+
created_at: z26.number()
|
|
16096
16114
|
});
|
|
16097
16115
|
expectTypesMatch(
|
|
16098
16116
|
true
|
|
16099
16117
|
);
|
|
16100
16118
|
|
|
16101
16119
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
16102
|
-
import { z as
|
|
16120
|
+
import { z as z27 } from "zod";
|
|
16103
16121
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
16104
|
-
pcb_edit_event_type:
|
|
16105
|
-
edit_event_type:
|
|
16106
|
-
pcb_component_id:
|
|
16107
|
-
original_center:
|
|
16108
|
-
new_center:
|
|
16122
|
+
pcb_edit_event_type: z27.literal("edit_component_location").describe("deprecated"),
|
|
16123
|
+
edit_event_type: z27.literal("edit_pcb_component_location"),
|
|
16124
|
+
pcb_component_id: z27.string(),
|
|
16125
|
+
original_center: z27.object({ x: z27.number(), y: z27.number() }),
|
|
16126
|
+
new_center: z27.object({ x: z27.number(), y: z27.number() })
|
|
16109
16127
|
});
|
|
16110
16128
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
16111
16129
|
expectTypesMatch(true);
|
|
16112
16130
|
|
|
16113
16131
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
16114
|
-
import { z as
|
|
16132
|
+
import { z as z28 } from "zod";
|
|
16115
16133
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
16116
|
-
pcb_edit_event_type:
|
|
16117
|
-
edit_event_type:
|
|
16118
|
-
pcb_port_id:
|
|
16119
|
-
pcb_trace_hint_id:
|
|
16120
|
-
route:
|
|
16121
|
-
|
|
16134
|
+
pcb_edit_event_type: z28.literal("edit_trace_hint").describe("deprecated"),
|
|
16135
|
+
edit_event_type: z28.literal("edit_pcb_trace_hint").optional(),
|
|
16136
|
+
pcb_port_id: z28.string(),
|
|
16137
|
+
pcb_trace_hint_id: z28.string().optional(),
|
|
16138
|
+
route: z28.array(
|
|
16139
|
+
z28.object({ x: z28.number(), y: z28.number(), via: z28.boolean().optional() })
|
|
16122
16140
|
)
|
|
16123
16141
|
});
|
|
16124
16142
|
expectTypesMatch(
|
|
@@ -16126,38 +16144,38 @@ expectTypesMatch(
|
|
|
16126
16144
|
);
|
|
16127
16145
|
|
|
16128
16146
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
16129
|
-
import { z as
|
|
16147
|
+
import { z as z29 } from "zod";
|
|
16130
16148
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
16131
|
-
edit_event_type:
|
|
16132
|
-
schematic_component_id:
|
|
16133
|
-
original_center:
|
|
16134
|
-
new_center:
|
|
16149
|
+
edit_event_type: z29.literal("edit_schematic_component_location"),
|
|
16150
|
+
schematic_component_id: z29.string(),
|
|
16151
|
+
original_center: z29.object({ x: z29.number(), y: z29.number() }),
|
|
16152
|
+
new_center: z29.object({ x: z29.number(), y: z29.number() })
|
|
16135
16153
|
});
|
|
16136
16154
|
expectTypesMatch(true);
|
|
16137
16155
|
|
|
16138
16156
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
16139
|
-
import { z as
|
|
16157
|
+
import { z as z30 } from "zod";
|
|
16140
16158
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
16141
|
-
edit_event_type:
|
|
16142
|
-
pcb_group_id:
|
|
16143
|
-
original_center:
|
|
16144
|
-
new_center:
|
|
16159
|
+
edit_event_type: z30.literal("edit_pcb_group_location"),
|
|
16160
|
+
pcb_group_id: z30.string(),
|
|
16161
|
+
original_center: z30.object({ x: z30.number(), y: z30.number() }),
|
|
16162
|
+
new_center: z30.object({ x: z30.number(), y: z30.number() })
|
|
16145
16163
|
});
|
|
16146
16164
|
expectTypesMatch(true);
|
|
16147
16165
|
|
|
16148
16166
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
16149
|
-
import { z as
|
|
16167
|
+
import { z as z31 } from "zod";
|
|
16150
16168
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
16151
|
-
edit_event_type:
|
|
16152
|
-
schematic_group_id:
|
|
16153
|
-
original_center:
|
|
16154
|
-
new_center:
|
|
16169
|
+
edit_event_type: z31.literal("edit_schematic_group_location"),
|
|
16170
|
+
schematic_group_id: z31.string(),
|
|
16171
|
+
original_center: z31.object({ x: z31.number(), y: z31.number() }),
|
|
16172
|
+
new_center: z31.object({ x: z31.number(), y: z31.number() })
|
|
16155
16173
|
});
|
|
16156
16174
|
expectTypesMatch(true);
|
|
16157
16175
|
|
|
16158
16176
|
// lib/manual-edits/manual_edit_event.ts
|
|
16159
|
-
import { z as
|
|
16160
|
-
var manual_edit_event =
|
|
16177
|
+
import { z as z32 } from "zod";
|
|
16178
|
+
var manual_edit_event = z32.union([
|
|
16161
16179
|
edit_pcb_component_location_event,
|
|
16162
16180
|
edit_trace_hint_event,
|
|
16163
16181
|
edit_schematic_component_location_event
|
|
@@ -16165,33 +16183,33 @@ var manual_edit_event = z31.union([
|
|
|
16165
16183
|
expectTypesMatch(true);
|
|
16166
16184
|
|
|
16167
16185
|
// lib/manual-edits/manual_edits_file.ts
|
|
16168
|
-
import { z as
|
|
16186
|
+
import { z as z36 } from "zod";
|
|
16169
16187
|
|
|
16170
16188
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
16171
|
-
import { z as
|
|
16189
|
+
import { z as z33 } from "zod";
|
|
16172
16190
|
import { point as point2 } from "circuit-json";
|
|
16173
|
-
var manual_pcb_placement =
|
|
16174
|
-
selector:
|
|
16175
|
-
relative_to:
|
|
16191
|
+
var manual_pcb_placement = z33.object({
|
|
16192
|
+
selector: z33.string(),
|
|
16193
|
+
relative_to: z33.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16176
16194
|
center: point2
|
|
16177
16195
|
});
|
|
16178
16196
|
expectTypesMatch(true);
|
|
16179
16197
|
|
|
16180
16198
|
// lib/manual-edits/manual_trace_hint.ts
|
|
16181
|
-
import { z as
|
|
16199
|
+
import { z as z34 } from "zod";
|
|
16182
16200
|
import { route_hint_point } from "circuit-json";
|
|
16183
|
-
var manual_trace_hint =
|
|
16184
|
-
pcb_port_selector:
|
|
16185
|
-
offsets:
|
|
16201
|
+
var manual_trace_hint = z34.object({
|
|
16202
|
+
pcb_port_selector: z34.string(),
|
|
16203
|
+
offsets: z34.array(route_hint_point)
|
|
16186
16204
|
});
|
|
16187
16205
|
expectTypesMatch(true);
|
|
16188
16206
|
|
|
16189
16207
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
16190
|
-
import { z as
|
|
16208
|
+
import { z as z35 } from "zod";
|
|
16191
16209
|
import { point as point4 } from "circuit-json";
|
|
16192
|
-
var manual_schematic_placement =
|
|
16193
|
-
selector:
|
|
16194
|
-
relative_to:
|
|
16210
|
+
var manual_schematic_placement = z35.object({
|
|
16211
|
+
selector: z35.string(),
|
|
16212
|
+
relative_to: z35.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16195
16213
|
center: point4
|
|
16196
16214
|
});
|
|
16197
16215
|
expectTypesMatch(
|
|
@@ -16199,37 +16217,37 @@ expectTypesMatch(
|
|
|
16199
16217
|
);
|
|
16200
16218
|
|
|
16201
16219
|
// lib/manual-edits/manual_edits_file.ts
|
|
16202
|
-
var manual_edits_file =
|
|
16203
|
-
pcb_placements:
|
|
16204
|
-
manual_trace_hints:
|
|
16205
|
-
schematic_placements:
|
|
16220
|
+
var manual_edits_file = z36.object({
|
|
16221
|
+
pcb_placements: z36.array(manual_pcb_placement).optional(),
|
|
16222
|
+
manual_trace_hints: z36.array(manual_trace_hint).optional(),
|
|
16223
|
+
schematic_placements: z36.array(manual_schematic_placement).optional()
|
|
16206
16224
|
});
|
|
16207
16225
|
expectTypesMatch(true);
|
|
16208
16226
|
|
|
16209
16227
|
// lib/common/connectionsProp.ts
|
|
16210
|
-
import { z as
|
|
16211
|
-
var connectionTarget =
|
|
16228
|
+
import { z as z37 } from "zod";
|
|
16229
|
+
var connectionTarget = z37.string().or(z37.array(z37.string()).readonly()).or(z37.array(z37.string()));
|
|
16212
16230
|
var createConnectionsProp = (labels) => {
|
|
16213
|
-
return
|
|
16231
|
+
return z37.record(z37.enum(labels), connectionTarget);
|
|
16214
16232
|
};
|
|
16215
16233
|
|
|
16216
16234
|
// lib/components/group.ts
|
|
16217
|
-
var layoutConfig =
|
|
16218
|
-
layoutMode:
|
|
16219
|
-
position:
|
|
16220
|
-
grid:
|
|
16221
|
-
gridCols:
|
|
16222
|
-
gridRows:
|
|
16223
|
-
gridTemplateRows:
|
|
16224
|
-
gridTemplateColumns:
|
|
16225
|
-
gridTemplate:
|
|
16226
|
-
gridGap:
|
|
16227
|
-
gridRowGap:
|
|
16228
|
-
gridColumnGap:
|
|
16229
|
-
flex:
|
|
16230
|
-
flexDirection:
|
|
16231
|
-
alignItems:
|
|
16232
|
-
justifyContent:
|
|
16235
|
+
var layoutConfig = z38.object({
|
|
16236
|
+
layoutMode: z38.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
16237
|
+
position: z38.enum(["absolute", "relative"]).optional(),
|
|
16238
|
+
grid: z38.boolean().optional(),
|
|
16239
|
+
gridCols: z38.number().or(z38.string()).optional(),
|
|
16240
|
+
gridRows: z38.number().or(z38.string()).optional(),
|
|
16241
|
+
gridTemplateRows: z38.string().optional(),
|
|
16242
|
+
gridTemplateColumns: z38.string().optional(),
|
|
16243
|
+
gridTemplate: z38.string().optional(),
|
|
16244
|
+
gridGap: z38.number().or(z38.string()).optional(),
|
|
16245
|
+
gridRowGap: z38.number().or(z38.string()).optional(),
|
|
16246
|
+
gridColumnGap: z38.number().or(z38.string()).optional(),
|
|
16247
|
+
flex: z38.boolean().or(z38.string()).optional(),
|
|
16248
|
+
flexDirection: z38.enum(["row", "column"]).optional(),
|
|
16249
|
+
alignItems: z38.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16250
|
+
justifyContent: z38.enum([
|
|
16233
16251
|
"start",
|
|
16234
16252
|
"center",
|
|
16235
16253
|
"end",
|
|
@@ -16238,16 +16256,16 @@ var layoutConfig = z37.object({
|
|
|
16238
16256
|
"space-around",
|
|
16239
16257
|
"space-evenly"
|
|
16240
16258
|
]).optional(),
|
|
16241
|
-
flexRow:
|
|
16242
|
-
flexColumn:
|
|
16243
|
-
gap:
|
|
16244
|
-
pack:
|
|
16245
|
-
packOrderStrategy:
|
|
16259
|
+
flexRow: z38.boolean().optional(),
|
|
16260
|
+
flexColumn: z38.boolean().optional(),
|
|
16261
|
+
gap: z38.number().or(z38.string()).optional(),
|
|
16262
|
+
pack: z38.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
16263
|
+
packOrderStrategy: z38.enum([
|
|
16246
16264
|
"largest_to_smallest",
|
|
16247
16265
|
"first_to_last",
|
|
16248
16266
|
"highest_to_lowest_pin_count"
|
|
16249
16267
|
]).optional(),
|
|
16250
|
-
packPlacementStrategy:
|
|
16268
|
+
packPlacementStrategy: z38.enum(["shortest_connection_along_outline"]).optional(),
|
|
16251
16269
|
padding: length3.optional(),
|
|
16252
16270
|
paddingLeft: length3.optional(),
|
|
16253
16271
|
paddingRight: length3.optional(),
|
|
@@ -16257,17 +16275,17 @@ var layoutConfig = z37.object({
|
|
|
16257
16275
|
paddingY: length3.optional(),
|
|
16258
16276
|
width: length3.optional(),
|
|
16259
16277
|
height: length3.optional(),
|
|
16260
|
-
matchAdapt:
|
|
16261
|
-
matchAdaptTemplate:
|
|
16278
|
+
matchAdapt: z38.boolean().optional(),
|
|
16279
|
+
matchAdaptTemplate: z38.any().optional()
|
|
16262
16280
|
});
|
|
16263
16281
|
expectTypesMatch(true);
|
|
16264
|
-
var border =
|
|
16282
|
+
var border = z38.object({
|
|
16265
16283
|
strokeWidth: length3.optional(),
|
|
16266
|
-
dashed:
|
|
16267
|
-
solid:
|
|
16284
|
+
dashed: z38.boolean().optional(),
|
|
16285
|
+
solid: z38.boolean().optional()
|
|
16268
16286
|
});
|
|
16269
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
16270
|
-
var routingTolerances =
|
|
16287
|
+
var pcbAnchorAlignmentAutocomplete = z38.custom((value) => typeof value === "string");
|
|
16288
|
+
var routingTolerances = z38.object({
|
|
16271
16289
|
minTraceWidth: length3.optional(),
|
|
16272
16290
|
minViaHoleEdgeToViaHoleEdgeClearance: length3.optional(),
|
|
16273
16291
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
@@ -16278,19 +16296,19 @@ var routingTolerances = z37.object({
|
|
|
16278
16296
|
minViaHoleDiameter: length3.optional(),
|
|
16279
16297
|
minViaPadDiameter: length3.optional()
|
|
16280
16298
|
});
|
|
16281
|
-
var autorouterConfig =
|
|
16299
|
+
var autorouterConfig = z38.object({
|
|
16282
16300
|
serverUrl: url.optional(),
|
|
16283
|
-
inputFormat:
|
|
16284
|
-
serverMode:
|
|
16285
|
-
serverCacheEnabled:
|
|
16286
|
-
cache:
|
|
16301
|
+
inputFormat: z38.enum(["simplified", "circuit-json"]).optional(),
|
|
16302
|
+
serverMode: z38.enum(["job", "solve-endpoint"]).optional(),
|
|
16303
|
+
serverCacheEnabled: z38.boolean().optional(),
|
|
16304
|
+
cache: z38.custom((v) => true).optional(),
|
|
16287
16305
|
traceClearance: length3.optional(),
|
|
16288
|
-
availableJumperTypes:
|
|
16289
|
-
groupMode:
|
|
16290
|
-
algorithmFn:
|
|
16306
|
+
availableJumperTypes: z38.array(z38.enum(["1206x4", "0603"])).optional(),
|
|
16307
|
+
groupMode: z38.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
16308
|
+
algorithmFn: z38.custom(
|
|
16291
16309
|
(v) => typeof v === "function" || v === void 0
|
|
16292
16310
|
).optional(),
|
|
16293
|
-
preset:
|
|
16311
|
+
preset: z38.enum([
|
|
16294
16312
|
"sequential_trace",
|
|
16295
16313
|
"subcircuit",
|
|
16296
16314
|
"default",
|
|
@@ -16307,61 +16325,61 @@ var autorouterConfig = z37.object({
|
|
|
16307
16325
|
"auto-local",
|
|
16308
16326
|
"auto-cloud"
|
|
16309
16327
|
]).optional(),
|
|
16310
|
-
local:
|
|
16328
|
+
local: z38.boolean().optional()
|
|
16311
16329
|
});
|
|
16312
|
-
var autorouterPreset =
|
|
16313
|
-
|
|
16314
|
-
|
|
16315
|
-
|
|
16316
|
-
|
|
16317
|
-
|
|
16318
|
-
|
|
16319
|
-
|
|
16320
|
-
|
|
16321
|
-
|
|
16322
|
-
|
|
16323
|
-
|
|
16330
|
+
var autorouterPreset = z38.union([
|
|
16331
|
+
z38.literal("sequential_trace"),
|
|
16332
|
+
z38.literal("subcircuit"),
|
|
16333
|
+
z38.literal("default"),
|
|
16334
|
+
z38.literal("auto"),
|
|
16335
|
+
z38.literal("auto_local"),
|
|
16336
|
+
z38.literal("auto_cloud"),
|
|
16337
|
+
z38.literal("auto_jumper"),
|
|
16338
|
+
z38.literal("tscircuit_beta"),
|
|
16339
|
+
z38.literal("krt"),
|
|
16340
|
+
z38.literal("freerouting"),
|
|
16341
|
+
z38.literal("laser_prefab"),
|
|
16324
16342
|
// Prefabricated PCB with laser copper ablation
|
|
16325
|
-
|
|
16326
|
-
|
|
16327
|
-
|
|
16328
|
-
|
|
16343
|
+
z38.literal("auto-jumper"),
|
|
16344
|
+
z38.literal("sequential-trace"),
|
|
16345
|
+
z38.literal("auto-local"),
|
|
16346
|
+
z38.literal("auto-cloud")
|
|
16329
16347
|
]);
|
|
16330
|
-
var autorouterString =
|
|
16331
|
-
var autorouterProp =
|
|
16348
|
+
var autorouterString = z38.string();
|
|
16349
|
+
var autorouterProp = z38.union([
|
|
16332
16350
|
autorouterConfig,
|
|
16333
16351
|
autorouterPreset,
|
|
16334
16352
|
autorouterString
|
|
16335
16353
|
]);
|
|
16336
|
-
var autorouterEffortLevel =
|
|
16354
|
+
var autorouterEffortLevel = z38.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
16337
16355
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16338
|
-
name:
|
|
16339
|
-
children:
|
|
16340
|
-
schTitle:
|
|
16341
|
-
schSheetName:
|
|
16342
|
-
key:
|
|
16343
|
-
showAsSchematicBox:
|
|
16344
|
-
connections:
|
|
16356
|
+
name: z38.string().optional(),
|
|
16357
|
+
children: z38.any().optional(),
|
|
16358
|
+
schTitle: z38.string().optional(),
|
|
16359
|
+
schSheetName: z38.string().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),
|
|
16360
|
+
key: z38.any().optional(),
|
|
16361
|
+
showAsSchematicBox: z38.boolean().optional(),
|
|
16362
|
+
connections: z38.record(z38.string(), connectionTarget.optional()).optional(),
|
|
16345
16363
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16346
16364
|
schPinSpacing: length3.optional(),
|
|
16347
16365
|
schPinStyle: schematicPinStyle.optional(),
|
|
16348
16366
|
...layoutConfig.shape,
|
|
16349
16367
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
16350
16368
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
16351
|
-
pcbGrid:
|
|
16352
|
-
pcbGridCols:
|
|
16353
|
-
pcbGridRows:
|
|
16354
|
-
pcbGridTemplateRows:
|
|
16355
|
-
pcbGridTemplateColumns:
|
|
16356
|
-
pcbGridTemplate:
|
|
16357
|
-
pcbGridGap:
|
|
16358
|
-
pcbGridRowGap:
|
|
16359
|
-
pcbGridColumnGap:
|
|
16360
|
-
pcbFlex:
|
|
16361
|
-
pcbFlexGap:
|
|
16362
|
-
pcbFlexDirection:
|
|
16363
|
-
pcbAlignItems:
|
|
16364
|
-
pcbJustifyContent:
|
|
16369
|
+
pcbGrid: z38.boolean().optional(),
|
|
16370
|
+
pcbGridCols: z38.number().or(z38.string()).optional(),
|
|
16371
|
+
pcbGridRows: z38.number().or(z38.string()).optional(),
|
|
16372
|
+
pcbGridTemplateRows: z38.string().optional(),
|
|
16373
|
+
pcbGridTemplateColumns: z38.string().optional(),
|
|
16374
|
+
pcbGridTemplate: z38.string().optional(),
|
|
16375
|
+
pcbGridGap: z38.number().or(z38.string()).optional(),
|
|
16376
|
+
pcbGridRowGap: z38.number().or(z38.string()).optional(),
|
|
16377
|
+
pcbGridColumnGap: z38.number().or(z38.string()).optional(),
|
|
16378
|
+
pcbFlex: z38.boolean().or(z38.string()).optional(),
|
|
16379
|
+
pcbFlexGap: z38.number().or(z38.string()).optional(),
|
|
16380
|
+
pcbFlexDirection: z38.enum(["row", "column"]).optional(),
|
|
16381
|
+
pcbAlignItems: z38.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16382
|
+
pcbJustifyContent: z38.enum([
|
|
16365
16383
|
"start",
|
|
16366
16384
|
"center",
|
|
16367
16385
|
"end",
|
|
@@ -16370,25 +16388,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16370
16388
|
"space-around",
|
|
16371
16389
|
"space-evenly"
|
|
16372
16390
|
]).optional(),
|
|
16373
|
-
pcbFlexRow:
|
|
16374
|
-
pcbFlexColumn:
|
|
16375
|
-
pcbGap:
|
|
16376
|
-
pcbPack:
|
|
16377
|
-
pcbPackGap:
|
|
16378
|
-
schGrid:
|
|
16379
|
-
schGridCols:
|
|
16380
|
-
schGridRows:
|
|
16381
|
-
schGridTemplateRows:
|
|
16382
|
-
schGridTemplateColumns:
|
|
16383
|
-
schGridTemplate:
|
|
16384
|
-
schGridGap:
|
|
16385
|
-
schGridRowGap:
|
|
16386
|
-
schGridColumnGap:
|
|
16387
|
-
schFlex:
|
|
16388
|
-
schFlexGap:
|
|
16389
|
-
schFlexDirection:
|
|
16390
|
-
schAlignItems:
|
|
16391
|
-
schJustifyContent:
|
|
16391
|
+
pcbFlexRow: z38.boolean().optional(),
|
|
16392
|
+
pcbFlexColumn: z38.boolean().optional(),
|
|
16393
|
+
pcbGap: z38.number().or(z38.string()).optional(),
|
|
16394
|
+
pcbPack: z38.boolean().optional(),
|
|
16395
|
+
pcbPackGap: z38.number().or(z38.string()).optional(),
|
|
16396
|
+
schGrid: z38.boolean().optional(),
|
|
16397
|
+
schGridCols: z38.number().or(z38.string()).optional(),
|
|
16398
|
+
schGridRows: z38.number().or(z38.string()).optional(),
|
|
16399
|
+
schGridTemplateRows: z38.string().optional(),
|
|
16400
|
+
schGridTemplateColumns: z38.string().optional(),
|
|
16401
|
+
schGridTemplate: z38.string().optional(),
|
|
16402
|
+
schGridGap: z38.number().or(z38.string()).optional(),
|
|
16403
|
+
schGridRowGap: z38.number().or(z38.string()).optional(),
|
|
16404
|
+
schGridColumnGap: z38.number().or(z38.string()).optional(),
|
|
16405
|
+
schFlex: z38.boolean().or(z38.string()).optional(),
|
|
16406
|
+
schFlexGap: z38.number().or(z38.string()).optional(),
|
|
16407
|
+
schFlexDirection: z38.enum(["row", "column"]).optional(),
|
|
16408
|
+
schAlignItems: z38.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16409
|
+
schJustifyContent: z38.enum([
|
|
16392
16410
|
"start",
|
|
16393
16411
|
"center",
|
|
16394
16412
|
"end",
|
|
@@ -16397,11 +16415,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16397
16415
|
"space-around",
|
|
16398
16416
|
"space-evenly"
|
|
16399
16417
|
]).optional(),
|
|
16400
|
-
schFlexRow:
|
|
16401
|
-
schFlexColumn:
|
|
16402
|
-
schGap:
|
|
16403
|
-
schPack:
|
|
16404
|
-
schMatchAdapt:
|
|
16418
|
+
schFlexRow: z38.boolean().optional(),
|
|
16419
|
+
schFlexColumn: z38.boolean().optional(),
|
|
16420
|
+
schGap: z38.number().or(z38.string()).optional(),
|
|
16421
|
+
schPack: z38.boolean().optional(),
|
|
16422
|
+
schMatchAdapt: z38.boolean().optional(),
|
|
16405
16423
|
pcbWidth: length3.optional(),
|
|
16406
16424
|
pcbHeight: length3.optional(),
|
|
16407
16425
|
minTraceWidth: length3.optional(),
|
|
@@ -16424,40 +16442,40 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16424
16442
|
pcbPaddingBottom: length3.optional(),
|
|
16425
16443
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
16426
16444
|
});
|
|
16427
|
-
var partsEngine =
|
|
16445
|
+
var partsEngine = z38.custom((v) => "findPart" in v);
|
|
16428
16446
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
16429
16447
|
manualEdits: manual_edits_file.optional(),
|
|
16430
|
-
schAutoLayoutEnabled:
|
|
16431
|
-
schTraceAutoLabelEnabled:
|
|
16448
|
+
schAutoLayoutEnabled: z38.boolean().optional(),
|
|
16449
|
+
schTraceAutoLabelEnabled: z38.boolean().optional(),
|
|
16432
16450
|
schMaxTraceDistance: distance11.optional(),
|
|
16433
|
-
routingDisabled:
|
|
16434
|
-
bomDisabled:
|
|
16451
|
+
routingDisabled: z38.boolean().optional(),
|
|
16452
|
+
bomDisabled: z38.boolean().optional(),
|
|
16435
16453
|
defaultTraceWidth: length3.optional(),
|
|
16436
16454
|
...routingTolerances.shape,
|
|
16437
16455
|
nominalTraceWidth: length3.optional(),
|
|
16438
16456
|
partsEngine: partsEngine.optional(),
|
|
16439
|
-
_subcircuitCachingEnabled:
|
|
16440
|
-
pcbRouteCache:
|
|
16457
|
+
_subcircuitCachingEnabled: z38.boolean().optional(),
|
|
16458
|
+
pcbRouteCache: z38.custom((v) => true).optional(),
|
|
16441
16459
|
autorouter: autorouterProp.optional(),
|
|
16442
16460
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16443
|
-
autorouterVersion:
|
|
16444
|
-
square:
|
|
16445
|
-
emptyArea:
|
|
16446
|
-
filledArea:
|
|
16461
|
+
autorouterVersion: z38.enum(["v1", "v2", "v3", "v4", "v5", "v6", "latest"]).optional(),
|
|
16462
|
+
square: z38.boolean().optional(),
|
|
16463
|
+
emptyArea: z38.string().optional(),
|
|
16464
|
+
filledArea: z38.string().optional(),
|
|
16447
16465
|
width: distance11.optional(),
|
|
16448
16466
|
height: distance11.optional(),
|
|
16449
|
-
outline:
|
|
16467
|
+
outline: z38.array(point).optional(),
|
|
16450
16468
|
outlineOffsetX: distance11.optional(),
|
|
16451
16469
|
outlineOffsetY: distance11.optional(),
|
|
16452
|
-
circuitJson:
|
|
16453
|
-
exposedNets:
|
|
16454
|
-
exposeNets:
|
|
16470
|
+
circuitJson: z38.array(z38.any()).optional(),
|
|
16471
|
+
exposedNets: z38.array(z38.string()).optional(),
|
|
16472
|
+
exposeNets: z38.boolean().optional()
|
|
16455
16473
|
});
|
|
16456
16474
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
16457
|
-
subcircuit:
|
|
16475
|
+
subcircuit: z38.literal(true)
|
|
16458
16476
|
});
|
|
16459
|
-
var groupProps =
|
|
16460
|
-
baseGroupProps.extend({ subcircuit:
|
|
16477
|
+
var groupProps = z38.discriminatedUnion("subcircuit", [
|
|
16478
|
+
baseGroupProps.extend({ subcircuit: z38.literal(false).optional() }),
|
|
16461
16479
|
subcircuitGroupPropsWithBool
|
|
16462
16480
|
]);
|
|
16463
16481
|
expectTypesMatch(true);
|
|
@@ -16467,35 +16485,35 @@ expectTypesMatch(true);
|
|
|
16467
16485
|
expectTypesMatch(true);
|
|
16468
16486
|
|
|
16469
16487
|
// lib/components/board.ts
|
|
16470
|
-
var boardColor =
|
|
16488
|
+
var boardColor = z39.custom((value) => typeof value === "string");
|
|
16471
16489
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
16472
|
-
material:
|
|
16473
|
-
layers:
|
|
16474
|
-
|
|
16475
|
-
|
|
16476
|
-
|
|
16477
|
-
|
|
16478
|
-
|
|
16490
|
+
material: z39.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
16491
|
+
layers: z39.union([
|
|
16492
|
+
z39.literal(1),
|
|
16493
|
+
z39.literal(2),
|
|
16494
|
+
z39.literal(4),
|
|
16495
|
+
z39.literal(6),
|
|
16496
|
+
z39.literal(8)
|
|
16479
16497
|
]).default(2),
|
|
16480
16498
|
borderRadius: distance.optional(),
|
|
16481
16499
|
thickness: distance.optional(),
|
|
16482
16500
|
boardAnchorPosition: point.optional(),
|
|
16483
16501
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16484
16502
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
16485
|
-
title:
|
|
16503
|
+
title: z39.string().optional(),
|
|
16486
16504
|
solderMaskColor: boardColor.optional(),
|
|
16487
16505
|
topSolderMaskColor: boardColor.optional(),
|
|
16488
16506
|
bottomSolderMaskColor: boardColor.optional(),
|
|
16489
16507
|
silkscreenColor: boardColor.optional(),
|
|
16490
16508
|
topSilkscreenColor: boardColor.optional(),
|
|
16491
16509
|
bottomSilkscreenColor: boardColor.optional(),
|
|
16492
|
-
doubleSidedAssembly:
|
|
16493
|
-
schematicDisabled:
|
|
16510
|
+
doubleSidedAssembly: z39.boolean().optional().default(false),
|
|
16511
|
+
schematicDisabled: z39.boolean().optional()
|
|
16494
16512
|
});
|
|
16495
16513
|
expectTypesMatch(true);
|
|
16496
16514
|
|
|
16497
16515
|
// lib/components/panel.ts
|
|
16498
|
-
import { z as
|
|
16516
|
+
import { z as z40 } from "zod";
|
|
16499
16517
|
var panelProps = baseGroupProps.omit({
|
|
16500
16518
|
width: true,
|
|
16501
16519
|
height: true,
|
|
@@ -16504,25 +16522,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
16504
16522
|
}).extend({
|
|
16505
16523
|
width: distance.optional(),
|
|
16506
16524
|
height: distance.optional(),
|
|
16507
|
-
children:
|
|
16525
|
+
children: z40.any().optional(),
|
|
16508
16526
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16509
|
-
noSolderMask:
|
|
16510
|
-
panelizationMethod:
|
|
16527
|
+
noSolderMask: z40.boolean().optional(),
|
|
16528
|
+
panelizationMethod: z40.enum(["tab-routing", "none"]).optional(),
|
|
16511
16529
|
boardGap: distance.optional(),
|
|
16512
|
-
layoutMode:
|
|
16513
|
-
row:
|
|
16514
|
-
col:
|
|
16530
|
+
layoutMode: z40.enum(["grid", "pack", "none"]).optional(),
|
|
16531
|
+
row: z40.number().optional(),
|
|
16532
|
+
col: z40.number().optional(),
|
|
16515
16533
|
cellWidth: distance.optional(),
|
|
16516
16534
|
cellHeight: distance.optional(),
|
|
16517
16535
|
tabWidth: distance.optional(),
|
|
16518
16536
|
tabLength: distance.optional(),
|
|
16519
|
-
mouseBites:
|
|
16537
|
+
mouseBites: z40.boolean().optional(),
|
|
16520
16538
|
edgePadding: distance.optional(),
|
|
16521
16539
|
edgePaddingLeft: distance.optional(),
|
|
16522
16540
|
edgePaddingRight: distance.optional(),
|
|
16523
16541
|
edgePaddingTop: distance.optional(),
|
|
16524
16542
|
edgePaddingBottom: distance.optional(),
|
|
16525
|
-
_subcircuitCachingEnabled:
|
|
16543
|
+
_subcircuitCachingEnabled: z40.boolean().optional()
|
|
16526
16544
|
});
|
|
16527
16545
|
expectTypesMatch(true);
|
|
16528
16546
|
|
|
@@ -16545,37 +16563,37 @@ expectTypesMatch(true);
|
|
|
16545
16563
|
|
|
16546
16564
|
// lib/components/chip.ts
|
|
16547
16565
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
16548
|
-
import { z as
|
|
16549
|
-
var connectionTarget2 =
|
|
16550
|
-
var noConnectProp =
|
|
16551
|
-
var connectionsProp =
|
|
16552
|
-
var spicemodelElement =
|
|
16566
|
+
import { z as z43 } from "zod";
|
|
16567
|
+
var connectionTarget2 = z43.string().or(z43.array(z43.string()).readonly()).or(z43.array(z43.string()));
|
|
16568
|
+
var noConnectProp = z43.array(schematicPinLabel).readonly().or(z43.array(schematicPinLabel));
|
|
16569
|
+
var connectionsProp = z43.custom().pipe(z43.record(z43.string(), connectionTarget2));
|
|
16570
|
+
var spicemodelElement = z43.custom(
|
|
16553
16571
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
16554
16572
|
);
|
|
16555
|
-
var pinLabelsProp =
|
|
16573
|
+
var pinLabelsProp = z43.record(
|
|
16556
16574
|
schematicPinLabel,
|
|
16557
|
-
schematicPinLabel.or(
|
|
16575
|
+
schematicPinLabel.or(z43.array(schematicPinLabel).readonly()).or(z43.array(schematicPinLabel))
|
|
16558
16576
|
);
|
|
16559
16577
|
expectTypesMatch(true);
|
|
16560
|
-
var pinCompatibleVariant =
|
|
16561
|
-
manufacturerPartNumber:
|
|
16562
|
-
supplierPartNumber:
|
|
16578
|
+
var pinCompatibleVariant = z43.object({
|
|
16579
|
+
manufacturerPartNumber: z43.string().optional(),
|
|
16580
|
+
supplierPartNumber: z43.record(supplier_name2, z43.array(z43.string())).optional()
|
|
16563
16581
|
});
|
|
16564
16582
|
var chipProps = commonComponentProps.extend({
|
|
16565
|
-
manufacturerPartNumber:
|
|
16583
|
+
manufacturerPartNumber: z43.string().optional(),
|
|
16566
16584
|
pinLabels: pinLabelsProp.optional(),
|
|
16567
|
-
showPinAliases:
|
|
16568
|
-
pcbPinLabels:
|
|
16569
|
-
internallyConnectedPins:
|
|
16570
|
-
externallyConnectedPins:
|
|
16585
|
+
showPinAliases: z43.boolean().optional(),
|
|
16586
|
+
pcbPinLabels: z43.record(z43.string(), z43.string()).optional(),
|
|
16587
|
+
internallyConnectedPins: z43.array(z43.array(z43.union([z43.string(), z43.number()]))).optional(),
|
|
16588
|
+
externallyConnectedPins: z43.array(z43.array(z43.string())).optional(),
|
|
16571
16589
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
16572
16590
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16573
|
-
pinCompatibleVariants:
|
|
16591
|
+
pinCompatibleVariants: z43.array(pinCompatibleVariant).optional(),
|
|
16574
16592
|
schPinStyle: schematicPinStyle.optional(),
|
|
16575
16593
|
schPinSpacing: distance13.optional(),
|
|
16576
16594
|
schWidth: distance13.optional(),
|
|
16577
16595
|
schHeight: distance13.optional(),
|
|
16578
|
-
noSchematicRepresentation:
|
|
16596
|
+
noSchematicRepresentation: z43.boolean().optional(),
|
|
16579
16597
|
noConnect: noConnectProp.optional(),
|
|
16580
16598
|
connections: connectionsProp.optional(),
|
|
16581
16599
|
spiceModel: spicemodelElement.optional()
|
|
@@ -16589,75 +16607,75 @@ expectTypesMatch(true);
|
|
|
16589
16607
|
|
|
16590
16608
|
// lib/components/jumper.ts
|
|
16591
16609
|
import { distance as distance14 } from "circuit-json";
|
|
16592
|
-
import { z as
|
|
16610
|
+
import { z as z44 } from "zod";
|
|
16593
16611
|
var jumperProps = commonComponentProps.extend({
|
|
16594
|
-
manufacturerPartNumber:
|
|
16595
|
-
pinLabels:
|
|
16596
|
-
|
|
16597
|
-
schematicPinLabel.or(
|
|
16612
|
+
manufacturerPartNumber: z44.string().optional(),
|
|
16613
|
+
pinLabels: z44.record(
|
|
16614
|
+
z44.number().or(schematicPinLabel),
|
|
16615
|
+
schematicPinLabel.or(z44.array(schematicPinLabel))
|
|
16598
16616
|
).optional(),
|
|
16599
16617
|
schPinStyle: schematicPinStyle.optional(),
|
|
16600
16618
|
schPinSpacing: distance14.optional(),
|
|
16601
16619
|
schWidth: distance14.optional(),
|
|
16602
16620
|
schHeight: distance14.optional(),
|
|
16603
|
-
schDirection:
|
|
16621
|
+
schDirection: z44.enum(["left", "right"]).optional(),
|
|
16604
16622
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16605
16623
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
16606
|
-
pcbPinLabels:
|
|
16607
|
-
pinCount:
|
|
16608
|
-
internallyConnectedPins:
|
|
16609
|
-
connections:
|
|
16624
|
+
pcbPinLabels: z44.record(z44.string(), z44.string()).optional(),
|
|
16625
|
+
pinCount: z44.union([z44.literal(2), z44.literal(3)]).optional(),
|
|
16626
|
+
internallyConnectedPins: z44.array(z44.array(z44.union([z44.string(), z44.number()]))).optional(),
|
|
16627
|
+
connections: z44.custom().pipe(z44.record(z44.string(), connectionTarget)).optional()
|
|
16610
16628
|
});
|
|
16611
16629
|
expectTypesMatch(true);
|
|
16612
16630
|
|
|
16613
16631
|
// lib/components/solderjumper.ts
|
|
16614
|
-
import { z as
|
|
16632
|
+
import { z as z45 } from "zod";
|
|
16615
16633
|
var solderjumperProps = jumperProps.extend({
|
|
16616
|
-
bridgedPins:
|
|
16617
|
-
bridged:
|
|
16634
|
+
bridgedPins: z45.array(z45.array(z45.string())).optional(),
|
|
16635
|
+
bridged: z45.boolean().optional()
|
|
16618
16636
|
});
|
|
16619
16637
|
expectTypesMatch(true);
|
|
16620
16638
|
|
|
16621
16639
|
// lib/components/connector.ts
|
|
16622
|
-
import { z as
|
|
16640
|
+
import { z as z46 } from "zod";
|
|
16623
16641
|
var connectorProps = chipProps.extend({
|
|
16624
|
-
standard:
|
|
16642
|
+
standard: z46.enum(["usb_c", "m2"]).optional()
|
|
16625
16643
|
});
|
|
16626
16644
|
expectTypesMatch(true);
|
|
16627
16645
|
|
|
16628
16646
|
// lib/components/interconnect.ts
|
|
16629
|
-
import { z as
|
|
16647
|
+
import { z as z47 } from "zod";
|
|
16630
16648
|
var interconnectProps = commonComponentProps.extend({
|
|
16631
|
-
standard:
|
|
16632
|
-
pinLabels:
|
|
16633
|
-
|
|
16634
|
-
schematicPinLabel.or(
|
|
16649
|
+
standard: z47.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
16650
|
+
pinLabels: z47.record(
|
|
16651
|
+
z47.number().or(schematicPinLabel),
|
|
16652
|
+
schematicPinLabel.or(z47.array(schematicPinLabel))
|
|
16635
16653
|
).optional(),
|
|
16636
|
-
internallyConnectedPins:
|
|
16654
|
+
internallyConnectedPins: z47.array(z47.array(z47.union([z47.string(), z47.number()]))).optional()
|
|
16637
16655
|
});
|
|
16638
16656
|
expectTypesMatch(true);
|
|
16639
16657
|
|
|
16640
16658
|
// lib/components/fuse.ts
|
|
16641
|
-
import { z as
|
|
16659
|
+
import { z as z48 } from "zod";
|
|
16642
16660
|
var fusePinLabels = ["pin1", "pin2"];
|
|
16643
16661
|
var fuseProps = commonComponentProps.extend({
|
|
16644
|
-
currentRating:
|
|
16645
|
-
voltageRating:
|
|
16646
|
-
schShowRatings:
|
|
16662
|
+
currentRating: z48.union([z48.number(), z48.string()]),
|
|
16663
|
+
voltageRating: z48.union([z48.number(), z48.string()]).optional(),
|
|
16664
|
+
schShowRatings: z48.boolean().optional(),
|
|
16647
16665
|
schOrientation: schematicOrientation.optional(),
|
|
16648
|
-
connections:
|
|
16649
|
-
|
|
16650
|
-
|
|
16651
|
-
|
|
16652
|
-
|
|
16653
|
-
|
|
16666
|
+
connections: z48.record(
|
|
16667
|
+
z48.string(),
|
|
16668
|
+
z48.union([
|
|
16669
|
+
z48.string(),
|
|
16670
|
+
z48.array(z48.string()).readonly(),
|
|
16671
|
+
z48.array(z48.string())
|
|
16654
16672
|
])
|
|
16655
16673
|
).optional()
|
|
16656
16674
|
});
|
|
16657
16675
|
|
|
16658
16676
|
// lib/components/platedhole.ts
|
|
16659
16677
|
import { distance as distance15 } from "circuit-json";
|
|
16660
|
-
import { z as
|
|
16678
|
+
import { z as z49 } from "zod";
|
|
16661
16679
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
16662
16680
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
16663
16681
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -16689,26 +16707,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
16689
16707
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
16690
16708
|
return props;
|
|
16691
16709
|
};
|
|
16692
|
-
var distanceHiddenUndefined =
|
|
16710
|
+
var distanceHiddenUndefined = z49.custom().transform((a) => {
|
|
16693
16711
|
if (a === void 0) return void 0;
|
|
16694
16712
|
return distance15.parse(a);
|
|
16695
16713
|
});
|
|
16696
|
-
var platedHolePropsByShape =
|
|
16714
|
+
var platedHolePropsByShape = z49.discriminatedUnion("shape", [
|
|
16697
16715
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16698
|
-
name:
|
|
16699
|
-
connectsTo:
|
|
16700
|
-
shape:
|
|
16716
|
+
name: z49.string().optional(),
|
|
16717
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16718
|
+
shape: z49.literal("circle"),
|
|
16701
16719
|
holeDiameter: distance15,
|
|
16702
16720
|
outerDiameter: distance15,
|
|
16703
16721
|
padDiameter: distance15.optional().describe("Diameter of the copper pad"),
|
|
16704
16722
|
portHints: portHints.optional(),
|
|
16705
16723
|
solderMaskMargin: distance15.optional(),
|
|
16706
|
-
coveredWithSolderMask:
|
|
16724
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16707
16725
|
}),
|
|
16708
16726
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16709
|
-
name:
|
|
16710
|
-
connectsTo:
|
|
16711
|
-
shape:
|
|
16727
|
+
name: z49.string().optional(),
|
|
16728
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16729
|
+
shape: z49.literal("oval"),
|
|
16712
16730
|
outerWidth: distance15,
|
|
16713
16731
|
outerHeight: distance15,
|
|
16714
16732
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16717,13 +16735,13 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16717
16735
|
innerHeight: distance15.optional().describe("DEPRECATED use holeHeight"),
|
|
16718
16736
|
portHints: portHints.optional(),
|
|
16719
16737
|
solderMaskMargin: distance15.optional(),
|
|
16720
|
-
coveredWithSolderMask:
|
|
16738
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16721
16739
|
}),
|
|
16722
16740
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16723
|
-
name:
|
|
16724
|
-
connectsTo:
|
|
16725
|
-
shape:
|
|
16726
|
-
rectPad:
|
|
16741
|
+
name: z49.string().optional(),
|
|
16742
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16743
|
+
shape: z49.literal("pill"),
|
|
16744
|
+
rectPad: z49.boolean().optional(),
|
|
16727
16745
|
outerWidth: distance15,
|
|
16728
16746
|
outerHeight: distance15,
|
|
16729
16747
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -16734,30 +16752,30 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16734
16752
|
holeOffsetX: distance15.optional(),
|
|
16735
16753
|
holeOffsetY: distance15.optional(),
|
|
16736
16754
|
solderMaskMargin: distance15.optional(),
|
|
16737
|
-
coveredWithSolderMask:
|
|
16755
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16738
16756
|
}),
|
|
16739
16757
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16740
|
-
name:
|
|
16741
|
-
connectsTo:
|
|
16742
|
-
shape:
|
|
16758
|
+
name: z49.string().optional(),
|
|
16759
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16760
|
+
shape: z49.literal("circular_hole_with_rect_pad"),
|
|
16743
16761
|
holeDiameter: distance15,
|
|
16744
16762
|
rectPadWidth: distance15,
|
|
16745
16763
|
rectPadHeight: distance15,
|
|
16746
16764
|
rectBorderRadius: distance15.optional(),
|
|
16747
|
-
holeShape:
|
|
16748
|
-
padShape:
|
|
16765
|
+
holeShape: z49.literal("circle").optional(),
|
|
16766
|
+
padShape: z49.literal("rect").optional(),
|
|
16749
16767
|
portHints: portHints.optional(),
|
|
16750
16768
|
holeOffsetX: distance15.optional(),
|
|
16751
16769
|
holeOffsetY: distance15.optional(),
|
|
16752
16770
|
solderMaskMargin: distance15.optional(),
|
|
16753
|
-
coveredWithSolderMask:
|
|
16771
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16754
16772
|
}),
|
|
16755
16773
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
16756
|
-
name:
|
|
16757
|
-
connectsTo:
|
|
16758
|
-
shape:
|
|
16759
|
-
holeShape:
|
|
16760
|
-
padShape:
|
|
16774
|
+
name: z49.string().optional(),
|
|
16775
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16776
|
+
shape: z49.literal("pill_hole_with_rect_pad"),
|
|
16777
|
+
holeShape: z49.literal("pill").optional(),
|
|
16778
|
+
padShape: z49.literal("rect").optional(),
|
|
16761
16779
|
holeWidth: distance15,
|
|
16762
16780
|
holeHeight: distance15,
|
|
16763
16781
|
rectPadWidth: distance15,
|
|
@@ -16767,22 +16785,22 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16767
16785
|
holeOffsetX: distance15.optional(),
|
|
16768
16786
|
holeOffsetY: distance15.optional(),
|
|
16769
16787
|
solderMaskMargin: distance15.optional(),
|
|
16770
|
-
coveredWithSolderMask:
|
|
16788
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16771
16789
|
}),
|
|
16772
16790
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
16773
|
-
name:
|
|
16774
|
-
connectsTo:
|
|
16775
|
-
shape:
|
|
16776
|
-
holeShape:
|
|
16791
|
+
name: z49.string().optional(),
|
|
16792
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional(),
|
|
16793
|
+
shape: z49.literal("hole_with_polygon_pad"),
|
|
16794
|
+
holeShape: z49.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
16777
16795
|
holeDiameter: distance15.optional(),
|
|
16778
16796
|
holeWidth: distance15.optional(),
|
|
16779
16797
|
holeHeight: distance15.optional(),
|
|
16780
|
-
padOutline:
|
|
16798
|
+
padOutline: z49.array(point),
|
|
16781
16799
|
holeOffsetX: distance15,
|
|
16782
16800
|
holeOffsetY: distance15,
|
|
16783
16801
|
portHints: portHints.optional(),
|
|
16784
16802
|
solderMaskMargin: distance15.optional(),
|
|
16785
|
-
coveredWithSolderMask:
|
|
16803
|
+
coveredWithSolderMask: z49.boolean().optional()
|
|
16786
16804
|
})
|
|
16787
16805
|
]).transform((a) => {
|
|
16788
16806
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -16793,7 +16811,7 @@ var platedHolePropsByShape = z48.discriminatedUnion("shape", [
|
|
|
16793
16811
|
}
|
|
16794
16812
|
return a;
|
|
16795
16813
|
});
|
|
16796
|
-
var platedHoleProps =
|
|
16814
|
+
var platedHoleProps = z49.preprocess(
|
|
16797
16815
|
inferPlatedHoleShapeAndDefaults,
|
|
16798
16816
|
platedHolePropsByShape
|
|
16799
16817
|
);
|
|
@@ -16801,7 +16819,7 @@ expectTypesMatch(true);
|
|
|
16801
16819
|
|
|
16802
16820
|
// lib/components/resistor.ts
|
|
16803
16821
|
import { resistance } from "circuit-json";
|
|
16804
|
-
import { z as
|
|
16822
|
+
import { z as z50 } from "zod";
|
|
16805
16823
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
16806
16824
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
16807
16825
|
"01005",
|
|
@@ -16825,7 +16843,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
16825
16843
|
var resistorProps = commonComponentProps.extend({
|
|
16826
16844
|
footprint: resistorFootprintProp,
|
|
16827
16845
|
resistance,
|
|
16828
|
-
tolerance:
|
|
16846
|
+
tolerance: z50.union([z50.string(), z50.number()]).transform((val) => {
|
|
16829
16847
|
if (typeof val === "string") {
|
|
16830
16848
|
if (val.endsWith("%")) {
|
|
16831
16849
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -16834,12 +16852,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
16834
16852
|
}
|
|
16835
16853
|
return val;
|
|
16836
16854
|
}).pipe(
|
|
16837
|
-
|
|
16855
|
+
z50.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
16838
16856
|
).optional(),
|
|
16839
|
-
pullupFor:
|
|
16840
|
-
pullupTo:
|
|
16841
|
-
pulldownFor:
|
|
16842
|
-
pulldownTo:
|
|
16857
|
+
pullupFor: z50.string().optional(),
|
|
16858
|
+
pullupTo: z50.string().optional(),
|
|
16859
|
+
pulldownFor: z50.string().optional(),
|
|
16860
|
+
pulldownTo: z50.string().optional(),
|
|
16843
16861
|
schOrientation: schematicOrientation.optional(),
|
|
16844
16862
|
schSize: schematicSymbolSize.optional(),
|
|
16845
16863
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -16849,18 +16867,18 @@ expectTypesMatch(true);
|
|
|
16849
16867
|
|
|
16850
16868
|
// lib/components/potentiometer.ts
|
|
16851
16869
|
import { resistance as resistance2 } from "circuit-json";
|
|
16852
|
-
import { z as
|
|
16870
|
+
import { z as z51 } from "zod";
|
|
16853
16871
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
16854
16872
|
var potentiometerProps = commonComponentProps.extend({
|
|
16855
16873
|
maxResistance: resistance2,
|
|
16856
|
-
pinVariant:
|
|
16874
|
+
pinVariant: z51.enum(["two_pin", "three_pin"]).optional(),
|
|
16857
16875
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
16858
16876
|
});
|
|
16859
16877
|
expectTypesMatch(true);
|
|
16860
16878
|
|
|
16861
16879
|
// lib/components/crystal.ts
|
|
16862
16880
|
import { capacitance, distance as distance16, frequency } from "circuit-json";
|
|
16863
|
-
import { z as
|
|
16881
|
+
import { z as z52 } from "zod";
|
|
16864
16882
|
var crystalPins = [
|
|
16865
16883
|
"pin1",
|
|
16866
16884
|
"left",
|
|
@@ -16873,9 +16891,9 @@ var crystalProps = commonComponentProps.extend({
|
|
|
16873
16891
|
frequency,
|
|
16874
16892
|
loadCapacitance: capacitance,
|
|
16875
16893
|
maxTraceLength: distance16.optional(),
|
|
16876
|
-
manufacturerPartNumber:
|
|
16877
|
-
mpn:
|
|
16878
|
-
pinVariant:
|
|
16894
|
+
manufacturerPartNumber: z52.string().optional(),
|
|
16895
|
+
mpn: z52.string().optional(),
|
|
16896
|
+
pinVariant: z52.enum(["two_pin", "four_pin"]).optional(),
|
|
16879
16897
|
schOrientation: schematicOrientation.optional(),
|
|
16880
16898
|
connections: createConnectionsProp(crystalPins).optional()
|
|
16881
16899
|
});
|
|
@@ -16883,34 +16901,34 @@ expectTypesMatch(true);
|
|
|
16883
16901
|
|
|
16884
16902
|
// lib/components/resonator.ts
|
|
16885
16903
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
16886
|
-
import { z as
|
|
16904
|
+
import { z as z53 } from "zod";
|
|
16887
16905
|
var resonatorProps = commonComponentProps.extend({
|
|
16888
16906
|
frequency: frequency2,
|
|
16889
16907
|
loadCapacitance: capacitance2,
|
|
16890
|
-
pinVariant:
|
|
16908
|
+
pinVariant: z53.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
16891
16909
|
});
|
|
16892
16910
|
expectTypesMatch(true);
|
|
16893
16911
|
|
|
16894
16912
|
// lib/components/stampboard.ts
|
|
16895
16913
|
import { distance as distance17 } from "circuit-json";
|
|
16896
|
-
import { z as
|
|
16914
|
+
import { z as z54 } from "zod";
|
|
16897
16915
|
var stampboardProps = boardProps.extend({
|
|
16898
|
-
leftPinCount:
|
|
16899
|
-
rightPinCount:
|
|
16900
|
-
topPinCount:
|
|
16901
|
-
bottomPinCount:
|
|
16902
|
-
leftPins:
|
|
16903
|
-
rightPins:
|
|
16904
|
-
topPins:
|
|
16905
|
-
bottomPins:
|
|
16916
|
+
leftPinCount: z54.number().optional(),
|
|
16917
|
+
rightPinCount: z54.number().optional(),
|
|
16918
|
+
topPinCount: z54.number().optional(),
|
|
16919
|
+
bottomPinCount: z54.number().optional(),
|
|
16920
|
+
leftPins: z54.array(z54.string()).optional(),
|
|
16921
|
+
rightPins: z54.array(z54.string()).optional(),
|
|
16922
|
+
topPins: z54.array(z54.string()).optional(),
|
|
16923
|
+
bottomPins: z54.array(z54.string()).optional(),
|
|
16906
16924
|
pinPitch: distance17.optional(),
|
|
16907
|
-
innerHoles:
|
|
16925
|
+
innerHoles: z54.boolean().optional()
|
|
16908
16926
|
});
|
|
16909
16927
|
expectTypesMatch(true);
|
|
16910
16928
|
|
|
16911
16929
|
// lib/components/capacitor.ts
|
|
16912
16930
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
16913
|
-
import { z as
|
|
16931
|
+
import { z as z55 } from "zod";
|
|
16914
16932
|
var capacitorPinLabels = [
|
|
16915
16933
|
"pin1",
|
|
16916
16934
|
"pin2",
|
|
@@ -16922,13 +16940,13 @@ var capacitorPinLabels = [
|
|
|
16922
16940
|
var capacitorProps = commonComponentProps.extend({
|
|
16923
16941
|
capacitance: capacitance3,
|
|
16924
16942
|
maxVoltageRating: voltage.optional(),
|
|
16925
|
-
schShowRatings:
|
|
16926
|
-
polarized:
|
|
16927
|
-
decouplingFor:
|
|
16928
|
-
decouplingTo:
|
|
16929
|
-
bypassFor:
|
|
16930
|
-
bypassTo:
|
|
16931
|
-
maxDecouplingTraceLength:
|
|
16943
|
+
schShowRatings: z55.boolean().optional().default(false),
|
|
16944
|
+
polarized: z55.boolean().optional().default(false),
|
|
16945
|
+
decouplingFor: z55.string().optional(),
|
|
16946
|
+
decouplingTo: z55.string().optional(),
|
|
16947
|
+
bypassFor: z55.string().optional(),
|
|
16948
|
+
bypassTo: z55.string().optional(),
|
|
16949
|
+
maxDecouplingTraceLength: z55.number().optional(),
|
|
16932
16950
|
schOrientation: schematicOrientation.optional(),
|
|
16933
16951
|
schSize: schematicSymbolSize.optional(),
|
|
16934
16952
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -16938,14 +16956,14 @@ expectTypesMatch(true);
|
|
|
16938
16956
|
|
|
16939
16957
|
// lib/components/net.ts
|
|
16940
16958
|
import { distance as distance18 } from "circuit-json";
|
|
16941
|
-
import { z as
|
|
16942
|
-
var netProps =
|
|
16943
|
-
name:
|
|
16944
|
-
connectsTo:
|
|
16945
|
-
routingPhaseIndex:
|
|
16946
|
-
highlightColor:
|
|
16947
|
-
isPowerNet:
|
|
16948
|
-
isGroundNet:
|
|
16959
|
+
import { z as z56 } from "zod";
|
|
16960
|
+
var netProps = z56.object({
|
|
16961
|
+
name: z56.string(),
|
|
16962
|
+
connectsTo: z56.string().or(z56.array(z56.string())).optional(),
|
|
16963
|
+
routingPhaseIndex: z56.number().nullable().optional(),
|
|
16964
|
+
highlightColor: z56.string().optional(),
|
|
16965
|
+
isPowerNet: z56.boolean().optional(),
|
|
16966
|
+
isGroundNet: z56.boolean().optional(),
|
|
16949
16967
|
nominalTraceWidth: distance18.optional()
|
|
16950
16968
|
});
|
|
16951
16969
|
expectTypesMatch(true);
|
|
@@ -16959,55 +16977,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
16959
16977
|
expectTypesMatch(true);
|
|
16960
16978
|
|
|
16961
16979
|
// lib/components/constrainedlayout.ts
|
|
16962
|
-
import { z as
|
|
16963
|
-
var constrainedLayoutProps =
|
|
16964
|
-
name:
|
|
16965
|
-
pcbOnly:
|
|
16966
|
-
schOnly:
|
|
16980
|
+
import { z as z58 } from "zod";
|
|
16981
|
+
var constrainedLayoutProps = z58.object({
|
|
16982
|
+
name: z58.string().optional(),
|
|
16983
|
+
pcbOnly: z58.boolean().optional(),
|
|
16984
|
+
schOnly: z58.boolean().optional()
|
|
16967
16985
|
});
|
|
16968
16986
|
expectTypesMatch(true);
|
|
16969
16987
|
|
|
16970
16988
|
// lib/components/constraint.ts
|
|
16971
|
-
import { z as
|
|
16972
|
-
var pcbXDistConstraintProps =
|
|
16973
|
-
pcb:
|
|
16989
|
+
import { z as z59 } from "zod";
|
|
16990
|
+
var pcbXDistConstraintProps = z59.object({
|
|
16991
|
+
pcb: z59.literal(true).optional(),
|
|
16974
16992
|
xDist: distance,
|
|
16975
|
-
left:
|
|
16976
|
-
right:
|
|
16977
|
-
edgeToEdge:
|
|
16978
|
-
centerToCenter:
|
|
16993
|
+
left: z59.string(),
|
|
16994
|
+
right: z59.string(),
|
|
16995
|
+
edgeToEdge: z59.literal(true).optional(),
|
|
16996
|
+
centerToCenter: z59.literal(true).optional()
|
|
16979
16997
|
});
|
|
16980
16998
|
expectTypesMatch(
|
|
16981
16999
|
true
|
|
16982
17000
|
);
|
|
16983
|
-
var pcbYDistConstraintProps =
|
|
16984
|
-
pcb:
|
|
17001
|
+
var pcbYDistConstraintProps = z59.object({
|
|
17002
|
+
pcb: z59.literal(true).optional(),
|
|
16985
17003
|
yDist: distance,
|
|
16986
|
-
top:
|
|
16987
|
-
bottom:
|
|
16988
|
-
edgeToEdge:
|
|
16989
|
-
centerToCenter:
|
|
17004
|
+
top: z59.string(),
|
|
17005
|
+
bottom: z59.string(),
|
|
17006
|
+
edgeToEdge: z59.literal(true).optional(),
|
|
17007
|
+
centerToCenter: z59.literal(true).optional()
|
|
16990
17008
|
});
|
|
16991
17009
|
expectTypesMatch(
|
|
16992
17010
|
true
|
|
16993
17011
|
);
|
|
16994
|
-
var pcbSameYConstraintProps =
|
|
16995
|
-
pcb:
|
|
16996
|
-
sameY:
|
|
16997
|
-
for:
|
|
17012
|
+
var pcbSameYConstraintProps = z59.object({
|
|
17013
|
+
pcb: z59.literal(true).optional(),
|
|
17014
|
+
sameY: z59.literal(true).optional(),
|
|
17015
|
+
for: z59.array(z59.string())
|
|
16998
17016
|
});
|
|
16999
17017
|
expectTypesMatch(
|
|
17000
17018
|
true
|
|
17001
17019
|
);
|
|
17002
|
-
var pcbSameXConstraintProps =
|
|
17003
|
-
pcb:
|
|
17004
|
-
sameX:
|
|
17005
|
-
for:
|
|
17020
|
+
var pcbSameXConstraintProps = z59.object({
|
|
17021
|
+
pcb: z59.literal(true).optional(),
|
|
17022
|
+
sameX: z59.literal(true).optional(),
|
|
17023
|
+
for: z59.array(z59.string())
|
|
17006
17024
|
});
|
|
17007
17025
|
expectTypesMatch(
|
|
17008
17026
|
true
|
|
17009
17027
|
);
|
|
17010
|
-
var constraintProps =
|
|
17028
|
+
var constraintProps = z59.union([
|
|
17011
17029
|
pcbXDistConstraintProps,
|
|
17012
17030
|
pcbYDistConstraintProps,
|
|
17013
17031
|
pcbSameYConstraintProps,
|
|
@@ -17016,13 +17034,13 @@ var constraintProps = z58.union([
|
|
|
17016
17034
|
expectTypesMatch(true);
|
|
17017
17035
|
|
|
17018
17036
|
// lib/components/cutout.ts
|
|
17019
|
-
import { z as
|
|
17037
|
+
import { z as z60 } from "zod";
|
|
17020
17038
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17021
17039
|
layer: true,
|
|
17022
17040
|
pcbRotation: true
|
|
17023
17041
|
}).extend({
|
|
17024
|
-
name:
|
|
17025
|
-
shape:
|
|
17042
|
+
name: z60.string().optional(),
|
|
17043
|
+
shape: z60.literal("rect"),
|
|
17026
17044
|
width: distance,
|
|
17027
17045
|
height: distance
|
|
17028
17046
|
});
|
|
@@ -17031,8 +17049,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17031
17049
|
layer: true,
|
|
17032
17050
|
pcbRotation: true
|
|
17033
17051
|
}).extend({
|
|
17034
|
-
name:
|
|
17035
|
-
shape:
|
|
17052
|
+
name: z60.string().optional(),
|
|
17053
|
+
shape: z60.literal("circle"),
|
|
17036
17054
|
radius: distance
|
|
17037
17055
|
});
|
|
17038
17056
|
expectTypesMatch(true);
|
|
@@ -17040,36 +17058,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17040
17058
|
layer: true,
|
|
17041
17059
|
pcbRotation: true
|
|
17042
17060
|
}).extend({
|
|
17043
|
-
name:
|
|
17044
|
-
shape:
|
|
17045
|
-
points:
|
|
17061
|
+
name: z60.string().optional(),
|
|
17062
|
+
shape: z60.literal("polygon"),
|
|
17063
|
+
points: z60.array(point)
|
|
17046
17064
|
});
|
|
17047
17065
|
expectTypesMatch(true);
|
|
17048
|
-
var cutoutProps =
|
|
17066
|
+
var cutoutProps = z60.discriminatedUnion("shape", [
|
|
17049
17067
|
rectCutoutProps,
|
|
17050
17068
|
circleCutoutProps,
|
|
17051
17069
|
polygonCutoutProps
|
|
17052
17070
|
]);
|
|
17053
17071
|
|
|
17054
17072
|
// lib/components/drc-check.ts
|
|
17055
|
-
import { z as
|
|
17056
|
-
var drcCheckProps =
|
|
17057
|
-
name:
|
|
17073
|
+
import { z as z61 } from "zod";
|
|
17074
|
+
var drcCheckProps = z61.object({
|
|
17075
|
+
name: z61.string().optional(),
|
|
17058
17076
|
checkFn: customDrcCheckFn
|
|
17059
17077
|
});
|
|
17060
17078
|
expectTypesMatch(true);
|
|
17061
17079
|
|
|
17062
17080
|
// lib/components/smtpad.ts
|
|
17063
|
-
import { z as
|
|
17081
|
+
import { z as z62 } from "zod";
|
|
17064
17082
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17065
|
-
name:
|
|
17066
|
-
shape:
|
|
17083
|
+
name: z62.string().optional(),
|
|
17084
|
+
shape: z62.literal("rect"),
|
|
17067
17085
|
width: distance,
|
|
17068
17086
|
height: distance,
|
|
17069
17087
|
rectBorderRadius: distance.optional(),
|
|
17070
17088
|
cornerRadius: distance.optional(),
|
|
17071
17089
|
portHints: portHints.optional(),
|
|
17072
|
-
coveredWithSolderMask:
|
|
17090
|
+
coveredWithSolderMask: z62.boolean().optional(),
|
|
17073
17091
|
solderMaskMargin: distance.optional(),
|
|
17074
17092
|
solderMaskMarginLeft: distance.optional(),
|
|
17075
17093
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17078,14 +17096,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17078
17096
|
});
|
|
17079
17097
|
expectTypesMatch(true);
|
|
17080
17098
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17081
|
-
name:
|
|
17082
|
-
shape:
|
|
17099
|
+
name: z62.string().optional(),
|
|
17100
|
+
shape: z62.literal("rotated_rect"),
|
|
17083
17101
|
width: distance,
|
|
17084
17102
|
height: distance,
|
|
17085
|
-
ccwRotation:
|
|
17103
|
+
ccwRotation: z62.number(),
|
|
17086
17104
|
cornerRadius: distance.optional(),
|
|
17087
17105
|
portHints: portHints.optional(),
|
|
17088
|
-
coveredWithSolderMask:
|
|
17106
|
+
coveredWithSolderMask: z62.boolean().optional(),
|
|
17089
17107
|
solderMaskMargin: distance.optional(),
|
|
17090
17108
|
solderMaskMarginLeft: distance.optional(),
|
|
17091
17109
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17094,35 +17112,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17094
17112
|
});
|
|
17095
17113
|
expectTypesMatch(true);
|
|
17096
17114
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17097
|
-
name:
|
|
17098
|
-
shape:
|
|
17115
|
+
name: z62.string().optional(),
|
|
17116
|
+
shape: z62.literal("circle"),
|
|
17099
17117
|
radius: distance,
|
|
17100
17118
|
portHints: portHints.optional(),
|
|
17101
|
-
coveredWithSolderMask:
|
|
17119
|
+
coveredWithSolderMask: z62.boolean().optional(),
|
|
17102
17120
|
solderMaskMargin: distance.optional()
|
|
17103
17121
|
});
|
|
17104
17122
|
expectTypesMatch(true);
|
|
17105
17123
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17106
|
-
name:
|
|
17107
|
-
shape:
|
|
17124
|
+
name: z62.string().optional(),
|
|
17125
|
+
shape: z62.literal("pill"),
|
|
17108
17126
|
width: distance,
|
|
17109
17127
|
height: distance,
|
|
17110
17128
|
radius: distance,
|
|
17111
17129
|
portHints: portHints.optional(),
|
|
17112
|
-
coveredWithSolderMask:
|
|
17130
|
+
coveredWithSolderMask: z62.boolean().optional(),
|
|
17113
17131
|
solderMaskMargin: distance.optional()
|
|
17114
17132
|
});
|
|
17115
17133
|
expectTypesMatch(true);
|
|
17116
17134
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17117
|
-
name:
|
|
17118
|
-
shape:
|
|
17119
|
-
points:
|
|
17135
|
+
name: z62.string().optional(),
|
|
17136
|
+
shape: z62.literal("polygon"),
|
|
17137
|
+
points: z62.array(point),
|
|
17120
17138
|
portHints: portHints.optional(),
|
|
17121
|
-
coveredWithSolderMask:
|
|
17139
|
+
coveredWithSolderMask: z62.boolean().optional(),
|
|
17122
17140
|
solderMaskMargin: distance.optional()
|
|
17123
17141
|
});
|
|
17124
17142
|
expectTypesMatch(true);
|
|
17125
|
-
var smtPadProps =
|
|
17143
|
+
var smtPadProps = z62.discriminatedUnion("shape", [
|
|
17126
17144
|
circleSmtPadProps,
|
|
17127
17145
|
rectSmtPadProps,
|
|
17128
17146
|
rotatedRectSmtPadProps,
|
|
@@ -17132,63 +17150,63 @@ var smtPadProps = z61.discriminatedUnion("shape", [
|
|
|
17132
17150
|
expectTypesMatch(true);
|
|
17133
17151
|
|
|
17134
17152
|
// lib/components/solderpaste.ts
|
|
17135
|
-
import { z as
|
|
17153
|
+
import { z as z63 } from "zod";
|
|
17136
17154
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17137
|
-
shape:
|
|
17155
|
+
shape: z63.literal("rect"),
|
|
17138
17156
|
width: distance,
|
|
17139
17157
|
height: distance
|
|
17140
17158
|
});
|
|
17141
17159
|
expectTypesMatch(true);
|
|
17142
17160
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17143
|
-
shape:
|
|
17161
|
+
shape: z63.literal("circle"),
|
|
17144
17162
|
radius: distance
|
|
17145
17163
|
});
|
|
17146
17164
|
expectTypesMatch(true);
|
|
17147
|
-
var solderPasteProps =
|
|
17165
|
+
var solderPasteProps = z63.union([
|
|
17148
17166
|
circleSolderPasteProps,
|
|
17149
17167
|
rectSolderPasteProps
|
|
17150
17168
|
]);
|
|
17151
17169
|
expectTypesMatch(true);
|
|
17152
17170
|
|
|
17153
17171
|
// lib/components/hole.ts
|
|
17154
|
-
import { z as
|
|
17172
|
+
import { z as z64 } from "zod";
|
|
17155
17173
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17156
|
-
name:
|
|
17157
|
-
shape:
|
|
17174
|
+
name: z64.string().optional(),
|
|
17175
|
+
shape: z64.literal("circle").optional(),
|
|
17158
17176
|
diameter: distance.optional(),
|
|
17159
17177
|
radius: distance.optional(),
|
|
17160
17178
|
solderMaskMargin: distance.optional(),
|
|
17161
|
-
coveredWithSolderMask:
|
|
17179
|
+
coveredWithSolderMask: z64.boolean().optional()
|
|
17162
17180
|
}).transform((d) => ({
|
|
17163
17181
|
...d,
|
|
17164
17182
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17165
17183
|
radius: d.radius ?? d.diameter / 2
|
|
17166
17184
|
}));
|
|
17167
17185
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17168
|
-
name:
|
|
17169
|
-
shape:
|
|
17186
|
+
name: z64.string().optional(),
|
|
17187
|
+
shape: z64.literal("pill"),
|
|
17170
17188
|
width: distance,
|
|
17171
17189
|
height: distance,
|
|
17172
17190
|
solderMaskMargin: distance.optional(),
|
|
17173
|
-
coveredWithSolderMask:
|
|
17191
|
+
coveredWithSolderMask: z64.boolean().optional()
|
|
17174
17192
|
});
|
|
17175
17193
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17176
|
-
name:
|
|
17177
|
-
shape:
|
|
17194
|
+
name: z64.string().optional(),
|
|
17195
|
+
shape: z64.literal("oval"),
|
|
17178
17196
|
width: distance,
|
|
17179
17197
|
height: distance,
|
|
17180
17198
|
solderMaskMargin: distance.optional(),
|
|
17181
|
-
coveredWithSolderMask:
|
|
17199
|
+
coveredWithSolderMask: z64.boolean().optional()
|
|
17182
17200
|
});
|
|
17183
17201
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17184
|
-
name:
|
|
17185
|
-
shape:
|
|
17202
|
+
name: z64.string().optional(),
|
|
17203
|
+
shape: z64.literal("rect"),
|
|
17186
17204
|
width: distance,
|
|
17187
17205
|
height: distance,
|
|
17188
17206
|
solderMaskMargin: distance.optional(),
|
|
17189
|
-
coveredWithSolderMask:
|
|
17207
|
+
coveredWithSolderMask: z64.boolean().optional()
|
|
17190
17208
|
});
|
|
17191
|
-
var holeProps =
|
|
17209
|
+
var holeProps = z64.union([
|
|
17192
17210
|
circleHoleProps,
|
|
17193
17211
|
pillHoleProps,
|
|
17194
17212
|
ovalHoleProps,
|
|
@@ -17198,57 +17216,57 @@ expectTypesMatch(true);
|
|
|
17198
17216
|
|
|
17199
17217
|
// lib/components/trace.ts
|
|
17200
17218
|
import { distance as distance19, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17201
|
-
import { z as
|
|
17202
|
-
var portRef =
|
|
17203
|
-
|
|
17204
|
-
|
|
17219
|
+
import { z as z65 } from "zod";
|
|
17220
|
+
var portRef = z65.union([
|
|
17221
|
+
z65.string(),
|
|
17222
|
+
z65.custom(
|
|
17205
17223
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17206
17224
|
)
|
|
17207
17225
|
]);
|
|
17208
17226
|
var pcbPathPoint = point.extend({
|
|
17209
|
-
via:
|
|
17227
|
+
via: z65.boolean().optional(),
|
|
17210
17228
|
fromLayer: layer_ref4.optional(),
|
|
17211
17229
|
toLayer: layer_ref4.optional()
|
|
17212
17230
|
}).superRefine((value, ctx) => {
|
|
17213
17231
|
if (value.via) {
|
|
17214
17232
|
if (!value.toLayer) {
|
|
17215
17233
|
ctx.addIssue({
|
|
17216
|
-
code:
|
|
17234
|
+
code: z65.ZodIssueCode.custom,
|
|
17217
17235
|
message: "toLayer is required when via is true",
|
|
17218
17236
|
path: ["toLayer"]
|
|
17219
17237
|
});
|
|
17220
17238
|
}
|
|
17221
17239
|
} else if (value.fromLayer || value.toLayer) {
|
|
17222
17240
|
ctx.addIssue({
|
|
17223
|
-
code:
|
|
17241
|
+
code: z65.ZodIssueCode.custom,
|
|
17224
17242
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
17225
17243
|
path: ["via"]
|
|
17226
17244
|
});
|
|
17227
17245
|
}
|
|
17228
17246
|
});
|
|
17229
|
-
var pcbPath =
|
|
17230
|
-
var baseTraceProps =
|
|
17231
|
-
key:
|
|
17232
|
-
name:
|
|
17233
|
-
displayName:
|
|
17247
|
+
var pcbPath = z65.array(z65.union([pcbPathPoint, z65.string()]));
|
|
17248
|
+
var baseTraceProps = z65.object({
|
|
17249
|
+
key: z65.string().optional(),
|
|
17250
|
+
name: z65.string().optional(),
|
|
17251
|
+
displayName: z65.string().optional(),
|
|
17234
17252
|
thickness: distance19.optional(),
|
|
17235
17253
|
width: distance19.optional().describe("Alias for trace thickness"),
|
|
17236
|
-
schematicRouteHints:
|
|
17237
|
-
pcbRouteHints:
|
|
17238
|
-
pcbPathRelativeTo:
|
|
17254
|
+
schematicRouteHints: z65.array(point).optional(),
|
|
17255
|
+
pcbRouteHints: z65.array(route_hint_point2).optional(),
|
|
17256
|
+
pcbPathRelativeTo: z65.string().optional(),
|
|
17239
17257
|
pcbPath: pcbPath.optional(),
|
|
17240
|
-
pcbPaths:
|
|
17241
|
-
routingPhaseIndex:
|
|
17242
|
-
pcbStraightLine:
|
|
17243
|
-
schDisplayLabel:
|
|
17244
|
-
schStroke:
|
|
17245
|
-
highlightColor:
|
|
17258
|
+
pcbPaths: z65.array(pcbPath).optional(),
|
|
17259
|
+
routingPhaseIndex: z65.number().nullable().optional(),
|
|
17260
|
+
pcbStraightLine: z65.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17261
|
+
schDisplayLabel: z65.string().optional(),
|
|
17262
|
+
schStroke: z65.string().optional(),
|
|
17263
|
+
highlightColor: z65.string().optional(),
|
|
17246
17264
|
maxLength: distance19.optional(),
|
|
17247
|
-
connectsTo:
|
|
17265
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional()
|
|
17248
17266
|
});
|
|
17249
|
-
var traceProps =
|
|
17267
|
+
var traceProps = z65.union([
|
|
17250
17268
|
baseTraceProps.extend({
|
|
17251
|
-
path:
|
|
17269
|
+
path: z65.array(portRef)
|
|
17252
17270
|
}),
|
|
17253
17271
|
baseTraceProps.extend({
|
|
17254
17272
|
from: portRef,
|
|
@@ -17261,19 +17279,19 @@ var traceProps = z64.union([
|
|
|
17261
17279
|
]);
|
|
17262
17280
|
|
|
17263
17281
|
// lib/components/differentialpair.ts
|
|
17264
|
-
import { z as
|
|
17265
|
-
var differentialPairProps =
|
|
17266
|
-
name:
|
|
17267
|
-
positiveConnection:
|
|
17268
|
-
negativeConnection:
|
|
17269
|
-
maxLengthSkew:
|
|
17282
|
+
import { z as z66 } from "zod";
|
|
17283
|
+
var differentialPairProps = z66.object({
|
|
17284
|
+
name: z66.string().optional(),
|
|
17285
|
+
positiveConnection: z66.string(),
|
|
17286
|
+
negativeConnection: z66.string(),
|
|
17287
|
+
maxLengthSkew: z66.number().min(0).max(1).optional()
|
|
17270
17288
|
});
|
|
17271
17289
|
expectTypesMatch(true);
|
|
17272
17290
|
|
|
17273
17291
|
// lib/components/footprint.ts
|
|
17274
17292
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17275
|
-
import { z as
|
|
17276
|
-
var footprintInsertionDirection =
|
|
17293
|
+
import { z as z67 } from "zod";
|
|
17294
|
+
var footprintInsertionDirection = z67.enum([
|
|
17277
17295
|
"from_above",
|
|
17278
17296
|
"from_left",
|
|
17279
17297
|
"from_right",
|
|
@@ -17281,11 +17299,11 @@ var footprintInsertionDirection = z66.enum([
|
|
|
17281
17299
|
"from_back"
|
|
17282
17300
|
]);
|
|
17283
17301
|
expectTypesMatch(true);
|
|
17284
|
-
var footprintProps =
|
|
17285
|
-
children:
|
|
17286
|
-
name:
|
|
17302
|
+
var footprintProps = z67.object({
|
|
17303
|
+
children: z67.any().optional(),
|
|
17304
|
+
name: z67.string().optional(),
|
|
17287
17305
|
originalLayer: layer_ref5.default("top").optional(),
|
|
17288
|
-
circuitJson:
|
|
17306
|
+
circuitJson: z67.array(z67.any()).optional(),
|
|
17289
17307
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
17290
17308
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
17291
17309
|
"Direction a cable or mating part is inserted into this footprint in its unrotated orientation."
|
|
@@ -17294,19 +17312,19 @@ var footprintProps = z66.object({
|
|
|
17294
17312
|
expectTypesMatch(true);
|
|
17295
17313
|
|
|
17296
17314
|
// lib/components/symbol.ts
|
|
17297
|
-
import { z as
|
|
17298
|
-
var symbolProps =
|
|
17299
|
-
originalFacingDirection:
|
|
17315
|
+
import { z as z68 } from "zod";
|
|
17316
|
+
var symbolProps = z68.object({
|
|
17317
|
+
originalFacingDirection: z68.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
17300
17318
|
width: distance.optional(),
|
|
17301
17319
|
height: distance.optional(),
|
|
17302
|
-
name:
|
|
17320
|
+
name: z68.string().optional()
|
|
17303
17321
|
});
|
|
17304
17322
|
expectTypesMatch(true);
|
|
17305
17323
|
|
|
17306
17324
|
// lib/components/battery.ts
|
|
17307
17325
|
import { voltage as voltage2 } from "circuit-json";
|
|
17308
|
-
import { z as
|
|
17309
|
-
var capacity =
|
|
17326
|
+
import { z as z69 } from "zod";
|
|
17327
|
+
var capacity = z69.number().or(z69.string().endsWith("mAh")).transform((v) => {
|
|
17310
17328
|
if (typeof v === "string") {
|
|
17311
17329
|
const valString = v.replace("mAh", "");
|
|
17312
17330
|
const num = Number.parseFloat(valString);
|
|
@@ -17320,14 +17338,14 @@ var capacity = z68.number().or(z68.string().endsWith("mAh")).transform((v) => {
|
|
|
17320
17338
|
var batteryProps = commonComponentProps.extend({
|
|
17321
17339
|
capacity: capacity.optional(),
|
|
17322
17340
|
voltage: voltage2.optional(),
|
|
17323
|
-
standard:
|
|
17341
|
+
standard: z69.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
17324
17342
|
schOrientation: schematicOrientation.optional()
|
|
17325
17343
|
});
|
|
17326
17344
|
var batteryPins = lrPolarPins;
|
|
17327
17345
|
expectTypesMatch(true);
|
|
17328
17346
|
|
|
17329
17347
|
// lib/components/mountedboard.ts
|
|
17330
|
-
import { z as
|
|
17348
|
+
import { z as z70 } from "zod";
|
|
17331
17349
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
17332
17350
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
17333
17351
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -17339,7 +17357,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
17339
17357
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
17340
17358
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
17341
17359
|
boardToBoardDistance: distance.optional(),
|
|
17342
|
-
mountOrientation:
|
|
17360
|
+
mountOrientation: z70.enum(["faceDown", "faceUp"]).optional()
|
|
17343
17361
|
});
|
|
17344
17362
|
expectTypesMatch(true);
|
|
17345
17363
|
|
|
@@ -17347,29 +17365,29 @@ expectTypesMatch(true);
|
|
|
17347
17365
|
import { distance as distance20 } from "circuit-json";
|
|
17348
17366
|
|
|
17349
17367
|
// lib/common/pcbOrientation.ts
|
|
17350
|
-
import { z as
|
|
17351
|
-
var pcbOrientation =
|
|
17368
|
+
import { z as z71 } from "zod";
|
|
17369
|
+
var pcbOrientation = z71.enum(["vertical", "horizontal"]).describe(
|
|
17352
17370
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
17353
17371
|
);
|
|
17354
17372
|
expectTypesMatch(true);
|
|
17355
17373
|
|
|
17356
17374
|
// lib/components/pin-header.ts
|
|
17357
|
-
import { z as
|
|
17375
|
+
import { z as z72 } from "zod";
|
|
17358
17376
|
var pinHeaderProps = commonComponentProps.extend({
|
|
17359
|
-
pinCount:
|
|
17377
|
+
pinCount: z72.number(),
|
|
17360
17378
|
pitch: distance20.optional(),
|
|
17361
|
-
schFacingDirection:
|
|
17362
|
-
gender:
|
|
17363
|
-
showSilkscreenPinLabels:
|
|
17364
|
-
pcbPinLabels:
|
|
17365
|
-
doubleRow:
|
|
17366
|
-
rightAngle:
|
|
17379
|
+
schFacingDirection: z72.enum(["up", "down", "left", "right"]).optional(),
|
|
17380
|
+
gender: z72.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
17381
|
+
showSilkscreenPinLabels: z72.boolean().optional(),
|
|
17382
|
+
pcbPinLabels: z72.record(z72.string(), z72.string()).optional(),
|
|
17383
|
+
doubleRow: z72.boolean().optional(),
|
|
17384
|
+
rightAngle: z72.boolean().optional(),
|
|
17367
17385
|
pcbOrientation: pcbOrientation.optional(),
|
|
17368
17386
|
holeDiameter: distance20.optional(),
|
|
17369
17387
|
platedDiameter: distance20.optional(),
|
|
17370
|
-
pinLabels:
|
|
17371
|
-
connections:
|
|
17372
|
-
facingDirection:
|
|
17388
|
+
pinLabels: z72.record(z72.string(), schematicPinLabel).or(z72.array(schematicPinLabel)).optional(),
|
|
17389
|
+
connections: z72.custom().pipe(z72.record(z72.string(), connectionTarget)).optional(),
|
|
17390
|
+
facingDirection: z72.enum(["left", "right"]).optional(),
|
|
17373
17391
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17374
17392
|
schPinStyle: schematicPinStyle.optional(),
|
|
17375
17393
|
schPinSpacing: distance20.optional(),
|
|
@@ -17379,29 +17397,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
17379
17397
|
expectTypesMatch(true);
|
|
17380
17398
|
|
|
17381
17399
|
// lib/components/netalias.ts
|
|
17382
|
-
import { z as
|
|
17400
|
+
import { z as z73 } from "zod";
|
|
17383
17401
|
import { rotation as rotation3 } from "circuit-json";
|
|
17384
|
-
var netAliasProps =
|
|
17385
|
-
net:
|
|
17386
|
-
connection:
|
|
17402
|
+
var netAliasProps = z73.object({
|
|
17403
|
+
net: z73.string().optional(),
|
|
17404
|
+
connection: z73.string().optional(),
|
|
17387
17405
|
schX: distance.optional(),
|
|
17388
17406
|
schY: distance.optional(),
|
|
17389
17407
|
schRotation: rotation3.optional(),
|
|
17390
|
-
anchorSide:
|
|
17408
|
+
anchorSide: z73.enum(["left", "top", "right", "bottom"]).optional()
|
|
17391
17409
|
});
|
|
17392
17410
|
expectTypesMatch(true);
|
|
17393
17411
|
|
|
17394
17412
|
// lib/components/netlabel.ts
|
|
17395
|
-
import { z as
|
|
17413
|
+
import { z as z74 } from "zod";
|
|
17396
17414
|
import { rotation as rotation4 } from "circuit-json";
|
|
17397
|
-
var netLabelProps =
|
|
17398
|
-
net:
|
|
17399
|
-
connection:
|
|
17400
|
-
connectsTo:
|
|
17415
|
+
var netLabelProps = z74.object({
|
|
17416
|
+
net: z74.string().optional(),
|
|
17417
|
+
connection: z74.string().optional(),
|
|
17418
|
+
connectsTo: z74.string().or(z74.array(z74.string())).optional(),
|
|
17401
17419
|
schX: distance.optional(),
|
|
17402
17420
|
schY: distance.optional(),
|
|
17403
17421
|
schRotation: rotation4.optional(),
|
|
17404
|
-
anchorSide:
|
|
17422
|
+
anchorSide: z74.enum(["left", "top", "right", "bottom"]).optional()
|
|
17405
17423
|
});
|
|
17406
17424
|
expectTypesMatch(true);
|
|
17407
17425
|
|
|
@@ -17416,52 +17434,52 @@ expectTypesMatch(true);
|
|
|
17416
17434
|
|
|
17417
17435
|
// lib/components/analogsimulation.ts
|
|
17418
17436
|
import { ms } from "circuit-json";
|
|
17419
|
-
import { z as
|
|
17420
|
-
var spiceEngine =
|
|
17437
|
+
import { z as z76 } from "zod";
|
|
17438
|
+
var spiceEngine = z76.custom(
|
|
17421
17439
|
(value) => typeof value === "string"
|
|
17422
17440
|
);
|
|
17423
|
-
var spiceOptions =
|
|
17424
|
-
method:
|
|
17425
|
-
reltol:
|
|
17426
|
-
abstol:
|
|
17427
|
-
vntol:
|
|
17441
|
+
var spiceOptions = z76.object({
|
|
17442
|
+
method: z76.enum(["trap", "gear"]).optional(),
|
|
17443
|
+
reltol: z76.union([z76.number(), z76.string()]).optional(),
|
|
17444
|
+
abstol: z76.union([z76.number(), z76.string()]).optional(),
|
|
17445
|
+
vntol: z76.union([z76.number(), z76.string()]).optional()
|
|
17428
17446
|
});
|
|
17429
|
-
var analogSimulationProps =
|
|
17430
|
-
name:
|
|
17431
|
-
simulationType:
|
|
17447
|
+
var analogSimulationProps = z76.object({
|
|
17448
|
+
name: z76.string().optional(),
|
|
17449
|
+
simulationType: z76.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
17432
17450
|
duration: ms.optional(),
|
|
17433
17451
|
startTime: ms.optional(),
|
|
17434
17452
|
timePerStep: ms.optional(),
|
|
17435
17453
|
spiceEngine: spiceEngine.optional(),
|
|
17436
17454
|
spiceOptions: spiceOptions.optional(),
|
|
17437
|
-
graphIndependentAxes:
|
|
17455
|
+
graphIndependentAxes: z76.boolean().optional()
|
|
17438
17456
|
});
|
|
17439
17457
|
expectTypesMatch(
|
|
17440
17458
|
true
|
|
17441
17459
|
);
|
|
17442
17460
|
|
|
17443
17461
|
// lib/components/autoroutingphase.ts
|
|
17444
|
-
import { z as
|
|
17445
|
-
var autoroutingPhaseProps =
|
|
17446
|
-
key:
|
|
17447
|
-
name:
|
|
17462
|
+
import { z as z77 } from "zod";
|
|
17463
|
+
var autoroutingPhaseProps = z77.object({
|
|
17464
|
+
key: z77.any().optional(),
|
|
17465
|
+
name: z77.string().optional(),
|
|
17448
17466
|
autorouter: autorouterProp.optional(),
|
|
17449
|
-
phaseIndex:
|
|
17467
|
+
phaseIndex: z77.number().optional(),
|
|
17450
17468
|
...routingTolerances.shape,
|
|
17451
|
-
region:
|
|
17452
|
-
shape:
|
|
17453
|
-
minX:
|
|
17454
|
-
maxX:
|
|
17455
|
-
minY:
|
|
17456
|
-
maxY:
|
|
17469
|
+
region: z77.object({
|
|
17470
|
+
shape: z77.literal("rect").optional(),
|
|
17471
|
+
minX: z77.number(),
|
|
17472
|
+
maxX: z77.number(),
|
|
17473
|
+
minY: z77.number(),
|
|
17474
|
+
maxY: z77.number()
|
|
17457
17475
|
}).optional(),
|
|
17458
|
-
connection:
|
|
17459
|
-
connections:
|
|
17460
|
-
reroute:
|
|
17476
|
+
connection: z77.string().optional(),
|
|
17477
|
+
connections: z77.array(z77.string()).optional(),
|
|
17478
|
+
reroute: z77.boolean().optional()
|
|
17461
17479
|
}).superRefine((value, ctx) => {
|
|
17462
17480
|
if (value.reroute !== void 0 && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
17463
17481
|
ctx.addIssue({
|
|
17464
|
-
code:
|
|
17482
|
+
code: z77.ZodIssueCode.custom,
|
|
17465
17483
|
message: "region, connection, or connections is required when reroute is provided",
|
|
17466
17484
|
path: ["region"]
|
|
17467
17485
|
});
|
|
@@ -17470,15 +17488,15 @@ var autoroutingPhaseProps = z76.object({
|
|
|
17470
17488
|
expectTypesMatch(true);
|
|
17471
17489
|
|
|
17472
17490
|
// lib/components/spicemodel.ts
|
|
17473
|
-
import { z as
|
|
17474
|
-
var spicemodelProps =
|
|
17475
|
-
source:
|
|
17476
|
-
spicePinMapping:
|
|
17491
|
+
import { z as z78 } from "zod";
|
|
17492
|
+
var spicemodelProps = z78.object({
|
|
17493
|
+
source: z78.string(),
|
|
17494
|
+
spicePinMapping: z78.record(z78.string(), z78.string()).optional()
|
|
17477
17495
|
});
|
|
17478
17496
|
expectTypesMatch(true);
|
|
17479
17497
|
|
|
17480
17498
|
// lib/components/transistor.ts
|
|
17481
|
-
import { z as
|
|
17499
|
+
import { z as z79 } from "zod";
|
|
17482
17500
|
var transistorPinsLabels = [
|
|
17483
17501
|
"pin1",
|
|
17484
17502
|
"pin2",
|
|
@@ -17491,7 +17509,7 @@ var transistorPinsLabels = [
|
|
|
17491
17509
|
"drain"
|
|
17492
17510
|
];
|
|
17493
17511
|
var transistorProps = commonComponentProps.extend({
|
|
17494
|
-
type:
|
|
17512
|
+
type: z79.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
17495
17513
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
17496
17514
|
});
|
|
17497
17515
|
var transistorPins = [
|
|
@@ -17505,7 +17523,7 @@ var transistorPins = [
|
|
|
17505
17523
|
expectTypesMatch(true);
|
|
17506
17524
|
|
|
17507
17525
|
// lib/components/mosfet.ts
|
|
17508
|
-
import { z as
|
|
17526
|
+
import { z as z80 } from "zod";
|
|
17509
17527
|
var mosfetPins = [
|
|
17510
17528
|
"pin1",
|
|
17511
17529
|
"drain",
|
|
@@ -17515,11 +17533,11 @@ var mosfetPins = [
|
|
|
17515
17533
|
"gate"
|
|
17516
17534
|
];
|
|
17517
17535
|
var mosfetProps = commonComponentProps.extend({
|
|
17518
|
-
channelType:
|
|
17519
|
-
mosfetMode:
|
|
17520
|
-
symbolDrainSide:
|
|
17521
|
-
symbolSourceSide:
|
|
17522
|
-
symbolGateSide:
|
|
17536
|
+
channelType: z80.enum(["n", "p"]),
|
|
17537
|
+
mosfetMode: z80.enum(["enhancement", "depletion"]),
|
|
17538
|
+
symbolDrainSide: z80.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17539
|
+
symbolSourceSide: z80.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17540
|
+
symbolGateSide: z80.enum(["left", "right", "top", "bottom"]).optional(),
|
|
17523
17541
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
17524
17542
|
});
|
|
17525
17543
|
expectTypesMatch(true);
|
|
@@ -17541,20 +17559,20 @@ expectTypesMatch(true);
|
|
|
17541
17559
|
|
|
17542
17560
|
// lib/components/inductor.ts
|
|
17543
17561
|
import { inductance } from "circuit-json";
|
|
17544
|
-
import { z as
|
|
17562
|
+
import { z as z82 } from "zod";
|
|
17545
17563
|
var inductorPins = lrPins;
|
|
17546
17564
|
var inductorProps = commonComponentProps.extend({
|
|
17547
17565
|
inductance,
|
|
17548
|
-
maxCurrentRating:
|
|
17566
|
+
maxCurrentRating: z82.union([z82.string(), z82.number()]).optional(),
|
|
17549
17567
|
schOrientation: schematicOrientation.optional(),
|
|
17550
17568
|
connections: createConnectionsProp(inductorPins).optional()
|
|
17551
17569
|
});
|
|
17552
17570
|
expectTypesMatch(true);
|
|
17553
17571
|
|
|
17554
17572
|
// lib/components/diode.ts
|
|
17555
|
-
import { z as
|
|
17573
|
+
import { z as z83 } from "zod";
|
|
17556
17574
|
var diodePins = lrPolarPins;
|
|
17557
|
-
var diodeConnectionKeys =
|
|
17575
|
+
var diodeConnectionKeys = z83.enum([
|
|
17558
17576
|
"anode",
|
|
17559
17577
|
"cathode",
|
|
17560
17578
|
"pin1",
|
|
@@ -17562,13 +17580,13 @@ var diodeConnectionKeys = z82.enum([
|
|
|
17562
17580
|
"pos",
|
|
17563
17581
|
"neg"
|
|
17564
17582
|
]);
|
|
17565
|
-
var connectionTarget3 =
|
|
17566
|
-
var connectionsProp2 =
|
|
17567
|
-
var diodePinLabelsProp =
|
|
17568
|
-
|
|
17569
|
-
schematicPinLabel.or(
|
|
17583
|
+
var connectionTarget3 = z83.string().or(z83.array(z83.string()).readonly()).or(z83.array(z83.string()));
|
|
17584
|
+
var connectionsProp2 = z83.record(diodeConnectionKeys, connectionTarget3);
|
|
17585
|
+
var diodePinLabelsProp = z83.record(
|
|
17586
|
+
z83.enum(diodePins),
|
|
17587
|
+
schematicPinLabel.or(z83.array(schematicPinLabel).readonly()).or(z83.array(schematicPinLabel))
|
|
17570
17588
|
);
|
|
17571
|
-
var diodeVariant =
|
|
17589
|
+
var diodeVariant = z83.enum([
|
|
17572
17590
|
"standard",
|
|
17573
17591
|
"schottky",
|
|
17574
17592
|
"zener",
|
|
@@ -17579,12 +17597,12 @@ var diodeVariant = z82.enum([
|
|
|
17579
17597
|
var diodeProps = commonComponentProps.extend({
|
|
17580
17598
|
connections: connectionsProp2.optional(),
|
|
17581
17599
|
variant: diodeVariant.optional().default("standard"),
|
|
17582
|
-
standard:
|
|
17583
|
-
schottky:
|
|
17584
|
-
zener:
|
|
17585
|
-
avalanche:
|
|
17586
|
-
photo:
|
|
17587
|
-
tvs:
|
|
17600
|
+
standard: z83.boolean().optional(),
|
|
17601
|
+
schottky: z83.boolean().optional(),
|
|
17602
|
+
zener: z83.boolean().optional(),
|
|
17603
|
+
avalanche: z83.boolean().optional(),
|
|
17604
|
+
photo: z83.boolean().optional(),
|
|
17605
|
+
tvs: z83.boolean().optional(),
|
|
17588
17606
|
schOrientation: schematicOrientation.optional(),
|
|
17589
17607
|
pinLabels: diodePinLabelsProp.optional()
|
|
17590
17608
|
}).superRefine((data, ctx) => {
|
|
@@ -17598,11 +17616,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17598
17616
|
].filter(Boolean).length;
|
|
17599
17617
|
if (enabledFlags > 1) {
|
|
17600
17618
|
ctx.addIssue({
|
|
17601
|
-
code:
|
|
17619
|
+
code: z83.ZodIssueCode.custom,
|
|
17602
17620
|
message: "Exactly one diode variant must be enabled",
|
|
17603
17621
|
path: []
|
|
17604
17622
|
});
|
|
17605
|
-
return
|
|
17623
|
+
return z83.INVALID;
|
|
17606
17624
|
}
|
|
17607
17625
|
}).transform((data) => {
|
|
17608
17626
|
const result = {
|
|
@@ -17648,34 +17666,34 @@ var diodeProps = commonComponentProps.extend({
|
|
|
17648
17666
|
expectTypesMatch(true);
|
|
17649
17667
|
|
|
17650
17668
|
// lib/components/led.ts
|
|
17651
|
-
import { z as
|
|
17669
|
+
import { z as z84 } from "zod";
|
|
17652
17670
|
var ledProps = commonComponentProps.extend({
|
|
17653
|
-
color:
|
|
17654
|
-
wavelength:
|
|
17655
|
-
schDisplayValue:
|
|
17671
|
+
color: z84.string().optional(),
|
|
17672
|
+
wavelength: z84.string().optional(),
|
|
17673
|
+
schDisplayValue: z84.string().optional(),
|
|
17656
17674
|
schOrientation: schematicOrientation.optional(),
|
|
17657
17675
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
17658
|
-
laser:
|
|
17676
|
+
laser: z84.boolean().optional()
|
|
17659
17677
|
});
|
|
17660
17678
|
var ledPins = lrPolarPins;
|
|
17661
17679
|
|
|
17662
17680
|
// lib/components/switch.ts
|
|
17663
17681
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
17664
|
-
import { z as
|
|
17682
|
+
import { z as z85 } from "zod";
|
|
17665
17683
|
var switchProps = commonComponentProps.extend({
|
|
17666
|
-
type:
|
|
17667
|
-
isNormallyClosed:
|
|
17668
|
-
spst:
|
|
17669
|
-
spdt:
|
|
17670
|
-
dpst:
|
|
17671
|
-
dpdt:
|
|
17684
|
+
type: z85.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
17685
|
+
isNormallyClosed: z85.boolean().optional().default(false),
|
|
17686
|
+
spst: z85.boolean().optional(),
|
|
17687
|
+
spdt: z85.boolean().optional(),
|
|
17688
|
+
dpst: z85.boolean().optional(),
|
|
17689
|
+
dpdt: z85.boolean().optional(),
|
|
17672
17690
|
pinLabels: pinLabelsProp.optional(),
|
|
17673
17691
|
simSwitchFrequency: frequency3.optional(),
|
|
17674
17692
|
simCloseAt: ms2.optional(),
|
|
17675
17693
|
simOpenAt: ms2.optional(),
|
|
17676
|
-
simStartClosed:
|
|
17677
|
-
simStartOpen:
|
|
17678
|
-
connections:
|
|
17694
|
+
simStartClosed: z85.boolean().optional(),
|
|
17695
|
+
simStartOpen: z85.boolean().optional(),
|
|
17696
|
+
connections: z85.custom().pipe(z85.record(z85.string(), connectionTarget)).optional()
|
|
17679
17697
|
}).transform((props) => {
|
|
17680
17698
|
const updatedProps = { ...props };
|
|
17681
17699
|
if (updatedProps.dpdt) {
|
|
@@ -17707,33 +17725,33 @@ expectTypesMatch(true);
|
|
|
17707
17725
|
|
|
17708
17726
|
// lib/components/fabrication-note-text.ts
|
|
17709
17727
|
import { length as length4 } from "circuit-json";
|
|
17710
|
-
import { z as
|
|
17728
|
+
import { z as z86 } from "zod";
|
|
17711
17729
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
17712
|
-
text:
|
|
17713
|
-
anchorAlignment:
|
|
17714
|
-
font:
|
|
17730
|
+
text: z86.string(),
|
|
17731
|
+
anchorAlignment: z86.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
17732
|
+
font: z86.enum(["tscircuit2024"]).optional(),
|
|
17715
17733
|
fontSize: length4.optional(),
|
|
17716
|
-
color:
|
|
17734
|
+
color: z86.string().optional()
|
|
17717
17735
|
});
|
|
17718
17736
|
expectTypesMatch(true);
|
|
17719
17737
|
|
|
17720
17738
|
// lib/components/fabrication-note-rect.ts
|
|
17721
17739
|
import { distance as distance21 } from "circuit-json";
|
|
17722
|
-
import { z as
|
|
17740
|
+
import { z as z87 } from "zod";
|
|
17723
17741
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17724
17742
|
width: distance21,
|
|
17725
17743
|
height: distance21,
|
|
17726
17744
|
strokeWidth: distance21.optional(),
|
|
17727
|
-
isFilled:
|
|
17728
|
-
hasStroke:
|
|
17729
|
-
isStrokeDashed:
|
|
17730
|
-
color:
|
|
17745
|
+
isFilled: z87.boolean().optional(),
|
|
17746
|
+
hasStroke: z87.boolean().optional(),
|
|
17747
|
+
isStrokeDashed: z87.boolean().optional(),
|
|
17748
|
+
color: z87.string().optional(),
|
|
17731
17749
|
cornerRadius: distance21.optional()
|
|
17732
17750
|
});
|
|
17733
17751
|
|
|
17734
17752
|
// lib/components/fabrication-note-path.ts
|
|
17735
17753
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
17736
|
-
import { z as
|
|
17754
|
+
import { z as z88 } from "zod";
|
|
17737
17755
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
17738
17756
|
pcbLeftEdgeX: true,
|
|
17739
17757
|
pcbRightEdgeX: true,
|
|
@@ -17745,15 +17763,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
17745
17763
|
pcbOffsetY: true,
|
|
17746
17764
|
pcbRotation: true
|
|
17747
17765
|
}).extend({
|
|
17748
|
-
route:
|
|
17766
|
+
route: z88.array(route_hint_point3),
|
|
17749
17767
|
strokeWidth: length5.optional(),
|
|
17750
|
-
color:
|
|
17768
|
+
color: z88.string().optional()
|
|
17751
17769
|
});
|
|
17752
17770
|
|
|
17753
17771
|
// lib/components/fabrication-note-dimension.ts
|
|
17754
17772
|
import { distance as distance22, length as length6 } from "circuit-json";
|
|
17755
|
-
import { z as
|
|
17756
|
-
var dimensionTarget =
|
|
17773
|
+
import { z as z89 } from "zod";
|
|
17774
|
+
var dimensionTarget = z89.union([z89.string(), point]);
|
|
17757
17775
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
17758
17776
|
pcbLeftEdgeX: true,
|
|
17759
17777
|
pcbRightEdgeX: true,
|
|
@@ -17767,54 +17785,54 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
17767
17785
|
}).extend({
|
|
17768
17786
|
from: dimensionTarget,
|
|
17769
17787
|
to: dimensionTarget,
|
|
17770
|
-
text:
|
|
17788
|
+
text: z89.string().optional(),
|
|
17771
17789
|
offset: distance22.optional(),
|
|
17772
|
-
font:
|
|
17790
|
+
font: z89.enum(["tscircuit2024"]).optional(),
|
|
17773
17791
|
fontSize: length6.optional(),
|
|
17774
|
-
color:
|
|
17792
|
+
color: z89.string().optional(),
|
|
17775
17793
|
arrowSize: distance22.optional(),
|
|
17776
|
-
units:
|
|
17777
|
-
outerEdgeToEdge:
|
|
17778
|
-
centerToCenter:
|
|
17779
|
-
innerEdgeToEdge:
|
|
17794
|
+
units: z89.enum(["in", "mm"]).optional(),
|
|
17795
|
+
outerEdgeToEdge: z89.literal(true).optional(),
|
|
17796
|
+
centerToCenter: z89.literal(true).optional(),
|
|
17797
|
+
innerEdgeToEdge: z89.literal(true).optional()
|
|
17780
17798
|
});
|
|
17781
17799
|
expectTypesMatch(true);
|
|
17782
17800
|
|
|
17783
17801
|
// lib/components/pcb-trace.ts
|
|
17784
17802
|
import { distance as distance23, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
17785
|
-
import { z as
|
|
17786
|
-
var pcbTraceProps =
|
|
17787
|
-
layer:
|
|
17803
|
+
import { z as z90 } from "zod";
|
|
17804
|
+
var pcbTraceProps = z90.object({
|
|
17805
|
+
layer: z90.string().optional(),
|
|
17788
17806
|
thickness: distance23.optional(),
|
|
17789
|
-
route:
|
|
17807
|
+
route: z90.array(route_hint_point4)
|
|
17790
17808
|
});
|
|
17791
17809
|
|
|
17792
17810
|
// lib/components/via.ts
|
|
17793
17811
|
import { distance as distance24, layer_ref as layer_ref6 } from "circuit-json";
|
|
17794
|
-
import { z as
|
|
17812
|
+
import { z as z91 } from "zod";
|
|
17795
17813
|
var viaProps = commonLayoutProps.extend({
|
|
17796
|
-
name:
|
|
17814
|
+
name: z91.string().optional(),
|
|
17797
17815
|
fromLayer: layer_ref6.optional(),
|
|
17798
17816
|
toLayer: layer_ref6.optional(),
|
|
17799
17817
|
holeDiameter: distance24.optional(),
|
|
17800
17818
|
outerDiameter: distance24.optional(),
|
|
17801
|
-
layers:
|
|
17802
|
-
connectsTo:
|
|
17803
|
-
netIsAssignable:
|
|
17819
|
+
layers: z91.array(layer_ref6).optional(),
|
|
17820
|
+
connectsTo: z91.string().or(z91.array(z91.string())).optional(),
|
|
17821
|
+
netIsAssignable: z91.boolean().optional()
|
|
17804
17822
|
});
|
|
17805
17823
|
expectTypesMatch(true);
|
|
17806
17824
|
|
|
17807
17825
|
// lib/components/testpoint.ts
|
|
17808
17826
|
import { distance as distance25 } from "circuit-json";
|
|
17809
|
-
import { z as
|
|
17827
|
+
import { z as z92 } from "zod";
|
|
17810
17828
|
var testpointPins = ["pin1"];
|
|
17811
|
-
var testpointConnectionsProp =
|
|
17829
|
+
var testpointConnectionsProp = z92.object({
|
|
17812
17830
|
pin1: connectionTarget
|
|
17813
17831
|
}).strict();
|
|
17814
17832
|
var testpointProps = commonComponentProps.extend({
|
|
17815
17833
|
connections: testpointConnectionsProp.optional(),
|
|
17816
|
-
footprintVariant:
|
|
17817
|
-
padShape:
|
|
17834
|
+
footprintVariant: z92.enum(["pad", "through_hole"]).optional(),
|
|
17835
|
+
padShape: z92.enum(["rect", "circle"]).optional().default("circle"),
|
|
17818
17836
|
padDiameter: distance25.optional(),
|
|
17819
17837
|
holeDiameter: distance25.optional(),
|
|
17820
17838
|
width: distance25.optional(),
|
|
@@ -17826,45 +17844,45 @@ var testpointProps = commonComponentProps.extend({
|
|
|
17826
17844
|
expectTypesMatch(true);
|
|
17827
17845
|
|
|
17828
17846
|
// lib/components/breakoutpoint.ts
|
|
17829
|
-
import { z as
|
|
17847
|
+
import { z as z93 } from "zod";
|
|
17830
17848
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17831
|
-
connection:
|
|
17849
|
+
connection: z93.string()
|
|
17832
17850
|
});
|
|
17833
17851
|
expectTypesMatch(true);
|
|
17834
17852
|
|
|
17835
17853
|
// lib/components/pcb-keepout.ts
|
|
17836
17854
|
import { distance as distance26, layer_ref as layer_ref7 } from "circuit-json";
|
|
17837
|
-
import { z as
|
|
17838
|
-
var pcbKeepoutProps =
|
|
17855
|
+
import { z as z94 } from "zod";
|
|
17856
|
+
var pcbKeepoutProps = z94.union([
|
|
17839
17857
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17840
|
-
shape:
|
|
17858
|
+
shape: z94.literal("circle"),
|
|
17841
17859
|
radius: distance26,
|
|
17842
|
-
layers:
|
|
17860
|
+
layers: z94.array(layer_ref7).optional()
|
|
17843
17861
|
}),
|
|
17844
17862
|
pcbLayoutProps.extend({
|
|
17845
|
-
shape:
|
|
17863
|
+
shape: z94.literal("rect"),
|
|
17846
17864
|
width: distance26,
|
|
17847
17865
|
height: distance26,
|
|
17848
|
-
layers:
|
|
17866
|
+
layers: z94.array(layer_ref7).optional()
|
|
17849
17867
|
})
|
|
17850
17868
|
]);
|
|
17851
17869
|
|
|
17852
17870
|
// lib/components/courtyard-rect.ts
|
|
17853
17871
|
import { distance as distance27 } from "circuit-json";
|
|
17854
|
-
import { z as
|
|
17872
|
+
import { z as z95 } from "zod";
|
|
17855
17873
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
17856
17874
|
width: distance27,
|
|
17857
17875
|
height: distance27,
|
|
17858
17876
|
strokeWidth: distance27.optional(),
|
|
17859
|
-
isFilled:
|
|
17860
|
-
hasStroke:
|
|
17861
|
-
isStrokeDashed:
|
|
17862
|
-
color:
|
|
17877
|
+
isFilled: z95.boolean().optional(),
|
|
17878
|
+
hasStroke: z95.boolean().optional(),
|
|
17879
|
+
isStrokeDashed: z95.boolean().optional(),
|
|
17880
|
+
color: z95.string().optional()
|
|
17863
17881
|
});
|
|
17864
17882
|
|
|
17865
17883
|
// lib/components/courtyard-outline.ts
|
|
17866
17884
|
import { length as length7 } from "circuit-json";
|
|
17867
|
-
import { z as
|
|
17885
|
+
import { z as z96 } from "zod";
|
|
17868
17886
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
17869
17887
|
pcbLeftEdgeX: true,
|
|
17870
17888
|
pcbRightEdgeX: true,
|
|
@@ -17876,11 +17894,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
17876
17894
|
pcbOffsetY: true,
|
|
17877
17895
|
pcbRotation: true
|
|
17878
17896
|
}).extend({
|
|
17879
|
-
outline:
|
|
17897
|
+
outline: z96.array(point),
|
|
17880
17898
|
strokeWidth: length7.optional(),
|
|
17881
|
-
isClosed:
|
|
17882
|
-
isStrokeDashed:
|
|
17883
|
-
color:
|
|
17899
|
+
isClosed: z96.boolean().optional(),
|
|
17900
|
+
isStrokeDashed: z96.boolean().optional(),
|
|
17901
|
+
color: z96.string().optional()
|
|
17884
17902
|
});
|
|
17885
17903
|
|
|
17886
17904
|
// lib/components/courtyard-circle.ts
|
|
@@ -17900,35 +17918,35 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17900
17918
|
});
|
|
17901
17919
|
|
|
17902
17920
|
// lib/components/copper-pour.ts
|
|
17903
|
-
import { z as
|
|
17921
|
+
import { z as z99 } from "zod";
|
|
17904
17922
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
17905
|
-
var copperPourProps =
|
|
17906
|
-
name:
|
|
17923
|
+
var copperPourProps = z99.object({
|
|
17924
|
+
name: z99.string().optional(),
|
|
17907
17925
|
layer: layer_ref8,
|
|
17908
|
-
connectsTo:
|
|
17909
|
-
unbroken:
|
|
17926
|
+
connectsTo: z99.string(),
|
|
17927
|
+
unbroken: z99.boolean().optional(),
|
|
17910
17928
|
padMargin: distance.optional(),
|
|
17911
17929
|
traceMargin: distance.optional(),
|
|
17912
17930
|
clearance: distance.optional(),
|
|
17913
17931
|
boardEdgeMargin: distance.optional(),
|
|
17914
17932
|
cutoutMargin: distance.optional(),
|
|
17915
|
-
outline:
|
|
17916
|
-
coveredWithSolderMask:
|
|
17933
|
+
outline: z99.array(point).optional(),
|
|
17934
|
+
coveredWithSolderMask: z99.boolean().optional().default(true)
|
|
17917
17935
|
});
|
|
17918
17936
|
expectTypesMatch(true);
|
|
17919
17937
|
|
|
17920
17938
|
// lib/components/cadassembly.ts
|
|
17921
17939
|
import { layer_ref as layer_ref9 } from "circuit-json";
|
|
17922
|
-
import { z as
|
|
17923
|
-
var cadassemblyProps =
|
|
17940
|
+
import { z as z100 } from "zod";
|
|
17941
|
+
var cadassemblyProps = z100.object({
|
|
17924
17942
|
originalLayer: layer_ref9.default("top").optional(),
|
|
17925
|
-
children:
|
|
17943
|
+
children: z100.any().optional()
|
|
17926
17944
|
});
|
|
17927
17945
|
expectTypesMatch(true);
|
|
17928
17946
|
|
|
17929
17947
|
// lib/components/cadmodel.ts
|
|
17930
|
-
import { z as
|
|
17931
|
-
var pcbPosition =
|
|
17948
|
+
import { z as z101 } from "zod";
|
|
17949
|
+
var pcbPosition = z101.object({
|
|
17932
17950
|
pcbX: pcbCoordinate.optional(),
|
|
17933
17951
|
pcbY: pcbCoordinate.optional(),
|
|
17934
17952
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -17945,7 +17963,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
17945
17963
|
});
|
|
17946
17964
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
17947
17965
|
expectTypesMatch(true);
|
|
17948
|
-
var cadmodelProps =
|
|
17966
|
+
var cadmodelProps = z101.union([z101.null(), url, cadModelObject]);
|
|
17949
17967
|
|
|
17950
17968
|
// lib/components/power-source.ts
|
|
17951
17969
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -17955,9 +17973,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
17955
17973
|
|
|
17956
17974
|
// lib/components/voltagesource.ts
|
|
17957
17975
|
import { frequency as frequency4, ms as ms3, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
17958
|
-
import { z as
|
|
17976
|
+
import { z as z102 } from "zod";
|
|
17959
17977
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17960
|
-
var percentage =
|
|
17978
|
+
var percentage = z102.union([z102.string(), z102.number()]).transform((val) => {
|
|
17961
17979
|
if (typeof val === "string") {
|
|
17962
17980
|
if (val.endsWith("%")) {
|
|
17963
17981
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17966,13 +17984,13 @@ var percentage = z101.union([z101.string(), z101.number()]).transform((val) => {
|
|
|
17966
17984
|
}
|
|
17967
17985
|
return val;
|
|
17968
17986
|
}).pipe(
|
|
17969
|
-
|
|
17987
|
+
z102.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
17970
17988
|
);
|
|
17971
17989
|
var voltageSourceProps = commonComponentProps.extend({
|
|
17972
17990
|
voltage: voltage4.optional(),
|
|
17973
17991
|
frequency: frequency4.optional(),
|
|
17974
17992
|
peakToPeakVoltage: voltage4.optional(),
|
|
17975
|
-
waveShape:
|
|
17993
|
+
waveShape: z102.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
17976
17994
|
phase: rotation5.optional(),
|
|
17977
17995
|
dutyCycle: percentage.optional(),
|
|
17978
17996
|
pulseDelay: ms3.optional(),
|
|
@@ -17987,9 +18005,9 @@ expectTypesMatch(true);
|
|
|
17987
18005
|
|
|
17988
18006
|
// lib/components/currentsource.ts
|
|
17989
18007
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
17990
|
-
import { z as
|
|
18008
|
+
import { z as z103 } from "zod";
|
|
17991
18009
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17992
|
-
var percentage2 =
|
|
18010
|
+
var percentage2 = z103.union([z103.string(), z103.number()]).transform((val) => {
|
|
17993
18011
|
if (typeof val === "string") {
|
|
17994
18012
|
if (val.endsWith("%")) {
|
|
17995
18013
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17998,13 +18016,13 @@ var percentage2 = z102.union([z102.string(), z102.number()]).transform((val) =>
|
|
|
17998
18016
|
}
|
|
17999
18017
|
return val;
|
|
18000
18018
|
}).pipe(
|
|
18001
|
-
|
|
18019
|
+
z103.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
18002
18020
|
);
|
|
18003
18021
|
var currentSourceProps = commonComponentProps.extend({
|
|
18004
18022
|
current: current.optional(),
|
|
18005
18023
|
frequency: frequency5.optional(),
|
|
18006
18024
|
peakToPeakCurrent: current.optional(),
|
|
18007
|
-
waveShape:
|
|
18025
|
+
waveShape: z103.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
18008
18026
|
phase: rotation6.optional(),
|
|
18009
18027
|
dutyCycle: percentage2.optional(),
|
|
18010
18028
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -18013,21 +18031,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
18013
18031
|
expectTypesMatch(true);
|
|
18014
18032
|
|
|
18015
18033
|
// lib/components/voltageprobe.ts
|
|
18016
|
-
import { z as
|
|
18034
|
+
import { z as z104 } from "zod";
|
|
18017
18035
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
18018
|
-
name:
|
|
18019
|
-
connectsTo:
|
|
18020
|
-
referenceTo:
|
|
18021
|
-
color:
|
|
18022
|
-
graphDisplayName:
|
|
18023
|
-
graphCenter:
|
|
18024
|
-
graphVerticalOffset:
|
|
18025
|
-
graphVoltagePerDiv:
|
|
18036
|
+
name: z104.string().optional(),
|
|
18037
|
+
connectsTo: z104.string(),
|
|
18038
|
+
referenceTo: z104.string().optional(),
|
|
18039
|
+
color: z104.string().optional(),
|
|
18040
|
+
graphDisplayName: z104.string().optional(),
|
|
18041
|
+
graphCenter: z104.number().optional(),
|
|
18042
|
+
graphVerticalOffset: z104.number().or(z104.string()).optional(),
|
|
18043
|
+
graphVoltagePerDiv: z104.number().or(z104.string()).optional()
|
|
18026
18044
|
});
|
|
18027
18045
|
expectTypesMatch(true);
|
|
18028
18046
|
|
|
18029
18047
|
// lib/components/ammeter.ts
|
|
18030
|
-
import { z as
|
|
18048
|
+
import { z as z105 } from "zod";
|
|
18031
18049
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
18032
18050
|
var hasAmmeterConnectionPair = (connections) => {
|
|
18033
18051
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -18037,57 +18055,57 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
18037
18055
|
hasAmmeterConnectionPair,
|
|
18038
18056
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
18039
18057
|
),
|
|
18040
|
-
color:
|
|
18041
|
-
graphDisplayName:
|
|
18042
|
-
graphCenter:
|
|
18043
|
-
graphVerticalOffset:
|
|
18044
|
-
graphCurrentPerDiv:
|
|
18058
|
+
color: z105.string().optional(),
|
|
18059
|
+
graphDisplayName: z105.string().optional(),
|
|
18060
|
+
graphCenter: z105.number().optional(),
|
|
18061
|
+
graphVerticalOffset: z105.number().or(z105.string()).optional(),
|
|
18062
|
+
graphCurrentPerDiv: z105.number().or(z105.string()).optional()
|
|
18045
18063
|
});
|
|
18046
18064
|
var ammeterPins = ammeterPinLabels;
|
|
18047
18065
|
expectTypesMatch(true);
|
|
18048
18066
|
|
|
18049
18067
|
// lib/components/schematic-arc.ts
|
|
18050
18068
|
import { distance as distance30, point as point5, rotation as rotation7 } from "circuit-json";
|
|
18051
|
-
import { z as
|
|
18052
|
-
var schematicArcProps =
|
|
18069
|
+
import { z as z106 } from "zod";
|
|
18070
|
+
var schematicArcProps = z106.object({
|
|
18053
18071
|
center: point5,
|
|
18054
18072
|
radius: distance30,
|
|
18055
18073
|
startAngleDegrees: rotation7,
|
|
18056
18074
|
endAngleDegrees: rotation7,
|
|
18057
|
-
direction:
|
|
18075
|
+
direction: z106.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
18058
18076
|
strokeWidth: distance30.optional(),
|
|
18059
|
-
color:
|
|
18060
|
-
isDashed:
|
|
18077
|
+
color: z106.string().optional(),
|
|
18078
|
+
isDashed: z106.boolean().optional().default(false)
|
|
18061
18079
|
});
|
|
18062
18080
|
expectTypesMatch(true);
|
|
18063
18081
|
|
|
18064
18082
|
// lib/components/toolingrail.ts
|
|
18065
|
-
import { z as
|
|
18066
|
-
var toolingrailProps =
|
|
18067
|
-
children:
|
|
18083
|
+
import { z as z107 } from "zod";
|
|
18084
|
+
var toolingrailProps = z107.object({
|
|
18085
|
+
children: z107.any().optional()
|
|
18068
18086
|
});
|
|
18069
18087
|
expectTypesMatch(true);
|
|
18070
18088
|
|
|
18071
18089
|
// lib/components/schematic-box.ts
|
|
18072
18090
|
import { distance as distance31 } from "circuit-json";
|
|
18073
|
-
import { z as
|
|
18074
|
-
var schematicBoxProps =
|
|
18091
|
+
import { z as z108 } from "zod";
|
|
18092
|
+
var schematicBoxProps = z108.object({
|
|
18075
18093
|
schX: distance31.optional(),
|
|
18076
18094
|
schY: distance31.optional(),
|
|
18077
18095
|
width: distance31.optional(),
|
|
18078
18096
|
height: distance31.optional(),
|
|
18079
|
-
overlay:
|
|
18097
|
+
overlay: z108.array(z108.string()).optional(),
|
|
18080
18098
|
padding: distance31.optional(),
|
|
18081
18099
|
paddingLeft: distance31.optional(),
|
|
18082
18100
|
paddingRight: distance31.optional(),
|
|
18083
18101
|
paddingTop: distance31.optional(),
|
|
18084
18102
|
paddingBottom: distance31.optional(),
|
|
18085
|
-
title:
|
|
18103
|
+
title: z108.string().optional(),
|
|
18086
18104
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
18087
|
-
titleColor:
|
|
18105
|
+
titleColor: z108.string().optional(),
|
|
18088
18106
|
titleFontSize: distance31.optional(),
|
|
18089
|
-
titleInside:
|
|
18090
|
-
strokeStyle:
|
|
18107
|
+
titleInside: z108.boolean().default(false),
|
|
18108
|
+
strokeStyle: z108.enum(["solid", "dashed"]).default("solid")
|
|
18091
18109
|
}).refine(
|
|
18092
18110
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
18093
18111
|
{
|
|
@@ -18103,15 +18121,15 @@ expectTypesMatch(true);
|
|
|
18103
18121
|
|
|
18104
18122
|
// lib/components/schematic-circle.ts
|
|
18105
18123
|
import { distance as distance32, point as point6 } from "circuit-json";
|
|
18106
|
-
import { z as
|
|
18107
|
-
var schematicCircleProps =
|
|
18124
|
+
import { z as z109 } from "zod";
|
|
18125
|
+
var schematicCircleProps = z109.object({
|
|
18108
18126
|
center: point6,
|
|
18109
18127
|
radius: distance32,
|
|
18110
18128
|
strokeWidth: distance32.optional(),
|
|
18111
|
-
color:
|
|
18112
|
-
isFilled:
|
|
18113
|
-
fillColor:
|
|
18114
|
-
isDashed:
|
|
18129
|
+
color: z109.string().optional(),
|
|
18130
|
+
isFilled: z109.boolean().optional().default(false),
|
|
18131
|
+
fillColor: z109.string().optional(),
|
|
18132
|
+
isDashed: z109.boolean().optional().default(false)
|
|
18115
18133
|
});
|
|
18116
18134
|
expectTypesMatch(
|
|
18117
18135
|
true
|
|
@@ -18119,32 +18137,32 @@ expectTypesMatch(
|
|
|
18119
18137
|
|
|
18120
18138
|
// lib/components/schematic-rect.ts
|
|
18121
18139
|
import { distance as distance33, rotation as rotation8 } from "circuit-json";
|
|
18122
|
-
import { z as
|
|
18123
|
-
var schematicRectProps =
|
|
18140
|
+
import { z as z110 } from "zod";
|
|
18141
|
+
var schematicRectProps = z110.object({
|
|
18124
18142
|
schX: distance33.optional(),
|
|
18125
18143
|
schY: distance33.optional(),
|
|
18126
18144
|
width: distance33,
|
|
18127
18145
|
height: distance33,
|
|
18128
18146
|
rotation: rotation8.default(0),
|
|
18129
18147
|
strokeWidth: distance33.optional(),
|
|
18130
|
-
color:
|
|
18131
|
-
isFilled:
|
|
18132
|
-
fillColor:
|
|
18133
|
-
isDashed:
|
|
18148
|
+
color: z110.string().optional(),
|
|
18149
|
+
isFilled: z110.boolean().optional().default(false),
|
|
18150
|
+
fillColor: z110.string().optional(),
|
|
18151
|
+
isDashed: z110.boolean().optional().default(false)
|
|
18134
18152
|
});
|
|
18135
18153
|
expectTypesMatch(true);
|
|
18136
18154
|
|
|
18137
18155
|
// lib/components/schematic-line.ts
|
|
18138
18156
|
import { distance as distance34 } from "circuit-json";
|
|
18139
|
-
import { z as
|
|
18140
|
-
var schematicLineProps =
|
|
18157
|
+
import { z as z111 } from "zod";
|
|
18158
|
+
var schematicLineProps = z111.object({
|
|
18141
18159
|
x1: distance34,
|
|
18142
18160
|
y1: distance34,
|
|
18143
18161
|
x2: distance34,
|
|
18144
18162
|
y2: distance34,
|
|
18145
18163
|
strokeWidth: distance34.optional(),
|
|
18146
|
-
color:
|
|
18147
|
-
isDashed:
|
|
18164
|
+
color: z111.string().optional(),
|
|
18165
|
+
isDashed: z111.boolean().optional().default(false),
|
|
18148
18166
|
dashLength: distance34.optional(),
|
|
18149
18167
|
dashGap: distance34.optional()
|
|
18150
18168
|
});
|
|
@@ -18152,11 +18170,11 @@ expectTypesMatch(true);
|
|
|
18152
18170
|
|
|
18153
18171
|
// lib/components/schematic-text.ts
|
|
18154
18172
|
import { distance as distance35, rotation as rotation9 } from "circuit-json";
|
|
18155
|
-
import { z as
|
|
18173
|
+
import { z as z113 } from "zod";
|
|
18156
18174
|
|
|
18157
18175
|
// lib/common/fivePointAnchor.ts
|
|
18158
|
-
import { z as
|
|
18159
|
-
var fivePointAnchor =
|
|
18176
|
+
import { z as z112 } from "zod";
|
|
18177
|
+
var fivePointAnchor = z112.enum([
|
|
18160
18178
|
"center",
|
|
18161
18179
|
"left",
|
|
18162
18180
|
"right",
|
|
@@ -18165,39 +18183,39 @@ var fivePointAnchor = z111.enum([
|
|
|
18165
18183
|
]);
|
|
18166
18184
|
|
|
18167
18185
|
// lib/components/schematic-text.ts
|
|
18168
|
-
var schematicTextProps =
|
|
18186
|
+
var schematicTextProps = z113.object({
|
|
18169
18187
|
schX: distance35.optional(),
|
|
18170
18188
|
schY: distance35.optional(),
|
|
18171
|
-
text:
|
|
18172
|
-
fontSize:
|
|
18173
|
-
anchor:
|
|
18174
|
-
color:
|
|
18189
|
+
text: z113.string(),
|
|
18190
|
+
fontSize: z113.number().default(1),
|
|
18191
|
+
anchor: z113.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
18192
|
+
color: z113.string().default("#000000"),
|
|
18175
18193
|
schRotation: rotation9.default(0)
|
|
18176
18194
|
});
|
|
18177
18195
|
expectTypesMatch(true);
|
|
18178
18196
|
|
|
18179
18197
|
// lib/components/schematic-path.ts
|
|
18180
18198
|
import { distance as distance36, point as point7 } from "circuit-json";
|
|
18181
|
-
import { z as
|
|
18182
|
-
var schematicPathProps =
|
|
18183
|
-
points:
|
|
18184
|
-
svgPath:
|
|
18199
|
+
import { z as z114 } from "zod";
|
|
18200
|
+
var schematicPathProps = z114.object({
|
|
18201
|
+
points: z114.array(point7).optional(),
|
|
18202
|
+
svgPath: z114.string().optional(),
|
|
18185
18203
|
strokeWidth: distance36.optional(),
|
|
18186
|
-
strokeColor:
|
|
18204
|
+
strokeColor: z114.string().optional(),
|
|
18187
18205
|
dashLength: distance36.optional(),
|
|
18188
18206
|
dashGap: distance36.optional(),
|
|
18189
|
-
isFilled:
|
|
18190
|
-
fillColor:
|
|
18207
|
+
isFilled: z114.boolean().optional().default(false),
|
|
18208
|
+
fillColor: z114.string().optional()
|
|
18191
18209
|
});
|
|
18192
18210
|
expectTypesMatch(true);
|
|
18193
18211
|
|
|
18194
18212
|
// lib/components/schematic-table.ts
|
|
18195
18213
|
import { distance as distance37 } from "circuit-json";
|
|
18196
|
-
import { z as
|
|
18197
|
-
var schematicTableProps =
|
|
18214
|
+
import { z as z115 } from "zod";
|
|
18215
|
+
var schematicTableProps = z115.object({
|
|
18198
18216
|
schX: distance37.optional(),
|
|
18199
18217
|
schY: distance37.optional(),
|
|
18200
|
-
children:
|
|
18218
|
+
children: z115.any().optional(),
|
|
18201
18219
|
cellPadding: distance37.optional(),
|
|
18202
18220
|
borderWidth: distance37.optional(),
|
|
18203
18221
|
anchor: ninePointAnchor.optional(),
|
|
@@ -18207,34 +18225,34 @@ expectTypesMatch(true);
|
|
|
18207
18225
|
|
|
18208
18226
|
// lib/components/schematic-row.ts
|
|
18209
18227
|
import { distance as distance38 } from "circuit-json";
|
|
18210
|
-
import { z as
|
|
18211
|
-
var schematicRowProps =
|
|
18212
|
-
children:
|
|
18228
|
+
import { z as z116 } from "zod";
|
|
18229
|
+
var schematicRowProps = z116.object({
|
|
18230
|
+
children: z116.any().optional(),
|
|
18213
18231
|
height: distance38.optional()
|
|
18214
18232
|
});
|
|
18215
18233
|
expectTypesMatch(true);
|
|
18216
18234
|
|
|
18217
18235
|
// lib/components/schematic-cell.ts
|
|
18218
18236
|
import { distance as distance39 } from "circuit-json";
|
|
18219
|
-
import { z as
|
|
18220
|
-
var schematicCellProps =
|
|
18221
|
-
children:
|
|
18222
|
-
horizontalAlign:
|
|
18223
|
-
verticalAlign:
|
|
18237
|
+
import { z as z117 } from "zod";
|
|
18238
|
+
var schematicCellProps = z117.object({
|
|
18239
|
+
children: z117.string().optional(),
|
|
18240
|
+
horizontalAlign: z117.enum(["left", "center", "right"]).optional(),
|
|
18241
|
+
verticalAlign: z117.enum(["top", "middle", "bottom"]).optional(),
|
|
18224
18242
|
fontSize: distance39.optional(),
|
|
18225
|
-
rowSpan:
|
|
18226
|
-
colSpan:
|
|
18243
|
+
rowSpan: z117.number().optional(),
|
|
18244
|
+
colSpan: z117.number().optional(),
|
|
18227
18245
|
width: distance39.optional(),
|
|
18228
|
-
text:
|
|
18246
|
+
text: z117.string().optional()
|
|
18229
18247
|
});
|
|
18230
18248
|
expectTypesMatch(true);
|
|
18231
18249
|
|
|
18232
18250
|
// lib/components/schematic-section.ts
|
|
18233
18251
|
import { distance as distance40 } from "circuit-json";
|
|
18234
|
-
import { z as
|
|
18235
|
-
var schematicSectionProps =
|
|
18236
|
-
displayName:
|
|
18237
|
-
name:
|
|
18252
|
+
import { z as z118 } from "zod";
|
|
18253
|
+
var schematicSectionProps = z118.object({
|
|
18254
|
+
displayName: z118.string().optional(),
|
|
18255
|
+
name: z118.string(),
|
|
18238
18256
|
sectionTitleFontSize: distance40.optional()
|
|
18239
18257
|
});
|
|
18240
18258
|
expectTypesMatch(
|
|
@@ -18242,51 +18260,51 @@ expectTypesMatch(
|
|
|
18242
18260
|
);
|
|
18243
18261
|
|
|
18244
18262
|
// lib/components/schematic-sheet.ts
|
|
18245
|
-
import { z as
|
|
18246
|
-
var schematicSheetProps =
|
|
18247
|
-
name:
|
|
18248
|
-
displayName:
|
|
18249
|
-
sheetIndex:
|
|
18250
|
-
children:
|
|
18263
|
+
import { z as z119 } from "zod";
|
|
18264
|
+
var schematicSheetProps = z119.object({
|
|
18265
|
+
name: z119.string(),
|
|
18266
|
+
displayName: z119.string(),
|
|
18267
|
+
sheetIndex: z119.number().optional(),
|
|
18268
|
+
children: z119.any().optional()
|
|
18251
18269
|
});
|
|
18252
18270
|
expectTypesMatch(true);
|
|
18253
18271
|
|
|
18254
18272
|
// lib/components/copper-text.ts
|
|
18255
18273
|
import { layer_ref as layer_ref10, length as length8 } from "circuit-json";
|
|
18256
|
-
import { z as
|
|
18274
|
+
import { z as z120 } from "zod";
|
|
18257
18275
|
var copperTextProps = pcbLayoutProps.extend({
|
|
18258
|
-
text:
|
|
18276
|
+
text: z120.string(),
|
|
18259
18277
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18260
|
-
font:
|
|
18278
|
+
font: z120.enum(["tscircuit2024"]).optional(),
|
|
18261
18279
|
fontSize: length8.optional(),
|
|
18262
|
-
layers:
|
|
18263
|
-
knockout:
|
|
18264
|
-
mirrored:
|
|
18280
|
+
layers: z120.array(layer_ref10).optional(),
|
|
18281
|
+
knockout: z120.boolean().optional(),
|
|
18282
|
+
mirrored: z120.boolean().optional()
|
|
18265
18283
|
});
|
|
18266
18284
|
|
|
18267
18285
|
// lib/components/silkscreen-text.ts
|
|
18268
18286
|
import { layer_ref as layer_ref11, length as length9 } from "circuit-json";
|
|
18269
|
-
import { z as
|
|
18287
|
+
import { z as z121 } from "zod";
|
|
18270
18288
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
18271
|
-
text:
|
|
18289
|
+
text: z121.string(),
|
|
18272
18290
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
18273
|
-
font:
|
|
18291
|
+
font: z121.enum(["tscircuit2024"]).optional(),
|
|
18274
18292
|
fontSize: length9.optional(),
|
|
18275
18293
|
/**
|
|
18276
18294
|
* If true, text will knock out underlying silkscreen
|
|
18277
18295
|
*/
|
|
18278
|
-
isKnockout:
|
|
18296
|
+
isKnockout: z121.boolean().optional(),
|
|
18279
18297
|
knockoutPadding: length9.optional(),
|
|
18280
18298
|
knockoutPaddingLeft: length9.optional(),
|
|
18281
18299
|
knockoutPaddingRight: length9.optional(),
|
|
18282
18300
|
knockoutPaddingTop: length9.optional(),
|
|
18283
18301
|
knockoutPaddingBottom: length9.optional(),
|
|
18284
|
-
layers:
|
|
18302
|
+
layers: z121.array(layer_ref11).optional()
|
|
18285
18303
|
});
|
|
18286
18304
|
|
|
18287
18305
|
// lib/components/silkscreen-path.ts
|
|
18288
18306
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
18289
|
-
import { z as
|
|
18307
|
+
import { z as z122 } from "zod";
|
|
18290
18308
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
18291
18309
|
pcbLeftEdgeX: true,
|
|
18292
18310
|
pcbRightEdgeX: true,
|
|
@@ -18298,7 +18316,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
18298
18316
|
pcbOffsetY: true,
|
|
18299
18317
|
pcbRotation: true
|
|
18300
18318
|
}).extend({
|
|
18301
|
-
route:
|
|
18319
|
+
route: z122.array(route_hint_point5),
|
|
18302
18320
|
strokeWidth: length10.optional()
|
|
18303
18321
|
});
|
|
18304
18322
|
|
|
@@ -18320,10 +18338,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
18320
18338
|
|
|
18321
18339
|
// lib/components/silkscreen-rect.ts
|
|
18322
18340
|
import { distance as distance42 } from "circuit-json";
|
|
18323
|
-
import { z as
|
|
18341
|
+
import { z as z123 } from "zod";
|
|
18324
18342
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18325
|
-
filled:
|
|
18326
|
-
stroke:
|
|
18343
|
+
filled: z123.boolean().default(true).optional(),
|
|
18344
|
+
stroke: z123.enum(["dashed", "solid", "none"]).optional(),
|
|
18327
18345
|
strokeWidth: distance42.optional(),
|
|
18328
18346
|
width: distance42,
|
|
18329
18347
|
height: distance42,
|
|
@@ -18332,10 +18350,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
18332
18350
|
|
|
18333
18351
|
// lib/components/silkscreen-circle.ts
|
|
18334
18352
|
import { distance as distance43 } from "circuit-json";
|
|
18335
|
-
import { z as
|
|
18353
|
+
import { z as z124 } from "zod";
|
|
18336
18354
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18337
|
-
isFilled:
|
|
18338
|
-
isOutline:
|
|
18355
|
+
isFilled: z124.boolean().optional(),
|
|
18356
|
+
isOutline: z124.boolean().optional(),
|
|
18339
18357
|
strokeWidth: distance43.optional(),
|
|
18340
18358
|
radius: distance43
|
|
18341
18359
|
});
|
|
@@ -18353,63 +18371,63 @@ expectTypesMatch(true);
|
|
|
18353
18371
|
|
|
18354
18372
|
// lib/components/trace-hint.ts
|
|
18355
18373
|
import { distance as distance44, layer_ref as layer_ref12, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
18356
|
-
import { z as
|
|
18357
|
-
var routeHintPointProps =
|
|
18374
|
+
import { z as z126 } from "zod";
|
|
18375
|
+
var routeHintPointProps = z126.object({
|
|
18358
18376
|
x: distance44,
|
|
18359
18377
|
y: distance44,
|
|
18360
|
-
via:
|
|
18378
|
+
via: z126.boolean().optional(),
|
|
18361
18379
|
toLayer: layer_ref12.optional()
|
|
18362
18380
|
});
|
|
18363
|
-
var traceHintProps =
|
|
18364
|
-
for:
|
|
18381
|
+
var traceHintProps = z126.object({
|
|
18382
|
+
for: z126.string().optional().describe(
|
|
18365
18383
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
18366
18384
|
),
|
|
18367
|
-
order:
|
|
18385
|
+
order: z126.number().optional(),
|
|
18368
18386
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
18369
|
-
offsets:
|
|
18370
|
-
traceWidth:
|
|
18387
|
+
offsets: z126.array(route_hint_point6).or(z126.array(routeHintPointProps)).optional(),
|
|
18388
|
+
traceWidth: z126.number().optional()
|
|
18371
18389
|
});
|
|
18372
18390
|
|
|
18373
18391
|
// lib/components/port.ts
|
|
18374
|
-
import { z as
|
|
18392
|
+
import { z as z127 } from "zod";
|
|
18375
18393
|
var portProps = commonLayoutProps.extend({
|
|
18376
|
-
name:
|
|
18377
|
-
pinNumber:
|
|
18378
|
-
schStemLength:
|
|
18379
|
-
aliases:
|
|
18380
|
-
layer:
|
|
18381
|
-
layers:
|
|
18382
|
-
schX:
|
|
18383
|
-
schY:
|
|
18394
|
+
name: z127.string().optional(),
|
|
18395
|
+
pinNumber: z127.number().optional(),
|
|
18396
|
+
schStemLength: z127.number().optional(),
|
|
18397
|
+
aliases: z127.array(z127.string()).optional(),
|
|
18398
|
+
layer: z127.string().optional(),
|
|
18399
|
+
layers: z127.array(z127.string()).optional(),
|
|
18400
|
+
schX: z127.number().optional(),
|
|
18401
|
+
schY: z127.number().optional(),
|
|
18384
18402
|
direction: direction.optional(),
|
|
18385
|
-
connectsTo:
|
|
18403
|
+
connectsTo: z127.string().or(z127.array(z127.string())).optional(),
|
|
18386
18404
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
18387
|
-
hasInversionCircle:
|
|
18405
|
+
hasInversionCircle: z127.boolean().optional()
|
|
18388
18406
|
});
|
|
18389
18407
|
|
|
18390
18408
|
// lib/components/pcb-note-text.ts
|
|
18391
18409
|
import { length as length11 } from "circuit-json";
|
|
18392
|
-
import { z as
|
|
18410
|
+
import { z as z128 } from "zod";
|
|
18393
18411
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
18394
|
-
text:
|
|
18395
|
-
anchorAlignment:
|
|
18396
|
-
font:
|
|
18412
|
+
text: z128.string(),
|
|
18413
|
+
anchorAlignment: z128.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18414
|
+
font: z128.enum(["tscircuit2024"]).optional(),
|
|
18397
18415
|
fontSize: length11.optional(),
|
|
18398
|
-
color:
|
|
18416
|
+
color: z128.string().optional()
|
|
18399
18417
|
});
|
|
18400
18418
|
expectTypesMatch(true);
|
|
18401
18419
|
|
|
18402
18420
|
// lib/components/pcb-note-rect.ts
|
|
18403
18421
|
import { distance as distance45 } from "circuit-json";
|
|
18404
|
-
import { z as
|
|
18422
|
+
import { z as z129 } from "zod";
|
|
18405
18423
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18406
18424
|
width: distance45,
|
|
18407
18425
|
height: distance45,
|
|
18408
18426
|
strokeWidth: distance45.optional(),
|
|
18409
|
-
isFilled:
|
|
18410
|
-
hasStroke:
|
|
18411
|
-
isStrokeDashed:
|
|
18412
|
-
color:
|
|
18427
|
+
isFilled: z129.boolean().optional(),
|
|
18428
|
+
hasStroke: z129.boolean().optional(),
|
|
18429
|
+
isStrokeDashed: z129.boolean().optional(),
|
|
18430
|
+
color: z129.string().optional(),
|
|
18413
18431
|
cornerRadius: distance45.optional()
|
|
18414
18432
|
});
|
|
18415
18433
|
expectTypesMatch(true);
|
|
@@ -18419,7 +18437,7 @@ import {
|
|
|
18419
18437
|
length as length12,
|
|
18420
18438
|
route_hint_point as route_hint_point7
|
|
18421
18439
|
} from "circuit-json";
|
|
18422
|
-
import { z as
|
|
18440
|
+
import { z as z130 } from "zod";
|
|
18423
18441
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
18424
18442
|
pcbLeftEdgeX: true,
|
|
18425
18443
|
pcbRightEdgeX: true,
|
|
@@ -18431,15 +18449,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
18431
18449
|
pcbOffsetY: true,
|
|
18432
18450
|
pcbRotation: true
|
|
18433
18451
|
}).extend({
|
|
18434
|
-
route:
|
|
18452
|
+
route: z130.array(route_hint_point7),
|
|
18435
18453
|
strokeWidth: length12.optional(),
|
|
18436
|
-
color:
|
|
18454
|
+
color: z130.string().optional()
|
|
18437
18455
|
});
|
|
18438
18456
|
expectTypesMatch(true);
|
|
18439
18457
|
|
|
18440
18458
|
// lib/components/pcb-note-line.ts
|
|
18441
18459
|
import { distance as distance46 } from "circuit-json";
|
|
18442
|
-
import { z as
|
|
18460
|
+
import { z as z131 } from "zod";
|
|
18443
18461
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
18444
18462
|
pcbLeftEdgeX: true,
|
|
18445
18463
|
pcbRightEdgeX: true,
|
|
@@ -18456,15 +18474,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
18456
18474
|
x2: distance46,
|
|
18457
18475
|
y2: distance46,
|
|
18458
18476
|
strokeWidth: distance46.optional(),
|
|
18459
|
-
color:
|
|
18460
|
-
isDashed:
|
|
18477
|
+
color: z131.string().optional(),
|
|
18478
|
+
isDashed: z131.boolean().optional()
|
|
18461
18479
|
});
|
|
18462
18480
|
expectTypesMatch(true);
|
|
18463
18481
|
|
|
18464
18482
|
// lib/components/pcb-note-dimension.ts
|
|
18465
18483
|
import { distance as distance47, length as length13 } from "circuit-json";
|
|
18466
|
-
import { z as
|
|
18467
|
-
var dimensionTarget2 =
|
|
18484
|
+
import { z as z132 } from "zod";
|
|
18485
|
+
var dimensionTarget2 = z132.union([z132.string(), point]);
|
|
18468
18486
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
18469
18487
|
pcbLeftEdgeX: true,
|
|
18470
18488
|
pcbRightEdgeX: true,
|
|
@@ -18478,101 +18496,101 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18478
18496
|
}).extend({
|
|
18479
18497
|
from: dimensionTarget2,
|
|
18480
18498
|
to: dimensionTarget2,
|
|
18481
|
-
text:
|
|
18499
|
+
text: z132.string().optional(),
|
|
18482
18500
|
offset: distance47.optional(),
|
|
18483
|
-
font:
|
|
18501
|
+
font: z132.enum(["tscircuit2024"]).optional(),
|
|
18484
18502
|
fontSize: length13.optional(),
|
|
18485
|
-
color:
|
|
18503
|
+
color: z132.string().optional(),
|
|
18486
18504
|
arrowSize: distance47.optional(),
|
|
18487
|
-
units:
|
|
18488
|
-
outerEdgeToEdge:
|
|
18489
|
-
centerToCenter:
|
|
18490
|
-
innerEdgeToEdge:
|
|
18505
|
+
units: z132.enum(["in", "mm"]).optional(),
|
|
18506
|
+
outerEdgeToEdge: z132.literal(true).optional(),
|
|
18507
|
+
centerToCenter: z132.literal(true).optional(),
|
|
18508
|
+
innerEdgeToEdge: z132.literal(true).optional()
|
|
18491
18509
|
});
|
|
18492
18510
|
expectTypesMatch(
|
|
18493
18511
|
true
|
|
18494
18512
|
);
|
|
18495
18513
|
|
|
18496
18514
|
// lib/platformConfig.ts
|
|
18497
|
-
import { z as
|
|
18498
|
-
var unvalidatedCircuitJson =
|
|
18499
|
-
var footprintLibraryResult =
|
|
18500
|
-
footprintCircuitJson:
|
|
18515
|
+
import { z as z133 } from "zod";
|
|
18516
|
+
var unvalidatedCircuitJson = z133.array(z133.any()).describe("Circuit JSON");
|
|
18517
|
+
var footprintLibraryResult = z133.object({
|
|
18518
|
+
footprintCircuitJson: z133.array(z133.any()),
|
|
18501
18519
|
cadModel: cadModelProp.optional()
|
|
18502
18520
|
});
|
|
18503
|
-
var pathToCircuitJsonFn =
|
|
18504
|
-
|
|
18505
|
-
|
|
18506
|
-
|
|
18507
|
-
).returns(
|
|
18521
|
+
var pathToCircuitJsonFn = z133.function().args(z133.string()).returns(z133.promise(footprintLibraryResult)).or(
|
|
18522
|
+
z133.function().args(
|
|
18523
|
+
z133.string(),
|
|
18524
|
+
z133.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
18525
|
+
).returns(z133.promise(footprintLibraryResult))
|
|
18508
18526
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
18509
|
-
var footprintFileParserEntry =
|
|
18510
|
-
loadFromUrl:
|
|
18527
|
+
var footprintFileParserEntry = z133.object({
|
|
18528
|
+
loadFromUrl: z133.function().args(z133.string()).returns(z133.promise(footprintLibraryResult)).describe(
|
|
18511
18529
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
18512
18530
|
)
|
|
18513
18531
|
});
|
|
18514
|
-
var spiceEngineSimulationResult =
|
|
18515
|
-
engineVersionString:
|
|
18532
|
+
var spiceEngineSimulationResult = z133.object({
|
|
18533
|
+
engineVersionString: z133.string().optional(),
|
|
18516
18534
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
18517
18535
|
});
|
|
18518
|
-
var spiceEngineZod =
|
|
18519
|
-
simulate:
|
|
18536
|
+
var spiceEngineZod = z133.object({
|
|
18537
|
+
simulate: z133.function().args(z133.string()).returns(z133.promise(spiceEngineSimulationResult)).describe(
|
|
18520
18538
|
"A function that takes a SPICE string and returns a simulation result"
|
|
18521
18539
|
)
|
|
18522
18540
|
});
|
|
18523
|
-
var defaultSpiceEngine =
|
|
18541
|
+
var defaultSpiceEngine = z133.custom(
|
|
18524
18542
|
(value) => typeof value === "string"
|
|
18525
18543
|
);
|
|
18526
|
-
var autorouterInstance =
|
|
18527
|
-
run:
|
|
18528
|
-
getOutputSimpleRouteJson:
|
|
18544
|
+
var autorouterInstance = z133.object({
|
|
18545
|
+
run: z133.function().args().returns(z133.promise(z133.unknown())).describe("Run the autorouter"),
|
|
18546
|
+
getOutputSimpleRouteJson: z133.function().args().returns(z133.promise(z133.any())).describe("Get the resulting SimpleRouteJson")
|
|
18529
18547
|
});
|
|
18530
|
-
var autorouterDefinition =
|
|
18531
|
-
createAutorouter:
|
|
18548
|
+
var autorouterDefinition = z133.object({
|
|
18549
|
+
createAutorouter: z133.function().args(z133.any(), z133.any().optional()).returns(z133.union([autorouterInstance, z133.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
18532
18550
|
});
|
|
18533
|
-
var platformFetch =
|
|
18534
|
-
var platformConfig =
|
|
18551
|
+
var platformFetch = z133.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
18552
|
+
var platformConfig = z133.object({
|
|
18535
18553
|
partsEngine: partsEngine.optional(),
|
|
18536
18554
|
autorouter: autorouterProp.optional(),
|
|
18537
|
-
autorouterMap:
|
|
18555
|
+
autorouterMap: z133.record(z133.string(), autorouterDefinition).optional(),
|
|
18538
18556
|
registryApiUrl: url.optional(),
|
|
18539
18557
|
cloudAutorouterUrl: url.optional(),
|
|
18540
|
-
projectName:
|
|
18558
|
+
projectName: z133.string().optional(),
|
|
18541
18559
|
projectBaseUrl: url.optional(),
|
|
18542
|
-
version:
|
|
18560
|
+
version: z133.string().optional(),
|
|
18543
18561
|
url: url.optional(),
|
|
18544
|
-
printBoardInformationToSilkscreen:
|
|
18545
|
-
includeBoardFiles:
|
|
18562
|
+
printBoardInformationToSilkscreen: z133.boolean().optional(),
|
|
18563
|
+
includeBoardFiles: z133.array(z133.string()).describe(
|
|
18546
18564
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
18547
18565
|
).optional(),
|
|
18548
|
-
snapshotsDir:
|
|
18566
|
+
snapshotsDir: z133.string().describe(
|
|
18549
18567
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
18550
18568
|
).optional(),
|
|
18551
18569
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
18552
|
-
unitPreference:
|
|
18553
|
-
localCacheEngine:
|
|
18554
|
-
pcbDisabled:
|
|
18555
|
-
routingDisabled:
|
|
18556
|
-
schematicDisabled:
|
|
18557
|
-
partsEngineDisabled:
|
|
18558
|
-
drcChecksDisabled:
|
|
18559
|
-
netlistDrcChecksDisabled:
|
|
18560
|
-
routingDrcChecksDisabled:
|
|
18561
|
-
placementDrcChecksDisabled:
|
|
18562
|
-
pinSpecificationDrcChecksDisabled:
|
|
18563
|
-
spiceEngineMap:
|
|
18564
|
-
footprintLibraryMap:
|
|
18565
|
-
|
|
18566
|
-
|
|
18570
|
+
unitPreference: z133.enum(["mm", "in", "mil"]).optional(),
|
|
18571
|
+
localCacheEngine: z133.any().optional(),
|
|
18572
|
+
pcbDisabled: z133.boolean().optional(),
|
|
18573
|
+
routingDisabled: z133.boolean().optional(),
|
|
18574
|
+
schematicDisabled: z133.boolean().optional(),
|
|
18575
|
+
partsEngineDisabled: z133.boolean().optional(),
|
|
18576
|
+
drcChecksDisabled: z133.boolean().optional(),
|
|
18577
|
+
netlistDrcChecksDisabled: z133.boolean().optional(),
|
|
18578
|
+
routingDrcChecksDisabled: z133.boolean().optional(),
|
|
18579
|
+
placementDrcChecksDisabled: z133.boolean().optional(),
|
|
18580
|
+
pinSpecificationDrcChecksDisabled: z133.boolean().optional(),
|
|
18581
|
+
spiceEngineMap: z133.record(z133.string(), spiceEngineZod).optional(),
|
|
18582
|
+
footprintLibraryMap: z133.record(
|
|
18583
|
+
z133.string(),
|
|
18584
|
+
z133.union([
|
|
18567
18585
|
pathToCircuitJsonFn,
|
|
18568
|
-
|
|
18569
|
-
|
|
18570
|
-
|
|
18586
|
+
z133.record(
|
|
18587
|
+
z133.string(),
|
|
18588
|
+
z133.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
18571
18589
|
)
|
|
18572
18590
|
])
|
|
18573
18591
|
).optional(),
|
|
18574
|
-
footprintFileParserMap:
|
|
18575
|
-
resolveProjectStaticFileImportUrl:
|
|
18592
|
+
footprintFileParserMap: z133.record(z133.string(), footprintFileParserEntry).optional(),
|
|
18593
|
+
resolveProjectStaticFileImportUrl: z133.function().args(z133.string()).returns(z133.promise(z133.string())).describe(
|
|
18576
18594
|
"A function that returns a string URL for static files for the project"
|
|
18577
18595
|
).optional(),
|
|
18578
18596
|
platformFetch: platformFetch.optional()
|
|
@@ -18664,6 +18682,8 @@ export {
|
|
|
18664
18682
|
edit_schematic_component_location_event,
|
|
18665
18683
|
edit_schematic_group_location_event,
|
|
18666
18684
|
edit_trace_hint_event,
|
|
18685
|
+
enclosureFdmBoxProps,
|
|
18686
|
+
enclosureProps,
|
|
18667
18687
|
explicitPinSideDefinition,
|
|
18668
18688
|
fabricationNoteDimensionProps,
|
|
18669
18689
|
fabricationNotePathProps,
|