@tscircuit/props 0.0.684 → 0.0.686
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 +6612 -1523
- package/dist/index.js +1348 -1294
- package/dist/index.js.map +1 -1
- package/lib/assembly/cable.ts +26 -0
- package/lib/assembly/index.ts +6 -0
- package/lib/assembly/printedpart.ts +86 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -167,11 +167,21 @@ expectTypesMatch(true);
|
|
|
167
167
|
// lib/assembly/cadassembly.ts
|
|
168
168
|
var assemblyCadAssemblyProps = assemblySubassemblyProps;
|
|
169
169
|
|
|
170
|
-
// lib/assembly/
|
|
170
|
+
// lib/assembly/cable.ts
|
|
171
171
|
import { z as z8 } from "zod";
|
|
172
|
-
var
|
|
173
|
-
name: z8.string().
|
|
174
|
-
|
|
172
|
+
var assemblyCableProps = z8.object({
|
|
173
|
+
name: z8.string().trim().min(1),
|
|
174
|
+
from: z8.string().trim().min(1),
|
|
175
|
+
to: z8.string().trim().min(1),
|
|
176
|
+
standard: z8.literal("usb_c").optional()
|
|
177
|
+
});
|
|
178
|
+
expectTypesMatch(true);
|
|
179
|
+
|
|
180
|
+
// lib/assembly/device.ts
|
|
181
|
+
import { z as z9 } from "zod";
|
|
182
|
+
var assemblyDeviceProps = z9.object({
|
|
183
|
+
name: z9.string().optional(),
|
|
184
|
+
model: z9.string().trim().min(1).optional(),
|
|
175
185
|
modelUrl: url.refine((value) => value.trim().length > 0, {
|
|
176
186
|
message: "modelUrl cannot be empty"
|
|
177
187
|
}).optional()
|
|
@@ -184,35 +194,75 @@ var assemblyDeviceProps = z8.object({
|
|
|
184
194
|
);
|
|
185
195
|
expectTypesMatch(true);
|
|
186
196
|
|
|
197
|
+
// lib/assembly/printedpart.ts
|
|
198
|
+
import { isValidElement } from "react";
|
|
199
|
+
import { z as z10 } from "zod";
|
|
200
|
+
var assemblyPrintedPartProps = z10.object({
|
|
201
|
+
name: z10.string().trim().min(1),
|
|
202
|
+
displayName: z10.string().optional(),
|
|
203
|
+
jscad: z10.custom(isValidElement, "Expected jscad-fiber JSX").optional(),
|
|
204
|
+
model: z10.string().trim().min(1).optional(),
|
|
205
|
+
modelUrl: url.refine((value) => value.trim().length > 0, "modelUrl cannot be empty").optional(),
|
|
206
|
+
cadModel: cadModelProp.optional(),
|
|
207
|
+
mountedTo: z10.string().trim().regex(/^.+\.[^.]+$/, "Expected part.face").optional(),
|
|
208
|
+
mountFace: z10.string().trim().min(1).optional(),
|
|
209
|
+
mountGap: distance.pipe(z10.number().nonnegative().finite()).optional()
|
|
210
|
+
}).superRefine((part, ctx) => {
|
|
211
|
+
if ([part.jscad, part.model, part.modelUrl, part.cadModel].filter(
|
|
212
|
+
(value) => value !== void 0
|
|
213
|
+
).length !== 1) {
|
|
214
|
+
ctx.addIssue({
|
|
215
|
+
code: z10.ZodIssueCode.custom,
|
|
216
|
+
path: ["jscad"],
|
|
217
|
+
message: "Provide exactly one of jscad, model, modelUrl, or cadModel"
|
|
218
|
+
});
|
|
219
|
+
}
|
|
220
|
+
if (part.mountedTo === void 0 !== (part.mountFace === void 0)) {
|
|
221
|
+
ctx.addIssue({
|
|
222
|
+
code: z10.ZodIssueCode.custom,
|
|
223
|
+
path: ["mountFace"],
|
|
224
|
+
message: "Provide mountedTo and mountFace together"
|
|
225
|
+
});
|
|
226
|
+
}
|
|
227
|
+
if (part.mountGap !== void 0 && part.mountedTo === void 0) {
|
|
228
|
+
ctx.addIssue({
|
|
229
|
+
code: z10.ZodIssueCode.custom,
|
|
230
|
+
path: ["mountGap"],
|
|
231
|
+
message: "mountGap requires mountedTo"
|
|
232
|
+
});
|
|
233
|
+
}
|
|
234
|
+
});
|
|
235
|
+
expectTypesMatch(true);
|
|
236
|
+
|
|
187
237
|
// lib/assembly/motor.ts
|
|
188
|
-
import { z as
|
|
189
|
-
var assemblyMotorProps =
|
|
190
|
-
name:
|
|
238
|
+
import { z as z11 } from "zod";
|
|
239
|
+
var assemblyMotorProps = z11.object({
|
|
240
|
+
name: z11.string().refine((value) => value.trim().length > 0, {
|
|
191
241
|
message: "name cannot be empty"
|
|
192
242
|
}),
|
|
193
|
-
displayName:
|
|
194
|
-
standard:
|
|
195
|
-
model:
|
|
243
|
+
displayName: z11.string().optional(),
|
|
244
|
+
standard: z11.enum(["nema8", "nema17", "nema23"]).optional(),
|
|
245
|
+
model: z11.string().trim().min(1).optional(),
|
|
196
246
|
shaftFacingDirection: cadModelAxisDirection.default("z+"),
|
|
197
|
-
wireConnection:
|
|
247
|
+
wireConnection: z11.enum(["none", "stubs", "jst-ph-6"]).optional()
|
|
198
248
|
}).superRefine((motor, context) => {
|
|
199
249
|
if (motor.model !== void 0 && motor.wireConnection !== void 0) {
|
|
200
250
|
context.addIssue({
|
|
201
|
-
code:
|
|
251
|
+
code: z11.ZodIssueCode.custom,
|
|
202
252
|
message: "Set wireConnection in the custom model string, or use standard",
|
|
203
253
|
path: ["wireConnection"]
|
|
204
254
|
});
|
|
205
255
|
}
|
|
206
256
|
if (motor.standard === void 0 && motor.model === void 0) {
|
|
207
257
|
context.addIssue({
|
|
208
|
-
code:
|
|
258
|
+
code: z11.ZodIssueCode.custom,
|
|
209
259
|
message: "Provide standard or model",
|
|
210
260
|
path: ["standard"]
|
|
211
261
|
});
|
|
212
262
|
}
|
|
213
263
|
if (motor.standard !== void 0 && motor.model !== void 0) {
|
|
214
264
|
context.addIssue({
|
|
215
|
-
code:
|
|
265
|
+
code: z11.ZodIssueCode.custom,
|
|
216
266
|
message: "Provide either standard or model, not both",
|
|
217
267
|
path: ["model"]
|
|
218
268
|
});
|
|
@@ -221,16 +271,16 @@ var assemblyMotorProps = z9.object({
|
|
|
221
271
|
expectTypesMatch(true);
|
|
222
272
|
|
|
223
273
|
// lib/assembly/screen.ts
|
|
224
|
-
import { z as
|
|
225
|
-
var nonemptyString = (fieldName) =>
|
|
274
|
+
import { z as z12 } from "zod";
|
|
275
|
+
var nonemptyString = (fieldName) => z12.string().refine((value) => value.trim().length > 0, {
|
|
226
276
|
message: `${fieldName} cannot be empty`
|
|
227
277
|
});
|
|
228
278
|
var positiveDistance = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
229
279
|
message: `${fieldName} must be a positive finite distance`
|
|
230
280
|
});
|
|
231
|
-
var assemblyScreenProps =
|
|
281
|
+
var assemblyScreenProps = z12.object({
|
|
232
282
|
name: nonemptyString("name"),
|
|
233
|
-
model:
|
|
283
|
+
model: z12.string().trim().min(1).optional(),
|
|
234
284
|
modelUrl: url.refine((value) => value.trim().length > 0, {
|
|
235
285
|
message: "modelUrl cannot be empty"
|
|
236
286
|
}).optional(),
|
|
@@ -241,14 +291,14 @@ var assemblyScreenProps = z10.object({
|
|
|
241
291
|
}).superRefine((screen, context) => {
|
|
242
292
|
if (screen.model !== void 0 && (screen.modelUrl !== void 0 || screen.cadModel !== void 0)) {
|
|
243
293
|
context.addIssue({
|
|
244
|
-
code:
|
|
294
|
+
code: z12.ZodIssueCode.custom,
|
|
245
295
|
message: "Provide only one of model, modelUrl, or cadModel",
|
|
246
296
|
path: ["model"]
|
|
247
297
|
});
|
|
248
298
|
}
|
|
249
299
|
if (screen.modelUrl !== void 0 && screen.cadModel !== void 0) {
|
|
250
300
|
context.addIssue({
|
|
251
|
-
code:
|
|
301
|
+
code: z12.ZodIssueCode.custom,
|
|
252
302
|
message: "Provide either modelUrl or cadModel, not both",
|
|
253
303
|
path: ["modelUrl"]
|
|
254
304
|
});
|
|
@@ -257,7 +307,7 @@ var assemblyScreenProps = z10.object({
|
|
|
257
307
|
const hasHeight = screen.height !== void 0;
|
|
258
308
|
if (hasWidth !== hasHeight) {
|
|
259
309
|
context.addIssue({
|
|
260
|
-
code:
|
|
310
|
+
code: z12.ZodIssueCode.custom,
|
|
261
311
|
message: "width and height must be provided together",
|
|
262
312
|
path: hasWidth ? ["height"] : ["width"]
|
|
263
313
|
});
|
|
@@ -265,7 +315,7 @@ var assemblyScreenProps = z10.object({
|
|
|
265
315
|
}
|
|
266
316
|
if (!hasWidth && screen.cadModel === void 0 && screen.modelUrl === void 0 && screen.model === void 0) {
|
|
267
317
|
context.addIssue({
|
|
268
|
-
code:
|
|
318
|
+
code: z12.ZodIssueCode.custom,
|
|
269
319
|
message: "provide width and height, model, cadModel, or modelUrl",
|
|
270
320
|
path: []
|
|
271
321
|
});
|
|
@@ -274,7 +324,7 @@ var assemblyScreenProps = z10.object({
|
|
|
274
324
|
expectTypesMatch(true);
|
|
275
325
|
|
|
276
326
|
// lib/assembly/board-mounting.ts
|
|
277
|
-
import { z as
|
|
327
|
+
import { z as z13 } from "zod";
|
|
278
328
|
var identityPathPattern = "[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)*";
|
|
279
329
|
var referencePattern = "[A-Za-z_][A-Za-z0-9_-]*(?:\\.[A-Za-z_][A-Za-z0-9_-]*)+";
|
|
280
330
|
var reference = new RegExp(`^${referencePattern}$`);
|
|
@@ -282,53 +332,55 @@ var anchor = new RegExp(`^${identityPathPattern}$`);
|
|
|
282
332
|
var expression = new RegExp(
|
|
283
333
|
`^calc\\(\\s*(${referencePattern})\\s*(?:([+-])\\s*((?:\\d+(?:\\.\\d*)?|\\.\\d+))\\s*(degcw|degccw))?\\s*\\)$`
|
|
284
334
|
);
|
|
285
|
-
var boardMountRotation =
|
|
335
|
+
var boardMountRotation = z13.string().trim().superRefine((value, ctx) => {
|
|
286
336
|
if (reference.test(value)) return;
|
|
287
337
|
const match = expression.exec(value);
|
|
288
338
|
if (!match) {
|
|
289
339
|
ctx.addIssue({
|
|
290
|
-
code:
|
|
340
|
+
code: z13.ZodIssueCode.custom,
|
|
291
341
|
message: "Expected a qualified mounting reference or calc(reference +/- Ndegcw|Ndegccw)"
|
|
292
342
|
});
|
|
293
343
|
return;
|
|
294
344
|
}
|
|
295
345
|
if (match[3] !== void 0 && !Number.isFinite(Number(match[3]))) {
|
|
296
346
|
ctx.addIssue({
|
|
297
|
-
code:
|
|
347
|
+
code: z13.ZodIssueCode.custom,
|
|
298
348
|
message: "Mount rotation angle must be finite"
|
|
299
349
|
});
|
|
300
350
|
}
|
|
301
351
|
});
|
|
302
|
-
var boardMountRotationAnchor =
|
|
352
|
+
var boardMountRotationAnchor = z13.custom((value) => typeof value === "string", {
|
|
303
353
|
message: "Expected a board edge or component identity path"
|
|
304
354
|
}).transform((value) => value.trim()).refine((value) => anchor.test(value), {
|
|
305
355
|
message: "Expected a board edge or component identity path"
|
|
306
356
|
});
|
|
307
|
-
var boardMountOrientation =
|
|
357
|
+
var boardMountOrientation = z13.enum([
|
|
308
358
|
"top_layer_toward_mount_face",
|
|
309
359
|
"bottom_layer_toward_mount_face"
|
|
310
360
|
]);
|
|
311
361
|
|
|
312
362
|
// lib/assembly/index.ts
|
|
313
363
|
var assemblyProps = {
|
|
364
|
+
cable: assemblyCableProps,
|
|
314
365
|
device: assemblyDeviceProps,
|
|
315
366
|
motor: assemblyMotorProps,
|
|
367
|
+
printedpart: assemblyPrintedPartProps,
|
|
316
368
|
screen: assemblyScreenProps,
|
|
317
369
|
subassembly: assemblySubassemblyProps,
|
|
318
370
|
cadassembly: assemblyCadAssemblyProps
|
|
319
371
|
};
|
|
320
372
|
|
|
321
373
|
// lib/enclosure/cutout-aperture.ts
|
|
322
|
-
import { z as
|
|
374
|
+
import { z as z14 } from "zod";
|
|
323
375
|
var enclosureCutoutApertureShapes = ["pill", "rect", "circle"];
|
|
324
|
-
var cutoutApertureBaseProps =
|
|
376
|
+
var cutoutApertureBaseProps = z14.object({
|
|
325
377
|
margin: distance.optional(),
|
|
326
378
|
widthDimensionOffset: distance.optional(),
|
|
327
379
|
heightDimensionOffset: distance.optional(),
|
|
328
380
|
depth: distance.optional()
|
|
329
381
|
});
|
|
330
382
|
var apertureOnlyProps = cutoutApertureBaseProps.shape;
|
|
331
|
-
var enclosureCutoutApertureProps =
|
|
383
|
+
var enclosureCutoutApertureProps = z14.discriminatedUnion("shape", [
|
|
332
384
|
pillShapeProps.extend(apertureOnlyProps),
|
|
333
385
|
rectShapeProps.extend(apertureOnlyProps),
|
|
334
386
|
circleShapeProps.extend(apertureOnlyProps)
|
|
@@ -336,10 +388,10 @@ var enclosureCutoutApertureProps = z12.discriminatedUnion("shape", [
|
|
|
336
388
|
expectTypesMatch(true);
|
|
337
389
|
|
|
338
390
|
// lib/enclosure/fdm/box.ts
|
|
339
|
-
import { z as
|
|
340
|
-
var enclosureFdmBoxProps =
|
|
341
|
-
name:
|
|
342
|
-
boardRef:
|
|
391
|
+
import { z as z15 } from "zod";
|
|
392
|
+
var enclosureFdmBoxProps = z15.object({
|
|
393
|
+
name: z15.string().optional(),
|
|
394
|
+
boardRef: z15.string().min(1),
|
|
343
395
|
width: distance.optional(),
|
|
344
396
|
height: distance.optional(),
|
|
345
397
|
depth: distance.optional(),
|
|
@@ -350,8 +402,8 @@ var enclosureFdmBoxProps = z13.object({
|
|
|
350
402
|
standoffHeight: distance.optional(),
|
|
351
403
|
topHeadroom: distance.optional(),
|
|
352
404
|
lidLipDepth: distance.optional(),
|
|
353
|
-
disableCutouts:
|
|
354
|
-
showHiddenEdges:
|
|
405
|
+
disableCutouts: z15.boolean().optional(),
|
|
406
|
+
showHiddenEdges: z15.boolean().optional()
|
|
355
407
|
});
|
|
356
408
|
expectTypesMatch(true);
|
|
357
409
|
|
|
@@ -364,8 +416,8 @@ var enclosureProps = {
|
|
|
364
416
|
};
|
|
365
417
|
|
|
366
418
|
// lib/common/portHints.ts
|
|
367
|
-
import { z as
|
|
368
|
-
var portHints =
|
|
419
|
+
import { z as z16 } from "zod";
|
|
420
|
+
var portHints = z16.array(z16.string().or(z16.number()));
|
|
369
421
|
expectTypesMatch(true);
|
|
370
422
|
|
|
371
423
|
// lib/common/layout.ts
|
|
@@ -375,20 +427,20 @@ import {
|
|
|
375
427
|
rotation as rotation2,
|
|
376
428
|
supplier_name
|
|
377
429
|
} from "circuit-json";
|
|
378
|
-
import { z as
|
|
430
|
+
import { z as z26 } from "zod";
|
|
379
431
|
|
|
380
432
|
// lib/common/footprintProp.ts
|
|
381
|
-
import { z as
|
|
382
|
-
var footprintProp =
|
|
433
|
+
import { z as z17 } from "zod";
|
|
434
|
+
var footprintProp = z17.custom((v) => true);
|
|
383
435
|
|
|
384
436
|
// lib/common/kicadFootprintMetadata.ts
|
|
385
437
|
import { distance as distance4, rotation } from "circuit-json";
|
|
386
|
-
import { z as
|
|
438
|
+
import { z as z19 } from "zod";
|
|
387
439
|
|
|
388
440
|
// lib/common/point.ts
|
|
389
441
|
import { distance as distance3 } from "circuit-json";
|
|
390
|
-
import { z as
|
|
391
|
-
var point =
|
|
442
|
+
import { z as z18 } from "zod";
|
|
443
|
+
var point = z18.object({
|
|
392
444
|
x: distance3,
|
|
393
445
|
y: distance3
|
|
394
446
|
});
|
|
@@ -398,25 +450,25 @@ var kicadAt = point.extend({
|
|
|
398
450
|
rotation: rotation.optional()
|
|
399
451
|
});
|
|
400
452
|
expectTypesMatch(true);
|
|
401
|
-
var kicadFont =
|
|
453
|
+
var kicadFont = z19.object({
|
|
402
454
|
size: point.optional(),
|
|
403
455
|
thickness: distance4.optional()
|
|
404
456
|
});
|
|
405
457
|
expectTypesMatch(true);
|
|
406
|
-
var kicadEffects =
|
|
458
|
+
var kicadEffects = z19.object({
|
|
407
459
|
font: kicadFont.optional()
|
|
408
460
|
});
|
|
409
461
|
expectTypesMatch(true);
|
|
410
|
-
var kicadProperty =
|
|
411
|
-
value:
|
|
462
|
+
var kicadProperty = z19.object({
|
|
463
|
+
value: z19.string(),
|
|
412
464
|
at: kicadAt.optional(),
|
|
413
|
-
layer:
|
|
414
|
-
uuid:
|
|
415
|
-
hide:
|
|
465
|
+
layer: z19.string().optional(),
|
|
466
|
+
uuid: z19.string().optional(),
|
|
467
|
+
hide: z19.boolean().optional(),
|
|
416
468
|
effects: kicadEffects.optional()
|
|
417
469
|
});
|
|
418
470
|
expectTypesMatch(true);
|
|
419
|
-
var kicadFootprintProperties =
|
|
471
|
+
var kicadFootprintProperties = z19.object({
|
|
420
472
|
Reference: kicadProperty.optional(),
|
|
421
473
|
Value: kicadProperty.optional(),
|
|
422
474
|
Datasheet: kicadProperty.optional(),
|
|
@@ -425,74 +477,74 @@ var kicadFootprintProperties = z17.object({
|
|
|
425
477
|
expectTypesMatch(
|
|
426
478
|
true
|
|
427
479
|
);
|
|
428
|
-
var kicadFootprintAttributes =
|
|
429
|
-
through_hole:
|
|
430
|
-
smd:
|
|
431
|
-
exclude_from_pos_files:
|
|
432
|
-
exclude_from_bom:
|
|
480
|
+
var kicadFootprintAttributes = z19.object({
|
|
481
|
+
through_hole: z19.boolean().optional(),
|
|
482
|
+
smd: z19.boolean().optional(),
|
|
483
|
+
exclude_from_pos_files: z19.boolean().optional(),
|
|
484
|
+
exclude_from_bom: z19.boolean().optional()
|
|
433
485
|
});
|
|
434
486
|
expectTypesMatch(
|
|
435
487
|
true
|
|
436
488
|
);
|
|
437
|
-
var kicadFootprintPad =
|
|
438
|
-
name:
|
|
439
|
-
type:
|
|
440
|
-
shape:
|
|
489
|
+
var kicadFootprintPad = z19.object({
|
|
490
|
+
name: z19.string(),
|
|
491
|
+
type: z19.string(),
|
|
492
|
+
shape: z19.string().optional(),
|
|
441
493
|
at: kicadAt.optional(),
|
|
442
494
|
size: point.optional(),
|
|
443
495
|
drill: distance4.optional(),
|
|
444
|
-
layers:
|
|
445
|
-
removeUnusedLayers:
|
|
446
|
-
uuid:
|
|
496
|
+
layers: z19.array(z19.string()).optional(),
|
|
497
|
+
removeUnusedLayers: z19.boolean().optional(),
|
|
498
|
+
uuid: z19.string().optional()
|
|
447
499
|
});
|
|
448
500
|
expectTypesMatch(true);
|
|
449
|
-
var kicadFootprintModel =
|
|
450
|
-
path:
|
|
501
|
+
var kicadFootprintModel = z19.object({
|
|
502
|
+
path: z19.string(),
|
|
451
503
|
offset: point3.optional(),
|
|
452
504
|
scale: point3.optional(),
|
|
453
505
|
rotate: point3.optional()
|
|
454
506
|
});
|
|
455
507
|
expectTypesMatch(true);
|
|
456
|
-
var kicadFootprintMetadata =
|
|
457
|
-
footprintName:
|
|
458
|
-
version:
|
|
459
|
-
generator:
|
|
460
|
-
generatorVersion:
|
|
461
|
-
layer:
|
|
508
|
+
var kicadFootprintMetadata = z19.object({
|
|
509
|
+
footprintName: z19.string().optional(),
|
|
510
|
+
version: z19.union([z19.number(), z19.string()]).optional(),
|
|
511
|
+
generator: z19.string().optional(),
|
|
512
|
+
generatorVersion: z19.union([z19.number(), z19.string()]).optional(),
|
|
513
|
+
layer: z19.string().optional(),
|
|
462
514
|
properties: kicadFootprintProperties.optional(),
|
|
463
515
|
attributes: kicadFootprintAttributes.optional(),
|
|
464
|
-
pads:
|
|
465
|
-
embeddedFonts:
|
|
516
|
+
pads: z19.array(kicadFootprintPad).optional(),
|
|
517
|
+
embeddedFonts: z19.boolean().optional(),
|
|
466
518
|
model: kicadFootprintModel.optional()
|
|
467
519
|
});
|
|
468
520
|
expectTypesMatch(true);
|
|
469
521
|
|
|
470
522
|
// lib/common/kicadSymbolMetadata.ts
|
|
471
523
|
import { distance as distance5 } from "circuit-json";
|
|
472
|
-
import { z as
|
|
473
|
-
var kicadSymbolPinNumbers =
|
|
474
|
-
hide:
|
|
524
|
+
import { z as z20 } from "zod";
|
|
525
|
+
var kicadSymbolPinNumbers = z20.object({
|
|
526
|
+
hide: z20.boolean().optional()
|
|
475
527
|
});
|
|
476
528
|
expectTypesMatch(true);
|
|
477
|
-
var kicadSymbolPinNames =
|
|
529
|
+
var kicadSymbolPinNames = z20.object({
|
|
478
530
|
offset: distance5.optional(),
|
|
479
|
-
hide:
|
|
531
|
+
hide: z20.boolean().optional()
|
|
480
532
|
});
|
|
481
533
|
expectTypesMatch(true);
|
|
482
|
-
var kicadSymbolEffects =
|
|
534
|
+
var kicadSymbolEffects = z20.object({
|
|
483
535
|
font: kicadFont.optional(),
|
|
484
|
-
justify:
|
|
485
|
-
hide:
|
|
536
|
+
justify: z20.union([z20.string(), z20.array(z20.string())]).optional(),
|
|
537
|
+
hide: z20.boolean().optional()
|
|
486
538
|
});
|
|
487
539
|
expectTypesMatch(true);
|
|
488
|
-
var kicadSymbolProperty =
|
|
489
|
-
value:
|
|
490
|
-
id:
|
|
540
|
+
var kicadSymbolProperty = z20.object({
|
|
541
|
+
value: z20.string(),
|
|
542
|
+
id: z20.union([z20.number(), z20.string()]).optional(),
|
|
491
543
|
at: kicadAt.optional(),
|
|
492
544
|
effects: kicadSymbolEffects.optional()
|
|
493
545
|
});
|
|
494
546
|
expectTypesMatch(true);
|
|
495
|
-
var kicadSymbolProperties =
|
|
547
|
+
var kicadSymbolProperties = z20.object({
|
|
496
548
|
Reference: kicadSymbolProperty.optional(),
|
|
497
549
|
Value: kicadSymbolProperty.optional(),
|
|
498
550
|
Footprint: kicadSymbolProperty.optional(),
|
|
@@ -502,55 +554,55 @@ var kicadSymbolProperties = z18.object({
|
|
|
502
554
|
ki_fp_filters: kicadSymbolProperty.optional()
|
|
503
555
|
});
|
|
504
556
|
expectTypesMatch(true);
|
|
505
|
-
var kicadSymbolMetadata =
|
|
506
|
-
symbolName:
|
|
507
|
-
extends:
|
|
557
|
+
var kicadSymbolMetadata = z20.object({
|
|
558
|
+
symbolName: z20.string().optional(),
|
|
559
|
+
extends: z20.string().optional(),
|
|
508
560
|
pinNumbers: kicadSymbolPinNumbers.optional(),
|
|
509
561
|
pinNames: kicadSymbolPinNames.optional(),
|
|
510
|
-
excludeFromSim:
|
|
511
|
-
inBom:
|
|
512
|
-
onBoard:
|
|
562
|
+
excludeFromSim: z20.boolean().optional(),
|
|
563
|
+
inBom: z20.boolean().optional(),
|
|
564
|
+
onBoard: z20.boolean().optional(),
|
|
513
565
|
properties: kicadSymbolProperties.optional(),
|
|
514
|
-
embeddedFonts:
|
|
566
|
+
embeddedFonts: z20.boolean().optional()
|
|
515
567
|
});
|
|
516
568
|
expectTypesMatch(true);
|
|
517
569
|
|
|
518
570
|
// lib/common/pcbStyle.ts
|
|
519
571
|
import { distance as distance6 } from "circuit-json";
|
|
520
|
-
import { z as
|
|
521
|
-
var pcbStyle =
|
|
572
|
+
import { z as z21 } from "zod";
|
|
573
|
+
var pcbStyle = z21.object({
|
|
522
574
|
silkscreenFontSize: distance6.optional(),
|
|
523
575
|
viaPadDiameter: distance6.optional(),
|
|
524
576
|
viaHoleDiameter: distance6.optional(),
|
|
525
|
-
silkscreenTextPosition:
|
|
526
|
-
|
|
527
|
-
|
|
528
|
-
offsetX:
|
|
529
|
-
offsetY:
|
|
577
|
+
silkscreenTextPosition: z21.union([
|
|
578
|
+
z21.enum(["centered", "outside", "none"]),
|
|
579
|
+
z21.object({
|
|
580
|
+
offsetX: z21.number(),
|
|
581
|
+
offsetY: z21.number()
|
|
530
582
|
})
|
|
531
583
|
]).optional(),
|
|
532
|
-
silkscreenTextVisibility:
|
|
584
|
+
silkscreenTextVisibility: z21.enum(["hidden", "visible", "inherit"]).optional()
|
|
533
585
|
});
|
|
534
586
|
expectTypesMatch(true);
|
|
535
587
|
|
|
536
588
|
// lib/common/pcbSx.ts
|
|
537
589
|
import { length as length2 } from "circuit-json";
|
|
538
|
-
import { z as
|
|
539
|
-
var pcbSxValue =
|
|
590
|
+
import { z as z22 } from "zod";
|
|
591
|
+
var pcbSxValue = z22.object({
|
|
540
592
|
fontSize: length2.optional(),
|
|
541
593
|
pcbX: pcbCoordinate.optional(),
|
|
542
594
|
pcbY: pcbCoordinate.optional(),
|
|
543
|
-
visibility:
|
|
595
|
+
visibility: z22.enum(["hidden", "visible", "inherit"]).optional()
|
|
544
596
|
});
|
|
545
|
-
var pcbSx =
|
|
546
|
-
|
|
597
|
+
var pcbSx = z22.record(
|
|
598
|
+
z22.string(),
|
|
547
599
|
pcbSxValue
|
|
548
600
|
);
|
|
549
601
|
expectTypesMatch(true);
|
|
550
602
|
|
|
551
603
|
// lib/common/pinAttributeMap.ts
|
|
552
|
-
import { z as
|
|
553
|
-
var pinCapability =
|
|
604
|
+
import { z as z23 } from "zod";
|
|
605
|
+
var pinCapability = z23.enum([
|
|
554
606
|
"i2c_sda",
|
|
555
607
|
"i2c_scl",
|
|
556
608
|
"spi_cs",
|
|
@@ -560,61 +612,61 @@ var pinCapability = z21.enum([
|
|
|
560
612
|
"uart_tx",
|
|
561
613
|
"uart_rx"
|
|
562
614
|
]);
|
|
563
|
-
var pinAttributeMap =
|
|
564
|
-
isInput:
|
|
565
|
-
isOutput:
|
|
566
|
-
isBidirectional:
|
|
567
|
-
isPassive:
|
|
568
|
-
canUseTriState:
|
|
569
|
-
isUsingTriState:
|
|
570
|
-
canUseOpenCollector:
|
|
571
|
-
isUsingOpenCollector:
|
|
572
|
-
canUseOpenEmitter:
|
|
573
|
-
isUsingOpenEmitter:
|
|
574
|
-
capabilities:
|
|
575
|
-
activeCapabilities:
|
|
615
|
+
var pinAttributeMap = z23.object({
|
|
616
|
+
isInput: z23.boolean().optional(),
|
|
617
|
+
isOutput: z23.boolean().optional(),
|
|
618
|
+
isBidirectional: z23.boolean().optional(),
|
|
619
|
+
isPassive: z23.boolean().optional(),
|
|
620
|
+
canUseTriState: z23.boolean().optional(),
|
|
621
|
+
isUsingTriState: z23.boolean().optional(),
|
|
622
|
+
canUseOpenCollector: z23.boolean().optional(),
|
|
623
|
+
isUsingOpenCollector: z23.boolean().optional(),
|
|
624
|
+
canUseOpenEmitter: z23.boolean().optional(),
|
|
625
|
+
isUsingOpenEmitter: z23.boolean().optional(),
|
|
626
|
+
capabilities: z23.array(pinCapability).optional(),
|
|
627
|
+
activeCapabilities: z23.array(pinCapability).optional(),
|
|
576
628
|
activeCapability: pinCapability.optional(),
|
|
577
|
-
providesPower:
|
|
578
|
-
requiresPower:
|
|
579
|
-
providesGround:
|
|
580
|
-
requiresGround:
|
|
581
|
-
providesVoltage:
|
|
582
|
-
requiresVoltage:
|
|
583
|
-
doNotConnect:
|
|
584
|
-
includeInBoardPinout:
|
|
585
|
-
highlightColor:
|
|
586
|
-
mustBeConnected:
|
|
587
|
-
canUseInternalPullup:
|
|
588
|
-
isUsingInternalPullup:
|
|
589
|
-
needsExternalPullup:
|
|
590
|
-
canUseInternalPulldown:
|
|
591
|
-
isUsingInternalPulldown:
|
|
592
|
-
needsExternalPulldown:
|
|
593
|
-
canUseOpenDrain:
|
|
594
|
-
isUsingOpenDrain:
|
|
595
|
-
canUsePushPull:
|
|
596
|
-
isUsingPushPull:
|
|
597
|
-
shouldHaveDecouplingCapacitor:
|
|
598
|
-
recommendedDecouplingCapacitorCapacitance:
|
|
599
|
-
isGpio:
|
|
629
|
+
providesPower: z23.boolean().optional(),
|
|
630
|
+
requiresPower: z23.boolean().optional(),
|
|
631
|
+
providesGround: z23.boolean().optional(),
|
|
632
|
+
requiresGround: z23.boolean().optional(),
|
|
633
|
+
providesVoltage: z23.union([z23.string(), z23.number()]).optional(),
|
|
634
|
+
requiresVoltage: z23.union([z23.string(), z23.number()]).optional(),
|
|
635
|
+
doNotConnect: z23.boolean().optional(),
|
|
636
|
+
includeInBoardPinout: z23.boolean().optional(),
|
|
637
|
+
highlightColor: z23.string().optional(),
|
|
638
|
+
mustBeConnected: z23.boolean().optional(),
|
|
639
|
+
canUseInternalPullup: z23.boolean().optional(),
|
|
640
|
+
isUsingInternalPullup: z23.boolean().optional(),
|
|
641
|
+
needsExternalPullup: z23.boolean().optional(),
|
|
642
|
+
canUseInternalPulldown: z23.boolean().optional(),
|
|
643
|
+
isUsingInternalPulldown: z23.boolean().optional(),
|
|
644
|
+
needsExternalPulldown: z23.boolean().optional(),
|
|
645
|
+
canUseOpenDrain: z23.boolean().optional(),
|
|
646
|
+
isUsingOpenDrain: z23.boolean().optional(),
|
|
647
|
+
canUsePushPull: z23.boolean().optional(),
|
|
648
|
+
isUsingPushPull: z23.boolean().optional(),
|
|
649
|
+
shouldHaveDecouplingCapacitor: z23.boolean().optional(),
|
|
650
|
+
recommendedDecouplingCapacitorCapacitance: z23.union([z23.string(), z23.number()]).optional(),
|
|
651
|
+
isGpio: z23.boolean().optional()
|
|
600
652
|
});
|
|
601
653
|
expectTypesMatch(true);
|
|
602
654
|
|
|
603
655
|
// lib/common/schStyle.ts
|
|
604
656
|
import { distance as distance7 } from "circuit-json";
|
|
605
|
-
import { z as
|
|
606
|
-
var schStyle =
|
|
607
|
-
defaultPassiveSize:
|
|
608
|
-
defaultCapacitorOrientation:
|
|
657
|
+
import { z as z24 } from "zod";
|
|
658
|
+
var schStyle = z24.object({
|
|
659
|
+
defaultPassiveSize: z24.union([z24.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
660
|
+
defaultCapacitorOrientation: z24.enum(["vertical", "none"]).optional()
|
|
609
661
|
});
|
|
610
662
|
expectTypesMatch(true);
|
|
611
663
|
|
|
612
664
|
// lib/common/symbolProp.ts
|
|
613
|
-
import { z as
|
|
614
|
-
var symbolProp =
|
|
665
|
+
import { z as z25 } from "zod";
|
|
666
|
+
var symbolProp = z25.custom((v) => true);
|
|
615
667
|
|
|
616
668
|
// lib/common/layout.ts
|
|
617
|
-
var pcbLayoutProps =
|
|
669
|
+
var pcbLayoutProps = z26.object({
|
|
618
670
|
pcbX: pcbCoordinate.optional(),
|
|
619
671
|
pcbY: pcbCoordinate.optional(),
|
|
620
672
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -624,14 +676,14 @@ var pcbLayoutProps = z24.object({
|
|
|
624
676
|
pcbOffsetX: distance8.optional(),
|
|
625
677
|
pcbOffsetY: distance8.optional(),
|
|
626
678
|
pcbRotation: rotation2.optional(),
|
|
627
|
-
pcbPositionAnchor:
|
|
628
|
-
pcbPositionMode:
|
|
679
|
+
pcbPositionAnchor: z26.string().optional(),
|
|
680
|
+
pcbPositionMode: z26.enum([
|
|
629
681
|
"relative_to_group_anchor",
|
|
630
682
|
"auto",
|
|
631
683
|
"relative_to_board_anchor",
|
|
632
684
|
"relative_to_component_anchor"
|
|
633
685
|
]).optional(),
|
|
634
|
-
shouldBeOnEdgeOfBoard:
|
|
686
|
+
shouldBeOnEdgeOfBoard: z26.boolean().optional(),
|
|
635
687
|
layer: layer_ref.optional(),
|
|
636
688
|
pcbMarginTop: distance8.optional(),
|
|
637
689
|
pcbMarginRight: distance8.optional(),
|
|
@@ -641,11 +693,11 @@ var pcbLayoutProps = z24.object({
|
|
|
641
693
|
pcbMarginY: distance8.optional(),
|
|
642
694
|
pcbStyle: pcbStyle.optional(),
|
|
643
695
|
pcbSx: pcbSx.optional(),
|
|
644
|
-
pcbRelative:
|
|
645
|
-
relative:
|
|
696
|
+
pcbRelative: z26.boolean().optional(),
|
|
697
|
+
relative: z26.boolean().optional()
|
|
646
698
|
});
|
|
647
699
|
expectTypesMatch(true);
|
|
648
|
-
var commonLayoutProps =
|
|
700
|
+
var commonLayoutProps = z26.object({
|
|
649
701
|
pcbX: pcbCoordinate.optional(),
|
|
650
702
|
pcbY: pcbCoordinate.optional(),
|
|
651
703
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -655,14 +707,14 @@ var commonLayoutProps = z24.object({
|
|
|
655
707
|
pcbOffsetX: distance8.optional(),
|
|
656
708
|
pcbOffsetY: distance8.optional(),
|
|
657
709
|
pcbRotation: rotation2.optional(),
|
|
658
|
-
pcbPositionAnchor:
|
|
659
|
-
pcbPositionMode:
|
|
710
|
+
pcbPositionAnchor: z26.string().optional(),
|
|
711
|
+
pcbPositionMode: z26.enum([
|
|
660
712
|
"relative_to_group_anchor",
|
|
661
713
|
"auto",
|
|
662
714
|
"relative_to_board_anchor",
|
|
663
715
|
"relative_to_component_anchor"
|
|
664
716
|
]).optional(),
|
|
665
|
-
shouldBeOnEdgeOfBoard:
|
|
717
|
+
shouldBeOnEdgeOfBoard: z26.boolean().optional(),
|
|
666
718
|
pcbMarginTop: distance8.optional(),
|
|
667
719
|
pcbMarginRight: distance8.optional(),
|
|
668
720
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -684,45 +736,45 @@ var commonLayoutProps = z24.object({
|
|
|
684
736
|
footprint: footprintProp.optional(),
|
|
685
737
|
symbol: symbolProp.optional(),
|
|
686
738
|
schStyle: schStyle.optional(),
|
|
687
|
-
relative:
|
|
688
|
-
schRelative:
|
|
689
|
-
pcbRelative:
|
|
739
|
+
relative: z26.boolean().optional(),
|
|
740
|
+
schRelative: z26.boolean().optional(),
|
|
741
|
+
pcbRelative: z26.boolean().optional()
|
|
690
742
|
});
|
|
691
743
|
expectTypesMatch(true);
|
|
692
|
-
var supplierProps =
|
|
693
|
-
supplierPartNumbers:
|
|
744
|
+
var supplierProps = z26.object({
|
|
745
|
+
supplierPartNumbers: z26.record(supplier_name, z26.array(z26.string())).optional()
|
|
694
746
|
});
|
|
695
747
|
expectTypesMatch(true);
|
|
696
748
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
697
|
-
key:
|
|
698
|
-
name:
|
|
699
|
-
displayName:
|
|
700
|
-
schSectionName:
|
|
749
|
+
key: z26.any().optional(),
|
|
750
|
+
name: z26.string(),
|
|
751
|
+
displayName: z26.string().optional(),
|
|
752
|
+
schSectionName: z26.string().optional().describe(
|
|
701
753
|
'This component will be drawn as part of this section e.g. "Power"'
|
|
702
754
|
),
|
|
703
|
-
schSheetName:
|
|
755
|
+
schSheetName: z26.string().optional().describe(
|
|
704
756
|
'This component will be drawn as part of this sheet e.g. "Main"'
|
|
705
757
|
),
|
|
706
758
|
datasheetUrl: url.optional(),
|
|
707
759
|
cadModel: cadModelProp.optional(),
|
|
708
760
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
709
761
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
710
|
-
children:
|
|
711
|
-
symbolName:
|
|
712
|
-
doNotPlace:
|
|
713
|
-
allowOffBoard:
|
|
762
|
+
children: z26.any().optional(),
|
|
763
|
+
symbolName: z26.string().optional(),
|
|
764
|
+
doNotPlace: z26.boolean().optional(),
|
|
765
|
+
allowOffBoard: z26.boolean().optional().describe(
|
|
714
766
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
715
767
|
),
|
|
716
|
-
obstructsWithinBounds:
|
|
768
|
+
obstructsWithinBounds: z26.boolean().optional().describe(
|
|
717
769
|
"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"
|
|
718
770
|
),
|
|
719
|
-
showAsTranslucentModel:
|
|
771
|
+
showAsTranslucentModel: z26.boolean().optional().describe(
|
|
720
772
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
721
773
|
),
|
|
722
|
-
pinAttributes:
|
|
723
|
-
mpn:
|
|
724
|
-
mfn:
|
|
725
|
-
manufacturerPartNumber:
|
|
774
|
+
pinAttributes: z26.record(z26.string(), pinAttributeMap).optional(),
|
|
775
|
+
mpn: z26.string().describe("Manufacturer Part Number").optional(),
|
|
776
|
+
mfn: z26.string().describe("Manufacturer Part Number").optional(),
|
|
777
|
+
manufacturerPartNumber: z26.string().optional()
|
|
726
778
|
});
|
|
727
779
|
expectTypesMatch(true);
|
|
728
780
|
var componentProps = commonComponentProps;
|
|
@@ -737,7 +789,7 @@ var lrPolarPins = [
|
|
|
737
789
|
"cathode",
|
|
738
790
|
"neg"
|
|
739
791
|
];
|
|
740
|
-
var distanceOrMultiplier = distance8.or(
|
|
792
|
+
var distanceOrMultiplier = distance8.or(z26.enum(["2x", "3x", "4x"]));
|
|
741
793
|
|
|
742
794
|
// lib/common/resolveManufacturerPartNumber.ts
|
|
743
795
|
var resolveManufacturerPartNumber = (props) => {
|
|
@@ -752,9 +804,9 @@ var resolveManufacturerPartNumber = (props) => {
|
|
|
752
804
|
|
|
753
805
|
// lib/common/pcbPath.ts
|
|
754
806
|
import { layer_ref as layer_ref2 } from "circuit-json";
|
|
755
|
-
import { z as
|
|
807
|
+
import { z as z27 } from "zod";
|
|
756
808
|
var basePcbPathPoint = point.extend({
|
|
757
|
-
via:
|
|
809
|
+
via: z27.boolean().optional(),
|
|
758
810
|
fromLayer: layer_ref2.optional(),
|
|
759
811
|
toLayer: layer_ref2.optional()
|
|
760
812
|
});
|
|
@@ -762,20 +814,20 @@ var pcbPathPoint = basePcbPathPoint.superRefine((value, ctx) => {
|
|
|
762
814
|
if (value.via) {
|
|
763
815
|
if (!value.toLayer) {
|
|
764
816
|
ctx.addIssue({
|
|
765
|
-
code:
|
|
817
|
+
code: z27.ZodIssueCode.custom,
|
|
766
818
|
message: "toLayer is required when via is true",
|
|
767
819
|
path: ["toLayer"]
|
|
768
820
|
});
|
|
769
821
|
}
|
|
770
822
|
} else if (value.fromLayer || value.toLayer) {
|
|
771
823
|
ctx.addIssue({
|
|
772
|
-
code:
|
|
824
|
+
code: z27.ZodIssueCode.custom,
|
|
773
825
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
774
826
|
path: ["via"]
|
|
775
827
|
});
|
|
776
828
|
}
|
|
777
829
|
});
|
|
778
|
-
var pcbPath =
|
|
830
|
+
var pcbPath = z27.array(z27.union([pcbPathPoint, z27.string()]));
|
|
779
831
|
expectTypesMatch(true);
|
|
780
832
|
expectTypesMatch(true);
|
|
781
833
|
|
|
@@ -16243,8 +16295,8 @@ var footprinterStringExamples = [
|
|
|
16243
16295
|
];
|
|
16244
16296
|
|
|
16245
16297
|
// lib/common/schematicOrientation.ts
|
|
16246
|
-
import { z as
|
|
16247
|
-
var schematicOrientation =
|
|
16298
|
+
import { z as z28 } from "zod";
|
|
16299
|
+
var schematicOrientation = z28.enum([
|
|
16248
16300
|
"vertical",
|
|
16249
16301
|
"horizontal",
|
|
16250
16302
|
"pos_top",
|
|
@@ -16263,32 +16315,32 @@ expectTypesMatch(
|
|
|
16263
16315
|
);
|
|
16264
16316
|
|
|
16265
16317
|
// lib/common/schematicPinDefinitions.ts
|
|
16266
|
-
import { z as
|
|
16267
|
-
var explicitPinSideDefinition =
|
|
16268
|
-
pins:
|
|
16269
|
-
direction:
|
|
16270
|
-
|
|
16271
|
-
|
|
16272
|
-
|
|
16273
|
-
|
|
16318
|
+
import { z as z29 } from "zod";
|
|
16319
|
+
var explicitPinSideDefinition = z29.object({
|
|
16320
|
+
pins: z29.array(z29.union([z29.number(), z29.string()])),
|
|
16321
|
+
direction: z29.union([
|
|
16322
|
+
z29.literal("top-to-bottom"),
|
|
16323
|
+
z29.literal("left-to-right"),
|
|
16324
|
+
z29.literal("bottom-to-top"),
|
|
16325
|
+
z29.literal("right-to-left")
|
|
16274
16326
|
])
|
|
16275
16327
|
});
|
|
16276
|
-
var pinSideDefinitionInput =
|
|
16277
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
16328
|
+
var pinSideDefinitionInput = z29.array(z29.union([z29.number(), z29.string()]));
|
|
16329
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z29.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
16278
16330
|
(value) => Array.isArray(value) ? {
|
|
16279
16331
|
pins: value,
|
|
16280
16332
|
direction: direction2
|
|
16281
16333
|
} : value
|
|
16282
16334
|
);
|
|
16283
|
-
var schematicPortArrangement =
|
|
16284
|
-
leftSize:
|
|
16285
|
-
topSize:
|
|
16286
|
-
rightSize:
|
|
16287
|
-
bottomSize:
|
|
16288
|
-
leftPinCount:
|
|
16289
|
-
rightPinCount:
|
|
16290
|
-
topPinCount:
|
|
16291
|
-
bottomPinCount:
|
|
16335
|
+
var schematicPortArrangement = z29.object({
|
|
16336
|
+
leftSize: z29.number().optional().describe("@deprecated, use leftPinCount"),
|
|
16337
|
+
topSize: z29.number().optional().describe("@deprecated, use topPinCount"),
|
|
16338
|
+
rightSize: z29.number().optional().describe("@deprecated, use rightPinCount"),
|
|
16339
|
+
bottomSize: z29.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
16340
|
+
leftPinCount: z29.number().optional(),
|
|
16341
|
+
rightPinCount: z29.number().optional(),
|
|
16342
|
+
topPinCount: z29.number().optional(),
|
|
16343
|
+
bottomPinCount: z29.number().optional(),
|
|
16292
16344
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
16293
16345
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
16294
16346
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -16299,9 +16351,9 @@ expectTypesMatch(true);
|
|
|
16299
16351
|
|
|
16300
16352
|
// lib/common/schematicPinStyle.ts
|
|
16301
16353
|
import { distance as distance9 } from "circuit-json";
|
|
16302
|
-
import { z as
|
|
16303
|
-
var schematicPinStyle =
|
|
16304
|
-
|
|
16354
|
+
import { z as z30 } from "zod";
|
|
16355
|
+
var schematicPinStyle = z30.record(
|
|
16356
|
+
z30.object({
|
|
16305
16357
|
marginLeft: distance9.optional(),
|
|
16306
16358
|
marginRight: distance9.optional(),
|
|
16307
16359
|
marginTop: distance9.optional(),
|
|
@@ -16315,17 +16367,17 @@ var schematicPinStyle = z28.record(
|
|
|
16315
16367
|
expectTypesMatch(true);
|
|
16316
16368
|
|
|
16317
16369
|
// lib/common/schematicPinLabel.ts
|
|
16318
|
-
import { z as
|
|
16319
|
-
var schematicPinLabel =
|
|
16370
|
+
import { z as z31 } from "zod";
|
|
16371
|
+
var schematicPinLabel = z31.string().regex(/^[A-Za-z0-9_]+$/);
|
|
16320
16372
|
|
|
16321
16373
|
// lib/common/schematicSize.ts
|
|
16322
16374
|
import { distance as distance10 } from "circuit-json";
|
|
16323
|
-
import { z as
|
|
16324
|
-
var schematicSymbolSize =
|
|
16375
|
+
import { z as z32 } from "zod";
|
|
16376
|
+
var schematicSymbolSize = z32.enum(["xs", "sm", "default", "md"]).or(distance10.pipe(z32.number().finite())).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
16325
16377
|
|
|
16326
16378
|
// lib/common/kicadPinMetadata.ts
|
|
16327
|
-
import { z as
|
|
16328
|
-
var kicadPinElectricalType =
|
|
16379
|
+
import { z as z33 } from "zod";
|
|
16380
|
+
var kicadPinElectricalType = z33.enum([
|
|
16329
16381
|
"input",
|
|
16330
16382
|
"output",
|
|
16331
16383
|
"bidirectional",
|
|
@@ -16339,7 +16391,7 @@ var kicadPinElectricalType = z31.enum([
|
|
|
16339
16391
|
"open_emitter",
|
|
16340
16392
|
"no_connect"
|
|
16341
16393
|
]);
|
|
16342
|
-
var kicadPinGraphicStyle =
|
|
16394
|
+
var kicadPinGraphicStyle = z33.enum([
|
|
16343
16395
|
"line",
|
|
16344
16396
|
"inverted",
|
|
16345
16397
|
"clock",
|
|
@@ -16350,7 +16402,7 @@ var kicadPinGraphicStyle = z31.enum([
|
|
|
16350
16402
|
"falling_edge_clock",
|
|
16351
16403
|
"nonlogic"
|
|
16352
16404
|
]);
|
|
16353
|
-
var kicadPinMetadata =
|
|
16405
|
+
var kicadPinMetadata = z33.object({
|
|
16354
16406
|
electricalType: kicadPinElectricalType.optional(),
|
|
16355
16407
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
16356
16408
|
pinLength: distance.optional(),
|
|
@@ -16360,14 +16412,14 @@ var kicadPinMetadata = z31.object({
|
|
|
16360
16412
|
expectTypesMatch(true);
|
|
16361
16413
|
|
|
16362
16414
|
// lib/customDrc.ts
|
|
16363
|
-
import { z as
|
|
16364
|
-
var customDrcCheckFn =
|
|
16415
|
+
import { z as z34 } from "zod";
|
|
16416
|
+
var customDrcCheckFn = z34.custom(
|
|
16365
16417
|
(value) => typeof value === "function"
|
|
16366
16418
|
);
|
|
16367
16419
|
|
|
16368
16420
|
// lib/common/ninePointAnchor.ts
|
|
16369
|
-
import { z as
|
|
16370
|
-
var ninePointAnchor =
|
|
16421
|
+
import { z as z35 } from "zod";
|
|
16422
|
+
var ninePointAnchor = z35.enum([
|
|
16371
16423
|
"top_left",
|
|
16372
16424
|
"top_center",
|
|
16373
16425
|
"top_right",
|
|
@@ -16380,47 +16432,47 @@ var ninePointAnchor = z33.enum([
|
|
|
16380
16432
|
]);
|
|
16381
16433
|
|
|
16382
16434
|
// lib/components/board.ts
|
|
16383
|
-
import { z as
|
|
16435
|
+
import { z as z49 } from "zod";
|
|
16384
16436
|
|
|
16385
16437
|
// lib/components/group.ts
|
|
16386
16438
|
import {
|
|
16387
16439
|
length as length3,
|
|
16388
16440
|
distance as distance11
|
|
16389
16441
|
} from "circuit-json";
|
|
16390
|
-
import { z as
|
|
16442
|
+
import { z as z48 } from "zod";
|
|
16391
16443
|
|
|
16392
16444
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
16393
|
-
import { z as
|
|
16394
|
-
var base_manual_edit_event =
|
|
16395
|
-
edit_event_id:
|
|
16396
|
-
in_progress:
|
|
16397
|
-
created_at:
|
|
16445
|
+
import { z as z36 } from "zod";
|
|
16446
|
+
var base_manual_edit_event = z36.object({
|
|
16447
|
+
edit_event_id: z36.string(),
|
|
16448
|
+
in_progress: z36.boolean().optional(),
|
|
16449
|
+
created_at: z36.number()
|
|
16398
16450
|
});
|
|
16399
16451
|
expectTypesMatch(
|
|
16400
16452
|
true
|
|
16401
16453
|
);
|
|
16402
16454
|
|
|
16403
16455
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
16404
|
-
import { z as
|
|
16456
|
+
import { z as z37 } from "zod";
|
|
16405
16457
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
16406
|
-
pcb_edit_event_type:
|
|
16407
|
-
edit_event_type:
|
|
16408
|
-
pcb_component_id:
|
|
16409
|
-
original_center:
|
|
16410
|
-
new_center:
|
|
16458
|
+
pcb_edit_event_type: z37.literal("edit_component_location").describe("deprecated"),
|
|
16459
|
+
edit_event_type: z37.literal("edit_pcb_component_location"),
|
|
16460
|
+
pcb_component_id: z37.string(),
|
|
16461
|
+
original_center: z37.object({ x: z37.number(), y: z37.number() }),
|
|
16462
|
+
new_center: z37.object({ x: z37.number(), y: z37.number() })
|
|
16411
16463
|
});
|
|
16412
16464
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
16413
16465
|
expectTypesMatch(true);
|
|
16414
16466
|
|
|
16415
16467
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
16416
|
-
import { z as
|
|
16468
|
+
import { z as z38 } from "zod";
|
|
16417
16469
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
16418
|
-
pcb_edit_event_type:
|
|
16419
|
-
edit_event_type:
|
|
16420
|
-
pcb_port_id:
|
|
16421
|
-
pcb_trace_hint_id:
|
|
16422
|
-
route:
|
|
16423
|
-
|
|
16470
|
+
pcb_edit_event_type: z38.literal("edit_trace_hint").describe("deprecated"),
|
|
16471
|
+
edit_event_type: z38.literal("edit_pcb_trace_hint").optional(),
|
|
16472
|
+
pcb_port_id: z38.string(),
|
|
16473
|
+
pcb_trace_hint_id: z38.string().optional(),
|
|
16474
|
+
route: z38.array(
|
|
16475
|
+
z38.object({ x: z38.number(), y: z38.number(), via: z38.boolean().optional() })
|
|
16424
16476
|
)
|
|
16425
16477
|
});
|
|
16426
16478
|
expectTypesMatch(
|
|
@@ -16428,38 +16480,38 @@ expectTypesMatch(
|
|
|
16428
16480
|
);
|
|
16429
16481
|
|
|
16430
16482
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
16431
|
-
import { z as
|
|
16483
|
+
import { z as z39 } from "zod";
|
|
16432
16484
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
16433
|
-
edit_event_type:
|
|
16434
|
-
schematic_component_id:
|
|
16435
|
-
original_center:
|
|
16436
|
-
new_center:
|
|
16485
|
+
edit_event_type: z39.literal("edit_schematic_component_location"),
|
|
16486
|
+
schematic_component_id: z39.string(),
|
|
16487
|
+
original_center: z39.object({ x: z39.number(), y: z39.number() }),
|
|
16488
|
+
new_center: z39.object({ x: z39.number(), y: z39.number() })
|
|
16437
16489
|
});
|
|
16438
16490
|
expectTypesMatch(true);
|
|
16439
16491
|
|
|
16440
16492
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
16441
|
-
import { z as
|
|
16493
|
+
import { z as z40 } from "zod";
|
|
16442
16494
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
16443
|
-
edit_event_type:
|
|
16444
|
-
pcb_group_id:
|
|
16445
|
-
original_center:
|
|
16446
|
-
new_center:
|
|
16495
|
+
edit_event_type: z40.literal("edit_pcb_group_location"),
|
|
16496
|
+
pcb_group_id: z40.string(),
|
|
16497
|
+
original_center: z40.object({ x: z40.number(), y: z40.number() }),
|
|
16498
|
+
new_center: z40.object({ x: z40.number(), y: z40.number() })
|
|
16447
16499
|
});
|
|
16448
16500
|
expectTypesMatch(true);
|
|
16449
16501
|
|
|
16450
16502
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
16451
|
-
import { z as
|
|
16503
|
+
import { z as z41 } from "zod";
|
|
16452
16504
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
16453
|
-
edit_event_type:
|
|
16454
|
-
schematic_group_id:
|
|
16455
|
-
original_center:
|
|
16456
|
-
new_center:
|
|
16505
|
+
edit_event_type: z41.literal("edit_schematic_group_location"),
|
|
16506
|
+
schematic_group_id: z41.string(),
|
|
16507
|
+
original_center: z41.object({ x: z41.number(), y: z41.number() }),
|
|
16508
|
+
new_center: z41.object({ x: z41.number(), y: z41.number() })
|
|
16457
16509
|
});
|
|
16458
16510
|
expectTypesMatch(true);
|
|
16459
16511
|
|
|
16460
16512
|
// lib/manual-edits/manual_edit_event.ts
|
|
16461
|
-
import { z as
|
|
16462
|
-
var manual_edit_event =
|
|
16513
|
+
import { z as z42 } from "zod";
|
|
16514
|
+
var manual_edit_event = z42.union([
|
|
16463
16515
|
edit_pcb_component_location_event,
|
|
16464
16516
|
edit_trace_hint_event,
|
|
16465
16517
|
edit_schematic_component_location_event
|
|
@@ -16467,33 +16519,33 @@ var manual_edit_event = z40.union([
|
|
|
16467
16519
|
expectTypesMatch(true);
|
|
16468
16520
|
|
|
16469
16521
|
// lib/manual-edits/manual_edits_file.ts
|
|
16470
|
-
import { z as
|
|
16522
|
+
import { z as z46 } from "zod";
|
|
16471
16523
|
|
|
16472
16524
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
16473
|
-
import { z as
|
|
16525
|
+
import { z as z43 } from "zod";
|
|
16474
16526
|
import { point as point2 } from "circuit-json";
|
|
16475
|
-
var manual_pcb_placement =
|
|
16476
|
-
selector:
|
|
16477
|
-
relative_to:
|
|
16527
|
+
var manual_pcb_placement = z43.object({
|
|
16528
|
+
selector: z43.string(),
|
|
16529
|
+
relative_to: z43.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16478
16530
|
center: point2
|
|
16479
16531
|
});
|
|
16480
16532
|
expectTypesMatch(true);
|
|
16481
16533
|
|
|
16482
16534
|
// lib/manual-edits/manual_trace_hint.ts
|
|
16483
|
-
import { z as
|
|
16535
|
+
import { z as z44 } from "zod";
|
|
16484
16536
|
import { route_hint_point } from "circuit-json";
|
|
16485
|
-
var manual_trace_hint =
|
|
16486
|
-
pcb_port_selector:
|
|
16487
|
-
offsets:
|
|
16537
|
+
var manual_trace_hint = z44.object({
|
|
16538
|
+
pcb_port_selector: z44.string(),
|
|
16539
|
+
offsets: z44.array(route_hint_point)
|
|
16488
16540
|
});
|
|
16489
16541
|
expectTypesMatch(true);
|
|
16490
16542
|
|
|
16491
16543
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
16492
|
-
import { z as
|
|
16544
|
+
import { z as z45 } from "zod";
|
|
16493
16545
|
import { point as point4 } from "circuit-json";
|
|
16494
|
-
var manual_schematic_placement =
|
|
16495
|
-
selector:
|
|
16496
|
-
relative_to:
|
|
16546
|
+
var manual_schematic_placement = z45.object({
|
|
16547
|
+
selector: z45.string(),
|
|
16548
|
+
relative_to: z45.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
16497
16549
|
center: point4
|
|
16498
16550
|
});
|
|
16499
16551
|
expectTypesMatch(
|
|
@@ -16501,37 +16553,37 @@ expectTypesMatch(
|
|
|
16501
16553
|
);
|
|
16502
16554
|
|
|
16503
16555
|
// lib/manual-edits/manual_edits_file.ts
|
|
16504
|
-
var manual_edits_file =
|
|
16505
|
-
pcb_placements:
|
|
16506
|
-
manual_trace_hints:
|
|
16507
|
-
schematic_placements:
|
|
16556
|
+
var manual_edits_file = z46.object({
|
|
16557
|
+
pcb_placements: z46.array(manual_pcb_placement).optional(),
|
|
16558
|
+
manual_trace_hints: z46.array(manual_trace_hint).optional(),
|
|
16559
|
+
schematic_placements: z46.array(manual_schematic_placement).optional()
|
|
16508
16560
|
});
|
|
16509
16561
|
expectTypesMatch(true);
|
|
16510
16562
|
|
|
16511
16563
|
// lib/common/connectionsProp.ts
|
|
16512
|
-
import { z as
|
|
16513
|
-
var connectionTarget =
|
|
16564
|
+
import { z as z47 } from "zod";
|
|
16565
|
+
var connectionTarget = z47.string().or(z47.array(z47.string()).readonly()).or(z47.array(z47.string()));
|
|
16514
16566
|
var createConnectionsProp = (labels) => {
|
|
16515
|
-
return
|
|
16567
|
+
return z47.record(z47.enum(labels), connectionTarget);
|
|
16516
16568
|
};
|
|
16517
16569
|
|
|
16518
16570
|
// lib/components/group.ts
|
|
16519
|
-
var layoutConfig =
|
|
16520
|
-
layoutMode:
|
|
16521
|
-
position:
|
|
16522
|
-
grid:
|
|
16523
|
-
gridCols:
|
|
16524
|
-
gridRows:
|
|
16525
|
-
gridTemplateRows:
|
|
16526
|
-
gridTemplateColumns:
|
|
16527
|
-
gridTemplate:
|
|
16528
|
-
gridGap:
|
|
16529
|
-
gridRowGap:
|
|
16530
|
-
gridColumnGap:
|
|
16531
|
-
flex:
|
|
16532
|
-
flexDirection:
|
|
16533
|
-
alignItems:
|
|
16534
|
-
justifyContent:
|
|
16571
|
+
var layoutConfig = z48.object({
|
|
16572
|
+
layoutMode: z48.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
16573
|
+
position: z48.enum(["absolute", "relative"]).optional(),
|
|
16574
|
+
grid: z48.boolean().optional(),
|
|
16575
|
+
gridCols: z48.number().or(z48.string()).optional(),
|
|
16576
|
+
gridRows: z48.number().or(z48.string()).optional(),
|
|
16577
|
+
gridTemplateRows: z48.string().optional(),
|
|
16578
|
+
gridTemplateColumns: z48.string().optional(),
|
|
16579
|
+
gridTemplate: z48.string().optional(),
|
|
16580
|
+
gridGap: z48.number().or(z48.string()).optional(),
|
|
16581
|
+
gridRowGap: z48.number().or(z48.string()).optional(),
|
|
16582
|
+
gridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16583
|
+
flex: z48.boolean().or(z48.string()).optional(),
|
|
16584
|
+
flexDirection: z48.enum(["row", "column"]).optional(),
|
|
16585
|
+
alignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16586
|
+
justifyContent: z48.enum([
|
|
16535
16587
|
"start",
|
|
16536
16588
|
"center",
|
|
16537
16589
|
"end",
|
|
@@ -16540,16 +16592,16 @@ var layoutConfig = z46.object({
|
|
|
16540
16592
|
"space-around",
|
|
16541
16593
|
"space-evenly"
|
|
16542
16594
|
]).optional(),
|
|
16543
|
-
flexRow:
|
|
16544
|
-
flexColumn:
|
|
16545
|
-
gap:
|
|
16546
|
-
pack:
|
|
16547
|
-
packOrderStrategy:
|
|
16595
|
+
flexRow: z48.boolean().optional(),
|
|
16596
|
+
flexColumn: z48.boolean().optional(),
|
|
16597
|
+
gap: z48.number().or(z48.string()).optional(),
|
|
16598
|
+
pack: z48.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
16599
|
+
packOrderStrategy: z48.enum([
|
|
16548
16600
|
"largest_to_smallest",
|
|
16549
16601
|
"first_to_last",
|
|
16550
16602
|
"highest_to_lowest_pin_count"
|
|
16551
16603
|
]).optional(),
|
|
16552
|
-
packPlacementStrategy:
|
|
16604
|
+
packPlacementStrategy: z48.enum(["shortest_connection_along_outline"]).optional(),
|
|
16553
16605
|
padding: length3.optional(),
|
|
16554
16606
|
paddingLeft: length3.optional(),
|
|
16555
16607
|
paddingRight: length3.optional(),
|
|
@@ -16559,17 +16611,17 @@ var layoutConfig = z46.object({
|
|
|
16559
16611
|
paddingY: length3.optional(),
|
|
16560
16612
|
width: length3.optional(),
|
|
16561
16613
|
height: length3.optional(),
|
|
16562
|
-
matchAdapt:
|
|
16563
|
-
matchAdaptTemplate:
|
|
16614
|
+
matchAdapt: z48.boolean().optional(),
|
|
16615
|
+
matchAdaptTemplate: z48.any().optional()
|
|
16564
16616
|
});
|
|
16565
16617
|
expectTypesMatch(true);
|
|
16566
|
-
var border =
|
|
16618
|
+
var border = z48.object({
|
|
16567
16619
|
strokeWidth: length3.optional(),
|
|
16568
|
-
dashed:
|
|
16569
|
-
solid:
|
|
16620
|
+
dashed: z48.boolean().optional(),
|
|
16621
|
+
solid: z48.boolean().optional()
|
|
16570
16622
|
});
|
|
16571
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
16572
|
-
var routingTolerances =
|
|
16623
|
+
var pcbAnchorAlignmentAutocomplete = z48.custom((value) => typeof value === "string");
|
|
16624
|
+
var routingTolerances = z48.object({
|
|
16573
16625
|
minTraceWidth: length3.optional(),
|
|
16574
16626
|
minViaHoleEdgeToViaHoleEdgeClearance: length3.optional(),
|
|
16575
16627
|
minViaEdgeToPadEdgeClearance: length3.optional(),
|
|
@@ -16583,25 +16635,25 @@ var routingTolerances = z46.object({
|
|
|
16583
16635
|
minViaHoleDiameter: length3.optional(),
|
|
16584
16636
|
minViaPadDiameter: length3.optional()
|
|
16585
16637
|
});
|
|
16586
|
-
var autorouterConfig =
|
|
16638
|
+
var autorouterConfig = z48.object({
|
|
16587
16639
|
serverUrl: url.optional(),
|
|
16588
|
-
inputFormat:
|
|
16589
|
-
serverMode:
|
|
16590
|
-
serverCacheEnabled:
|
|
16591
|
-
cache:
|
|
16640
|
+
inputFormat: z48.enum(["simplified", "circuit-json"]).optional(),
|
|
16641
|
+
serverMode: z48.enum(["job", "solve-endpoint"]).optional(),
|
|
16642
|
+
serverCacheEnabled: z48.boolean().optional(),
|
|
16643
|
+
cache: z48.custom((v) => true).optional(),
|
|
16592
16644
|
traceClearance: length3.optional(),
|
|
16593
|
-
availableJumperTypes:
|
|
16594
|
-
allowViaInPad:
|
|
16645
|
+
availableJumperTypes: z48.array(z48.enum(["1206x4", "0603"])).optional(),
|
|
16646
|
+
allowViaInPad: z48.boolean().optional().describe(
|
|
16595
16647
|
"Allows the autorouter to place vias inside connected pads. Omitted or false keeps via-in-pad routing disabled."
|
|
16596
16648
|
),
|
|
16597
|
-
groupMode:
|
|
16598
|
-
algorithmFn:
|
|
16649
|
+
groupMode: z48.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
16650
|
+
algorithmFn: z48.custom(
|
|
16599
16651
|
(v) => typeof v === "function" || v === void 0
|
|
16600
16652
|
).optional(),
|
|
16601
|
-
implicitBreakoutPointSolverFn:
|
|
16653
|
+
implicitBreakoutPointSolverFn: z48.custom(
|
|
16602
16654
|
(value) => typeof value === "function" || value === void 0
|
|
16603
16655
|
).optional(),
|
|
16604
|
-
preset:
|
|
16656
|
+
preset: z48.enum([
|
|
16605
16657
|
"sequential_trace",
|
|
16606
16658
|
"subcircuit",
|
|
16607
16659
|
"default",
|
|
@@ -16626,39 +16678,39 @@ var autorouterConfig = z46.object({
|
|
|
16626
16678
|
]).transform(
|
|
16627
16679
|
(preset) => preset === "single_layer_routing" ? "bus_lanes" : preset
|
|
16628
16680
|
).optional(),
|
|
16629
|
-
local:
|
|
16681
|
+
local: z48.boolean().optional()
|
|
16630
16682
|
});
|
|
16631
|
-
var autorouterPreset =
|
|
16632
|
-
|
|
16633
|
-
|
|
16634
|
-
|
|
16635
|
-
|
|
16636
|
-
|
|
16637
|
-
|
|
16638
|
-
|
|
16639
|
-
|
|
16640
|
-
|
|
16641
|
-
|
|
16642
|
-
|
|
16643
|
-
|
|
16683
|
+
var autorouterPreset = z48.union([
|
|
16684
|
+
z48.literal("sequential_trace"),
|
|
16685
|
+
z48.literal("subcircuit"),
|
|
16686
|
+
z48.literal("default"),
|
|
16687
|
+
z48.literal("auto"),
|
|
16688
|
+
z48.literal("auto_local"),
|
|
16689
|
+
z48.literal("auto_cloud"),
|
|
16690
|
+
z48.literal("auto_jumper"),
|
|
16691
|
+
z48.literal("tscircuit_beta"),
|
|
16692
|
+
z48.literal("krt"),
|
|
16693
|
+
z48.literal("freerouting"),
|
|
16694
|
+
z48.literal("simplify"),
|
|
16695
|
+
z48.literal("laser_prefab"),
|
|
16644
16696
|
// Prefabricated PCB with laser copper ablation
|
|
16645
|
-
|
|
16646
|
-
|
|
16647
|
-
|
|
16648
|
-
|
|
16649
|
-
|
|
16650
|
-
|
|
16651
|
-
|
|
16652
|
-
|
|
16653
|
-
|
|
16697
|
+
z48.literal("single_layer_fanout"),
|
|
16698
|
+
z48.literal("fanout"),
|
|
16699
|
+
z48.literal("dogbone"),
|
|
16700
|
+
z48.literal("bus_lanes"),
|
|
16701
|
+
z48.literal("single_layer_routing").transform(() => "bus_lanes"),
|
|
16702
|
+
z48.literal("auto-jumper"),
|
|
16703
|
+
z48.literal("sequential-trace"),
|
|
16704
|
+
z48.literal("auto-local"),
|
|
16705
|
+
z48.literal("auto-cloud")
|
|
16654
16706
|
]);
|
|
16655
|
-
var autorouterString =
|
|
16656
|
-
var autorouterProp =
|
|
16707
|
+
var autorouterString = z48.string();
|
|
16708
|
+
var autorouterProp = z48.union([
|
|
16657
16709
|
autorouterConfig,
|
|
16658
16710
|
autorouterPreset,
|
|
16659
16711
|
autorouterString
|
|
16660
16712
|
]);
|
|
16661
|
-
var autorouterEffortLevel =
|
|
16713
|
+
var autorouterEffortLevel = z48.enum([
|
|
16662
16714
|
"1x",
|
|
16663
16715
|
"1.5x",
|
|
16664
16716
|
"2x",
|
|
@@ -16666,12 +16718,12 @@ var autorouterEffortLevel = z46.enum([
|
|
|
16666
16718
|
"10x",
|
|
16667
16719
|
"100x"
|
|
16668
16720
|
]);
|
|
16669
|
-
var preflightRoutingCheckPolicy =
|
|
16721
|
+
var preflightRoutingCheckPolicy = z48.enum([
|
|
16670
16722
|
"none",
|
|
16671
16723
|
"basic",
|
|
16672
16724
|
"conservative"
|
|
16673
16725
|
]);
|
|
16674
|
-
var knownAutorouterVersion =
|
|
16726
|
+
var knownAutorouterVersion = z48.enum([
|
|
16675
16727
|
"beta_pipeline1",
|
|
16676
16728
|
"beta_pipeline3",
|
|
16677
16729
|
"beta_pipeline4",
|
|
@@ -16680,7 +16732,7 @@ var knownAutorouterVersion = z46.enum([
|
|
|
16680
16732
|
"beta_pipeline9",
|
|
16681
16733
|
"latest"
|
|
16682
16734
|
]);
|
|
16683
|
-
var autorouterVersion =
|
|
16735
|
+
var autorouterVersion = z48.custom(
|
|
16684
16736
|
(value) => typeof value === "string"
|
|
16685
16737
|
).transform((value) => {
|
|
16686
16738
|
const parsedAutorouterVersion = knownAutorouterVersion.safeParse(value);
|
|
@@ -16691,33 +16743,33 @@ var autorouterVersion = z46.custom(
|
|
|
16691
16743
|
return "latest";
|
|
16692
16744
|
});
|
|
16693
16745
|
var baseGroupProps = commonLayoutProps.extend({
|
|
16694
|
-
name:
|
|
16695
|
-
children:
|
|
16696
|
-
schTitle:
|
|
16697
|
-
schSheetName:
|
|
16698
|
-
key:
|
|
16699
|
-
showAsSchematicBox:
|
|
16700
|
-
connections:
|
|
16746
|
+
name: z48.string().optional(),
|
|
16747
|
+
children: z48.any().optional(),
|
|
16748
|
+
schTitle: z48.string().optional(),
|
|
16749
|
+
schSheetName: z48.string().optional().describe('This group will be drawn as part of this sheet e.g. "Main"'),
|
|
16750
|
+
key: z48.any().optional(),
|
|
16751
|
+
showAsSchematicBox: z48.boolean().optional(),
|
|
16752
|
+
connections: z48.record(z48.string(), connectionTarget.optional()).optional(),
|
|
16701
16753
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
16702
16754
|
schPinSpacing: length3.optional(),
|
|
16703
16755
|
schPinStyle: schematicPinStyle.optional(),
|
|
16704
16756
|
...layoutConfig.shape,
|
|
16705
16757
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
16706
16758
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
16707
|
-
pcbGrid:
|
|
16708
|
-
pcbGridCols:
|
|
16709
|
-
pcbGridRows:
|
|
16710
|
-
pcbGridTemplateRows:
|
|
16711
|
-
pcbGridTemplateColumns:
|
|
16712
|
-
pcbGridTemplate:
|
|
16713
|
-
pcbGridGap:
|
|
16714
|
-
pcbGridRowGap:
|
|
16715
|
-
pcbGridColumnGap:
|
|
16716
|
-
pcbFlex:
|
|
16717
|
-
pcbFlexGap:
|
|
16718
|
-
pcbFlexDirection:
|
|
16719
|
-
pcbAlignItems:
|
|
16720
|
-
pcbJustifyContent:
|
|
16759
|
+
pcbGrid: z48.boolean().optional(),
|
|
16760
|
+
pcbGridCols: z48.number().or(z48.string()).optional(),
|
|
16761
|
+
pcbGridRows: z48.number().or(z48.string()).optional(),
|
|
16762
|
+
pcbGridTemplateRows: z48.string().optional(),
|
|
16763
|
+
pcbGridTemplateColumns: z48.string().optional(),
|
|
16764
|
+
pcbGridTemplate: z48.string().optional(),
|
|
16765
|
+
pcbGridGap: z48.number().or(z48.string()).optional(),
|
|
16766
|
+
pcbGridRowGap: z48.number().or(z48.string()).optional(),
|
|
16767
|
+
pcbGridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16768
|
+
pcbFlex: z48.boolean().or(z48.string()).optional(),
|
|
16769
|
+
pcbFlexGap: z48.number().or(z48.string()).optional(),
|
|
16770
|
+
pcbFlexDirection: z48.enum(["row", "column"]).optional(),
|
|
16771
|
+
pcbAlignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16772
|
+
pcbJustifyContent: z48.enum([
|
|
16721
16773
|
"start",
|
|
16722
16774
|
"center",
|
|
16723
16775
|
"end",
|
|
@@ -16726,25 +16778,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16726
16778
|
"space-around",
|
|
16727
16779
|
"space-evenly"
|
|
16728
16780
|
]).optional(),
|
|
16729
|
-
pcbFlexRow:
|
|
16730
|
-
pcbFlexColumn:
|
|
16731
|
-
pcbGap:
|
|
16732
|
-
pcbPack:
|
|
16733
|
-
pcbPackGap:
|
|
16734
|
-
schGrid:
|
|
16735
|
-
schGridCols:
|
|
16736
|
-
schGridRows:
|
|
16737
|
-
schGridTemplateRows:
|
|
16738
|
-
schGridTemplateColumns:
|
|
16739
|
-
schGridTemplate:
|
|
16740
|
-
schGridGap:
|
|
16741
|
-
schGridRowGap:
|
|
16742
|
-
schGridColumnGap:
|
|
16743
|
-
schFlex:
|
|
16744
|
-
schFlexGap:
|
|
16745
|
-
schFlexDirection:
|
|
16746
|
-
schAlignItems:
|
|
16747
|
-
schJustifyContent:
|
|
16781
|
+
pcbFlexRow: z48.boolean().optional(),
|
|
16782
|
+
pcbFlexColumn: z48.boolean().optional(),
|
|
16783
|
+
pcbGap: z48.number().or(z48.string()).optional(),
|
|
16784
|
+
pcbPack: z48.boolean().optional(),
|
|
16785
|
+
pcbPackGap: z48.number().or(z48.string()).optional(),
|
|
16786
|
+
schGrid: z48.boolean().optional(),
|
|
16787
|
+
schGridCols: z48.number().or(z48.string()).optional(),
|
|
16788
|
+
schGridRows: z48.number().or(z48.string()).optional(),
|
|
16789
|
+
schGridTemplateRows: z48.string().optional(),
|
|
16790
|
+
schGridTemplateColumns: z48.string().optional(),
|
|
16791
|
+
schGridTemplate: z48.string().optional(),
|
|
16792
|
+
schGridGap: z48.number().or(z48.string()).optional(),
|
|
16793
|
+
schGridRowGap: z48.number().or(z48.string()).optional(),
|
|
16794
|
+
schGridColumnGap: z48.number().or(z48.string()).optional(),
|
|
16795
|
+
schFlex: z48.boolean().or(z48.string()).optional(),
|
|
16796
|
+
schFlexGap: z48.number().or(z48.string()).optional(),
|
|
16797
|
+
schFlexDirection: z48.enum(["row", "column"]).optional(),
|
|
16798
|
+
schAlignItems: z48.enum(["start", "center", "end", "stretch"]).optional(),
|
|
16799
|
+
schJustifyContent: z48.enum([
|
|
16748
16800
|
"start",
|
|
16749
16801
|
"center",
|
|
16750
16802
|
"end",
|
|
@@ -16753,11 +16805,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16753
16805
|
"space-around",
|
|
16754
16806
|
"space-evenly"
|
|
16755
16807
|
]).optional(),
|
|
16756
|
-
schFlexRow:
|
|
16757
|
-
schFlexColumn:
|
|
16758
|
-
schGap:
|
|
16759
|
-
schPack:
|
|
16760
|
-
schMatchAdapt:
|
|
16808
|
+
schFlexRow: z48.boolean().optional(),
|
|
16809
|
+
schFlexColumn: z48.boolean().optional(),
|
|
16810
|
+
schGap: z48.number().or(z48.string()).optional(),
|
|
16811
|
+
schPack: z48.boolean().optional(),
|
|
16812
|
+
schMatchAdapt: z48.boolean().optional(),
|
|
16761
16813
|
pcbWidth: length3.optional(),
|
|
16762
16814
|
pcbHeight: length3.optional(),
|
|
16763
16815
|
minTraceWidth: length3.optional(),
|
|
@@ -16780,42 +16832,42 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
16780
16832
|
pcbPaddingBottom: length3.optional(),
|
|
16781
16833
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
16782
16834
|
});
|
|
16783
|
-
var partsEngine =
|
|
16835
|
+
var partsEngine = z48.custom((v) => "findPart" in v);
|
|
16784
16836
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
16785
16837
|
manualEdits: manual_edits_file.optional(),
|
|
16786
|
-
schAutoLayoutEnabled:
|
|
16787
|
-
schTraceAutoLabelEnabled:
|
|
16838
|
+
schAutoLayoutEnabled: z48.boolean().optional(),
|
|
16839
|
+
schTraceAutoLabelEnabled: z48.boolean().optional(),
|
|
16788
16840
|
schMaxTraceDistance: distance11.optional(),
|
|
16789
|
-
routingDisabled:
|
|
16790
|
-
placementDrcChecksDisabled:
|
|
16791
|
-
bomDisabled:
|
|
16841
|
+
routingDisabled: z48.boolean().optional(),
|
|
16842
|
+
placementDrcChecksDisabled: z48.boolean().optional(),
|
|
16843
|
+
bomDisabled: z48.boolean().optional(),
|
|
16792
16844
|
defaultTraceWidth: length3.optional(),
|
|
16793
16845
|
...routingTolerances.shape,
|
|
16794
16846
|
nominalTraceWidth: length3.optional(),
|
|
16795
16847
|
partsEngine: partsEngine.optional(),
|
|
16796
|
-
_subcircuitCachingEnabled:
|
|
16797
|
-
pcbRouteCache:
|
|
16848
|
+
_subcircuitCachingEnabled: z48.boolean().optional(),
|
|
16849
|
+
pcbRouteCache: z48.custom((v) => true).optional(),
|
|
16798
16850
|
autorouter: autorouterProp.optional(),
|
|
16799
16851
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
16800
16852
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
16801
16853
|
autorouterVersion: autorouterVersion.optional(),
|
|
16802
|
-
square:
|
|
16803
|
-
emptyArea:
|
|
16804
|
-
filledArea:
|
|
16854
|
+
square: z48.boolean().optional(),
|
|
16855
|
+
emptyArea: z48.string().optional(),
|
|
16856
|
+
filledArea: z48.string().optional(),
|
|
16805
16857
|
width: distance11.optional(),
|
|
16806
16858
|
height: distance11.optional(),
|
|
16807
|
-
outline:
|
|
16859
|
+
outline: z48.array(point).optional(),
|
|
16808
16860
|
outlineOffsetX: distance11.optional(),
|
|
16809
16861
|
outlineOffsetY: distance11.optional(),
|
|
16810
|
-
circuitJson:
|
|
16811
|
-
exposedNets:
|
|
16812
|
-
exposeNets:
|
|
16862
|
+
circuitJson: z48.array(z48.any()).optional(),
|
|
16863
|
+
exposedNets: z48.array(z48.string()).optional(),
|
|
16864
|
+
exposeNets: z48.boolean().optional()
|
|
16813
16865
|
});
|
|
16814
16866
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
16815
|
-
subcircuit:
|
|
16867
|
+
subcircuit: z48.literal(true)
|
|
16816
16868
|
});
|
|
16817
|
-
var groupProps =
|
|
16818
|
-
baseGroupProps.extend({ subcircuit:
|
|
16869
|
+
var groupProps = z48.discriminatedUnion("subcircuit", [
|
|
16870
|
+
baseGroupProps.extend({ subcircuit: z48.literal(false).optional() }),
|
|
16819
16871
|
subcircuitGroupPropsWithBool
|
|
16820
16872
|
]);
|
|
16821
16873
|
expectTypesMatch(true);
|
|
@@ -16825,25 +16877,25 @@ expectTypesMatch(true);
|
|
|
16825
16877
|
expectTypesMatch(true);
|
|
16826
16878
|
|
|
16827
16879
|
// lib/components/board.ts
|
|
16828
|
-
var boardColor =
|
|
16829
|
-
var boardOutlinePoint =
|
|
16880
|
+
var boardColor = z49.custom((value) => typeof value === "string");
|
|
16881
|
+
var boardOutlinePoint = z49.object({
|
|
16830
16882
|
...point.shape,
|
|
16831
|
-
isCastellatedHole:
|
|
16883
|
+
isCastellatedHole: z49.boolean().optional(),
|
|
16832
16884
|
holeDiameter: distance.optional(),
|
|
16833
16885
|
padDiameter: distance.optional(),
|
|
16834
|
-
connectsTo:
|
|
16886
|
+
connectsTo: z49.string().or(z49.array(z49.string())).optional()
|
|
16835
16887
|
}).superRefine((outlinePoint, ctx) => {
|
|
16836
16888
|
if (outlinePoint.isCastellatedHole) {
|
|
16837
16889
|
if (outlinePoint.holeDiameter === void 0) {
|
|
16838
16890
|
ctx.addIssue({
|
|
16839
|
-
code:
|
|
16891
|
+
code: z49.ZodIssueCode.custom,
|
|
16840
16892
|
path: ["holeDiameter"],
|
|
16841
16893
|
message: "holeDiameter is required for a castellated hole"
|
|
16842
16894
|
});
|
|
16843
16895
|
}
|
|
16844
16896
|
if (outlinePoint.padDiameter === void 0) {
|
|
16845
16897
|
ctx.addIssue({
|
|
16846
|
-
code:
|
|
16898
|
+
code: z49.ZodIssueCode.custom,
|
|
16847
16899
|
path: ["padDiameter"],
|
|
16848
16900
|
message: "padDiameter is required for a castellated hole"
|
|
16849
16901
|
});
|
|
@@ -16852,19 +16904,19 @@ var boardOutlinePoint = z47.object({
|
|
|
16852
16904
|
}
|
|
16853
16905
|
if (outlinePoint.holeDiameter !== void 0 || outlinePoint.padDiameter !== void 0 || outlinePoint.connectsTo !== void 0) {
|
|
16854
16906
|
ctx.addIssue({
|
|
16855
|
-
code:
|
|
16907
|
+
code: z49.ZodIssueCode.custom,
|
|
16856
16908
|
path: ["isCastellatedHole"],
|
|
16857
16909
|
message: "isCastellatedHole must be true when castellated hole props are provided"
|
|
16858
16910
|
});
|
|
16859
16911
|
}
|
|
16860
16912
|
});
|
|
16861
16913
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
16862
|
-
mountedTo:
|
|
16863
|
-
mountGap: distance.pipe(
|
|
16914
|
+
mountedTo: z49.string().trim().min(1).optional().describe('e.g. "NEMA17.backface".'),
|
|
16915
|
+
mountGap: distance.pipe(z49.number().nonnegative().finite()).optional().describe('Clearance from the mounting face, e.g. "6mm".'),
|
|
16864
16916
|
mountRotationAnchor: boardMountRotationAnchor.optional().describe('e.g. "J_USB" or "rightedge".'),
|
|
16865
16917
|
mountRotation: boardMountRotation.optional().describe('e.g. "calc(NEMA17.wireside-90degcw)".'),
|
|
16866
16918
|
mountOrientation: boardMountOrientation.optional().describe('e.g. "top_layer_toward_mount_face".'),
|
|
16867
|
-
fabricatorPreset:
|
|
16919
|
+
fabricatorPreset: z49.enum([
|
|
16868
16920
|
"jlcpcb_economy",
|
|
16869
16921
|
"jlcpcb_standard",
|
|
16870
16922
|
"jlcpcb_economy_20260912",
|
|
@@ -16872,24 +16924,24 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
|
16872
16924
|
]).optional().describe(
|
|
16873
16925
|
"Fabricator preset, preserved as supplied. Omitted leaves the preset unset."
|
|
16874
16926
|
),
|
|
16875
|
-
material:
|
|
16876
|
-
layers:
|
|
16877
|
-
|
|
16878
|
-
|
|
16879
|
-
|
|
16880
|
-
|
|
16881
|
-
|
|
16882
|
-
|
|
16927
|
+
material: z49.enum(["fr4", "fr1", "flex"]).default("fr4"),
|
|
16928
|
+
layers: z49.union([
|
|
16929
|
+
z49.literal(1),
|
|
16930
|
+
z49.literal(2),
|
|
16931
|
+
z49.literal(4),
|
|
16932
|
+
z49.literal(6),
|
|
16933
|
+
z49.literal(8),
|
|
16934
|
+
z49.literal(10)
|
|
16883
16935
|
]).default(2),
|
|
16884
|
-
allowBlindAndBuriedVias:
|
|
16936
|
+
allowBlindAndBuriedVias: z49.boolean().default(false).describe(
|
|
16885
16937
|
"Whether the autorouter may generate blind and buried vias. Defaults to false, which restricts newly generated vias to the full board stack."
|
|
16886
16938
|
),
|
|
16887
|
-
routeRemaining:
|
|
16939
|
+
routeRemaining: z49.boolean().optional().describe(
|
|
16888
16940
|
"Whether to route remaining unrouted connections after explicit routing phases. Boolean values are preserved; omitted leaves the setting unset. No aliases or prop conflicts are introduced, and existing boards require no migration."
|
|
16889
16941
|
),
|
|
16890
|
-
defaultViaTenting:
|
|
16891
|
-
|
|
16892
|
-
|
|
16942
|
+
defaultViaTenting: z49.union([
|
|
16943
|
+
z49.boolean(),
|
|
16944
|
+
z49.enum([
|
|
16893
16945
|
"both_sides",
|
|
16894
16946
|
"top_and_bottom_tented",
|
|
16895
16947
|
"top_tented",
|
|
@@ -16908,46 +16960,46 @@ var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
|
16908
16960
|
boardAnchorPosition: point.optional(),
|
|
16909
16961
|
anchorAlignment: ninePointAnchor.optional(),
|
|
16910
16962
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
16911
|
-
outline:
|
|
16912
|
-
title:
|
|
16963
|
+
outline: z49.array(boardOutlinePoint).optional(),
|
|
16964
|
+
title: z49.string().optional(),
|
|
16913
16965
|
solderMaskColor: boardColor.optional(),
|
|
16914
16966
|
topSolderMaskColor: boardColor.optional(),
|
|
16915
16967
|
bottomSolderMaskColor: boardColor.optional(),
|
|
16916
16968
|
silkscreenColor: boardColor.optional(),
|
|
16917
16969
|
topSilkscreenColor: boardColor.optional(),
|
|
16918
16970
|
bottomSilkscreenColor: boardColor.optional(),
|
|
16919
|
-
doubleSidedAssembly:
|
|
16920
|
-
isViaInPadAllowed:
|
|
16971
|
+
doubleSidedAssembly: z49.boolean().optional().default(false),
|
|
16972
|
+
isViaInPadAllowed: z49.boolean().optional().describe(
|
|
16921
16973
|
"Allows intentional via-in-pad designs to pass DRC. Omitted or false keeps via-in-pad disallowed."
|
|
16922
16974
|
),
|
|
16923
|
-
automaticPoursEnabled:
|
|
16975
|
+
automaticPoursEnabled: z49.boolean().default(false).describe(
|
|
16924
16976
|
"Whether implicit copper pours should be generated automatically. Defaults to false."
|
|
16925
16977
|
),
|
|
16926
|
-
enableViaStitching:
|
|
16978
|
+
enableViaStitching: z49.boolean().default(false).describe(
|
|
16927
16979
|
"Whether to stitch copper pours on the same net across layers with vias. Defaults to false."
|
|
16928
16980
|
),
|
|
16929
|
-
viaStitchPitch: distance.pipe(
|
|
16981
|
+
viaStitchPitch: distance.pipe(z49.number().positive().finite()).optional().describe(
|
|
16930
16982
|
"Positive center-to-center stitching via spacing in millimeters or a unit string, parsed to millimeters. Omitted uses the solver default. Does not enable stitching by itself."
|
|
16931
16983
|
),
|
|
16932
|
-
schematicDisabled:
|
|
16984
|
+
schematicDisabled: z49.boolean().optional()
|
|
16933
16985
|
});
|
|
16934
16986
|
expectTypesMatch(true);
|
|
16935
16987
|
expectTypesMatch(true);
|
|
16936
16988
|
|
|
16937
16989
|
// lib/components/pcb-bend.ts
|
|
16938
16990
|
import { rotation as rotation3 } from "circuit-json";
|
|
16939
|
-
import { z as
|
|
16940
|
-
var finiteDistance = distance.pipe(
|
|
16941
|
-
var pcbBendProps =
|
|
16942
|
-
name:
|
|
16991
|
+
import { z as z50 } from "zod";
|
|
16992
|
+
var finiteDistance = distance.pipe(z50.number().finite());
|
|
16993
|
+
var pcbBendProps = z50.object({
|
|
16994
|
+
name: z50.string().optional(),
|
|
16943
16995
|
x1: finiteDistance,
|
|
16944
16996
|
y1: finiteDistance,
|
|
16945
16997
|
x2: finiteDistance,
|
|
16946
16998
|
y2: finiteDistance,
|
|
16947
|
-
bendAngle: rotation3.pipe(
|
|
16948
|
-
bendRadius: distance.pipe(
|
|
16949
|
-
tearReliefRadius: distance.pipe(
|
|
16950
|
-
bendSide:
|
|
16999
|
+
bendAngle: rotation3.pipe(z50.number().finite()),
|
|
17000
|
+
bendRadius: distance.pipe(z50.number().finite().positive()),
|
|
17001
|
+
tearReliefRadius: distance.pipe(z50.number().finite().positive()).optional(),
|
|
17002
|
+
bendSide: z50.enum(["left", "right"])
|
|
16951
17003
|
}).refine(({ x1, y1, x2, y2 }) => x1 !== x2 || y1 !== y2, {
|
|
16952
17004
|
message: "Bend centerline endpoints must be distinct",
|
|
16953
17005
|
path: ["x2"]
|
|
@@ -16955,83 +17007,83 @@ var pcbBendProps = z48.object({
|
|
|
16955
17007
|
expectTypesMatch(true);
|
|
16956
17008
|
|
|
16957
17009
|
// lib/components/pcb-soldermask-opening.ts
|
|
16958
|
-
import { z as
|
|
16959
|
-
var finiteDistance2 = distance.pipe(
|
|
16960
|
-
var positiveDistance2 = distance.pipe(
|
|
17010
|
+
import { z as z51 } from "zod";
|
|
17011
|
+
var finiteDistance2 = distance.pipe(z51.number().finite());
|
|
17012
|
+
var positiveDistance2 = distance.pipe(z51.number().finite().positive());
|
|
16961
17013
|
var openingBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
16962
|
-
name:
|
|
17014
|
+
name: z51.string().optional(),
|
|
16963
17015
|
/** Face whose solder mask or flex coverlay is removed. Required. */
|
|
16964
|
-
layer:
|
|
17016
|
+
layer: z51.enum(["top", "bottom"])
|
|
16965
17017
|
});
|
|
16966
|
-
var pcbSoldermaskOpeningProps =
|
|
17018
|
+
var pcbSoldermaskOpeningProps = z51.discriminatedUnion("shape", [
|
|
16967
17019
|
openingBaseProps.extend({
|
|
16968
|
-
shape:
|
|
17020
|
+
shape: z51.literal("rect"),
|
|
16969
17021
|
width: positiveDistance2,
|
|
16970
17022
|
height: positiveDistance2,
|
|
16971
|
-
radius:
|
|
16972
|
-
points:
|
|
17023
|
+
radius: z51.never().optional(),
|
|
17024
|
+
points: z51.never().optional()
|
|
16973
17025
|
}),
|
|
16974
17026
|
openingBaseProps.extend({
|
|
16975
|
-
shape:
|
|
17027
|
+
shape: z51.literal("circle"),
|
|
16976
17028
|
radius: positiveDistance2,
|
|
16977
|
-
width:
|
|
16978
|
-
height:
|
|
16979
|
-
points:
|
|
17029
|
+
width: z51.never().optional(),
|
|
17030
|
+
height: z51.never().optional(),
|
|
17031
|
+
points: z51.never().optional()
|
|
16980
17032
|
}),
|
|
16981
17033
|
openingBaseProps.extend({
|
|
16982
|
-
shape:
|
|
17034
|
+
shape: z51.literal("polygon"),
|
|
16983
17035
|
/** Local vertices; pcbX/pcbY/pcbRotation place the implicitly closed boundary. */
|
|
16984
|
-
points:
|
|
17036
|
+
points: z51.array(z51.object({ x: finiteDistance2, y: finiteDistance2 })).min(3).refine((points) => {
|
|
16985
17037
|
const twiceArea = points.reduce((sum, point8, index) => {
|
|
16986
17038
|
const next = points[(index + 1) % points.length];
|
|
16987
17039
|
return sum + point8.x * next.y - next.x * point8.y;
|
|
16988
17040
|
}, 0);
|
|
16989
17041
|
return Number.isFinite(twiceArea) && twiceArea !== 0;
|
|
16990
17042
|
}, "Solder-mask opening must enclose a nonzero area"),
|
|
16991
|
-
width:
|
|
16992
|
-
height:
|
|
16993
|
-
radius:
|
|
17043
|
+
width: z51.never().optional(),
|
|
17044
|
+
height: z51.never().optional(),
|
|
17045
|
+
radius: z51.never().optional()
|
|
16994
17046
|
})
|
|
16995
17047
|
]);
|
|
16996
17048
|
|
|
16997
17049
|
// lib/components/pcb-stiffener.ts
|
|
16998
|
-
import { z as
|
|
16999
|
-
var positiveDistance3 = distance.pipe(
|
|
17000
|
-
var finiteDistance3 = distance.pipe(
|
|
17050
|
+
import { z as z52 } from "zod";
|
|
17051
|
+
var positiveDistance3 = distance.pipe(z52.number().finite().positive());
|
|
17052
|
+
var finiteDistance3 = distance.pipe(z52.number().finite());
|
|
17001
17053
|
var stiffenerBaseProps = pcbLayoutProps.omit({ layer: true }).extend({
|
|
17002
|
-
name:
|
|
17054
|
+
name: z52.string().optional(),
|
|
17003
17055
|
/** Board attachment face, not a copper-layer assignment. Required. */
|
|
17004
|
-
layer:
|
|
17005
|
-
material:
|
|
17056
|
+
layer: z52.enum(["top", "bottom"]),
|
|
17057
|
+
material: z52.enum(["fr4", "polyimide", "stainless_steel", "aluminum"]),
|
|
17006
17058
|
/** Stiffener material thickness only, excluding PCB and adhesive. */
|
|
17007
17059
|
thickness: positiveDistance3,
|
|
17008
17060
|
/** Nonnegative adhesive thickness; omission means unspecified, not zero. */
|
|
17009
|
-
adhesiveThickness: distance.pipe(
|
|
17061
|
+
adhesiveThickness: distance.pipe(z52.number().finite().nonnegative()).optional()
|
|
17010
17062
|
});
|
|
17011
|
-
var pcbStiffenerProps =
|
|
17063
|
+
var pcbStiffenerProps = z52.discriminatedUnion("shape", [
|
|
17012
17064
|
stiffenerBaseProps.extend({
|
|
17013
|
-
shape:
|
|
17065
|
+
shape: z52.literal("rect"),
|
|
17014
17066
|
width: positiveDistance3,
|
|
17015
17067
|
height: positiveDistance3,
|
|
17016
|
-
outline:
|
|
17068
|
+
outline: z52.never().optional()
|
|
17017
17069
|
}),
|
|
17018
17070
|
stiffenerBaseProps.extend({
|
|
17019
|
-
shape:
|
|
17071
|
+
shape: z52.literal("polygon"),
|
|
17020
17072
|
/** Local vertices transformed by pcbX/pcbY/pcbRotation; implicitly closed. */
|
|
17021
|
-
outline:
|
|
17073
|
+
outline: z52.array(z52.object({ x: finiteDistance3, y: finiteDistance3 })).min(3).refine((points) => {
|
|
17022
17074
|
const twiceArea = points.reduce((sum, p, i) => {
|
|
17023
17075
|
const next = points[(i + 1) % points.length];
|
|
17024
17076
|
return sum + p.x * next.y - next.x * p.y;
|
|
17025
17077
|
}, 0);
|
|
17026
17078
|
return Number.isFinite(twiceArea) && twiceArea !== 0;
|
|
17027
17079
|
}, "Stiffener outline must enclose a nonzero area"),
|
|
17028
|
-
width:
|
|
17029
|
-
height:
|
|
17080
|
+
width: z52.never().optional(),
|
|
17081
|
+
height: z52.never().optional()
|
|
17030
17082
|
})
|
|
17031
17083
|
]);
|
|
17032
17084
|
|
|
17033
17085
|
// lib/components/panel.ts
|
|
17034
|
-
import { z as
|
|
17086
|
+
import { z as z53 } from "zod";
|
|
17035
17087
|
var panelProps = baseGroupProps.omit({
|
|
17036
17088
|
width: true,
|
|
17037
17089
|
height: true,
|
|
@@ -17040,25 +17092,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
17040
17092
|
}).extend({
|
|
17041
17093
|
width: distance.optional(),
|
|
17042
17094
|
height: distance.optional(),
|
|
17043
|
-
children:
|
|
17095
|
+
children: z53.any().optional(),
|
|
17044
17096
|
anchorAlignment: ninePointAnchor.optional(),
|
|
17045
|
-
noSolderMask:
|
|
17046
|
-
panelizationMethod:
|
|
17097
|
+
noSolderMask: z53.boolean().optional(),
|
|
17098
|
+
panelizationMethod: z53.enum(["tab-routing", "outline_routing", "none"]).optional(),
|
|
17047
17099
|
boardGap: distance.optional(),
|
|
17048
|
-
layoutMode:
|
|
17049
|
-
row:
|
|
17050
|
-
col:
|
|
17100
|
+
layoutMode: z53.enum(["grid", "pack", "none"]).optional(),
|
|
17101
|
+
row: z53.number().optional(),
|
|
17102
|
+
col: z53.number().optional(),
|
|
17051
17103
|
cellWidth: distance.optional(),
|
|
17052
17104
|
cellHeight: distance.optional(),
|
|
17053
17105
|
tabWidth: distance.optional(),
|
|
17054
17106
|
tabLength: distance.optional(),
|
|
17055
|
-
mouseBites:
|
|
17107
|
+
mouseBites: z53.boolean().optional(),
|
|
17056
17108
|
edgePadding: distance.optional(),
|
|
17057
17109
|
edgePaddingLeft: distance.optional(),
|
|
17058
17110
|
edgePaddingRight: distance.optional(),
|
|
17059
17111
|
edgePaddingTop: distance.optional(),
|
|
17060
17112
|
edgePaddingBottom: distance.optional(),
|
|
17061
|
-
_subcircuitCachingEnabled:
|
|
17113
|
+
_subcircuitCachingEnabled: z53.boolean().optional()
|
|
17062
17114
|
});
|
|
17063
17115
|
expectTypesMatch(true);
|
|
17064
17116
|
|
|
@@ -17069,23 +17121,23 @@ expectTypesMatch(true);
|
|
|
17069
17121
|
|
|
17070
17122
|
// lib/common/fanoutTracePath.ts
|
|
17071
17123
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
17072
|
-
import { z as
|
|
17124
|
+
import { z as z55 } from "zod";
|
|
17073
17125
|
var coordinate = distance.refine(Number.isFinite, "Coordinate must be finite");
|
|
17074
17126
|
var positiveDistance4 = distance.refine(
|
|
17075
17127
|
(value) => Number.isFinite(value) && value > 0,
|
|
17076
17128
|
"Distance must be positive and finite"
|
|
17077
17129
|
);
|
|
17078
|
-
var routePoint =
|
|
17079
|
-
|
|
17080
|
-
route_type:
|
|
17130
|
+
var routePoint = z55.discriminatedUnion("route_type", [
|
|
17131
|
+
z55.object({
|
|
17132
|
+
route_type: z55.literal("wire"),
|
|
17081
17133
|
x: coordinate,
|
|
17082
17134
|
y: coordinate,
|
|
17083
17135
|
width: positiveDistance4,
|
|
17084
|
-
width_interpolation_mode:
|
|
17136
|
+
width_interpolation_mode: z55.enum(["linear", "quadratic"]).optional().describe("Interpolate width from this point to the next wire point."),
|
|
17085
17137
|
layer: layer_ref5
|
|
17086
17138
|
}),
|
|
17087
|
-
|
|
17088
|
-
route_type:
|
|
17139
|
+
z55.object({
|
|
17140
|
+
route_type: z55.literal("via"),
|
|
17089
17141
|
x: coordinate,
|
|
17090
17142
|
y: coordinate,
|
|
17091
17143
|
from_layer: layer_ref5,
|
|
@@ -17094,9 +17146,9 @@ var routePoint = z53.discriminatedUnion("route_type", [
|
|
|
17094
17146
|
via_hole_diameter: positiveDistance4.optional()
|
|
17095
17147
|
})
|
|
17096
17148
|
]);
|
|
17097
|
-
var fanoutTracePath =
|
|
17098
|
-
connection:
|
|
17099
|
-
route:
|
|
17149
|
+
var fanoutTracePath = z55.object({
|
|
17150
|
+
connection: z55.string().min(1),
|
|
17151
|
+
route: z55.array(routePoint).min(2).superRefine((route, ctx) => {
|
|
17100
17152
|
const first = route[0];
|
|
17101
17153
|
let layer = first?.route_type === "via" ? first.from_layer : first?.layer;
|
|
17102
17154
|
for (const [index, point8] of route.entries()) {
|
|
@@ -17123,16 +17175,16 @@ var fanoutTracePath = z53.object({
|
|
|
17123
17175
|
|
|
17124
17176
|
// lib/common/fanoutProps.ts
|
|
17125
17177
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
17126
|
-
import { z as
|
|
17178
|
+
import { z as z57 } from "zod";
|
|
17127
17179
|
|
|
17128
17180
|
// lib/common/fanoutBoundaryPadding.ts
|
|
17129
|
-
import { z as
|
|
17181
|
+
import { z as z56 } from "zod";
|
|
17130
17182
|
var nonnegativeDistance = distance.refine((value) => value >= 0, {
|
|
17131
17183
|
message: "Fanout boundary padding cannot be negative"
|
|
17132
17184
|
});
|
|
17133
|
-
var fanoutBoundaryPadding =
|
|
17185
|
+
var fanoutBoundaryPadding = z56.union([
|
|
17134
17186
|
nonnegativeDistance,
|
|
17135
|
-
|
|
17187
|
+
z56.object({
|
|
17136
17188
|
top: nonnegativeDistance.optional(),
|
|
17137
17189
|
right: nonnegativeDistance.optional(),
|
|
17138
17190
|
bottom: nonnegativeDistance.optional(),
|
|
@@ -17159,32 +17211,32 @@ var canonicalBusFanoutDirectionValues = [
|
|
|
17159
17211
|
"leftside_top",
|
|
17160
17212
|
"center"
|
|
17161
17213
|
];
|
|
17162
|
-
var canonicalBusFanoutDirection =
|
|
17214
|
+
var canonicalBusFanoutDirection = z57.enum(
|
|
17163
17215
|
canonicalBusFanoutDirectionValues
|
|
17164
17216
|
);
|
|
17165
|
-
var busFanoutDirection =
|
|
17217
|
+
var busFanoutDirection = z57.union([
|
|
17166
17218
|
ninePointAnchor,
|
|
17167
17219
|
canonicalBusFanoutDirection,
|
|
17168
|
-
|
|
17169
|
-
direction:
|
|
17220
|
+
z57.object({
|
|
17221
|
+
direction: z57.union([ninePointAnchor, canonicalBusFanoutDirection])
|
|
17170
17222
|
})
|
|
17171
17223
|
]);
|
|
17172
|
-
var fanoutProps =
|
|
17173
|
-
busFanoutDirections:
|
|
17224
|
+
var fanoutProps = z57.object({
|
|
17225
|
+
busFanoutDirections: z57.record(busFanoutDirection).optional(),
|
|
17174
17226
|
fanoutBoundaryPadding: fanoutBoundaryPadding.optional(),
|
|
17175
|
-
fanoutRoutingLayers:
|
|
17176
|
-
fanoutPourNetMap:
|
|
17227
|
+
fanoutRoutingLayers: z57.array(layer_ref6).min(1).optional(),
|
|
17228
|
+
fanoutPourNetMap: z57.record(layer_ref6, z57.union([z57.string(), z57.array(z57.string()).min(1)])).optional()
|
|
17177
17229
|
});
|
|
17178
17230
|
expectTypesMatch(true);
|
|
17179
17231
|
|
|
17180
17232
|
// lib/components/breakout.ts
|
|
17181
|
-
import { z as
|
|
17233
|
+
import { z as z58 } from "zod";
|
|
17182
17234
|
var nonnegativeFanoutMargin = distance.refine((value) => value >= 0, {
|
|
17183
17235
|
message: "Fanout margin cannot be negative"
|
|
17184
17236
|
});
|
|
17185
17237
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
17186
17238
|
autorouter: autorouterProp.default("fanout"),
|
|
17187
|
-
pcbTracePaths:
|
|
17239
|
+
pcbTracePaths: z58.array(fanoutTracePath).optional(),
|
|
17188
17240
|
padding: distance.optional(),
|
|
17189
17241
|
paddingLeft: distance.optional(),
|
|
17190
17242
|
paddingRight: distance.optional(),
|
|
@@ -17197,42 +17249,42 @@ expectTypesMatch(true);
|
|
|
17197
17249
|
|
|
17198
17250
|
// lib/components/chip.ts
|
|
17199
17251
|
import { distance as distance12, supplier_name as supplier_name2 } from "circuit-json";
|
|
17200
|
-
import { isValidElement } from "react";
|
|
17201
|
-
import { z as
|
|
17202
|
-
var connectionTarget2 =
|
|
17203
|
-
var noConnectProp =
|
|
17204
|
-
var connectionsProp =
|
|
17205
|
-
var spicemodelElement =
|
|
17252
|
+
import { isValidElement as isValidElement2 } from "react";
|
|
17253
|
+
import { z as z59 } from "zod";
|
|
17254
|
+
var connectionTarget2 = z59.string().or(z59.array(z59.string()).readonly()).or(z59.array(z59.string()));
|
|
17255
|
+
var noConnectProp = z59.array(schematicPinLabel).readonly().or(z59.array(schematicPinLabel));
|
|
17256
|
+
var connectionsProp = z59.custom().pipe(z59.record(z59.string(), connectionTarget2));
|
|
17257
|
+
var spicemodelElement = z59.custom(
|
|
17206
17258
|
(v) => !!v && typeof v === "object" && "type" in v && "props" in v
|
|
17207
17259
|
);
|
|
17208
|
-
var internalCircuitElement =
|
|
17209
|
-
(value) =>
|
|
17260
|
+
var internalCircuitElement = z59.custom(
|
|
17261
|
+
(value) => isValidElement2(value) && value.type === "internalcircuit"
|
|
17210
17262
|
);
|
|
17211
|
-
var pinLabelsProp =
|
|
17263
|
+
var pinLabelsProp = z59.record(
|
|
17212
17264
|
schematicPinLabel,
|
|
17213
|
-
schematicPinLabel.or(
|
|
17265
|
+
schematicPinLabel.or(z59.array(schematicPinLabel).readonly()).or(z59.array(schematicPinLabel))
|
|
17214
17266
|
);
|
|
17215
17267
|
expectTypesMatch(true);
|
|
17216
|
-
var pinCompatibleVariant =
|
|
17217
|
-
manufacturerPartNumber:
|
|
17218
|
-
supplierPartNumber:
|
|
17268
|
+
var pinCompatibleVariant = z59.object({
|
|
17269
|
+
manufacturerPartNumber: z59.string().optional(),
|
|
17270
|
+
supplierPartNumber: z59.record(supplier_name2, z59.array(z59.string())).optional()
|
|
17219
17271
|
});
|
|
17220
17272
|
var chipProps = commonComponentProps.extend({
|
|
17221
|
-
manufacturerPartNumber:
|
|
17273
|
+
manufacturerPartNumber: z59.string().optional(),
|
|
17222
17274
|
pinLabels: pinLabelsProp.optional(),
|
|
17223
|
-
showPinAliases:
|
|
17224
|
-
pcbPinLabels:
|
|
17225
|
-
internallyConnectedPins:
|
|
17226
|
-
externallyConnectedPins:
|
|
17275
|
+
showPinAliases: z59.boolean().optional(),
|
|
17276
|
+
pcbPinLabels: z59.record(z59.string(), z59.string()).optional(),
|
|
17277
|
+
internallyConnectedPins: z59.array(z59.array(z59.union([z59.string(), z59.number()]))).optional(),
|
|
17278
|
+
externallyConnectedPins: z59.array(z59.array(z59.string())).optional(),
|
|
17227
17279
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
17228
17280
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
17229
|
-
pinCompatibleVariants:
|
|
17281
|
+
pinCompatibleVariants: z59.array(pinCompatibleVariant).optional(),
|
|
17230
17282
|
schPinStyle: schematicPinStyle.optional(),
|
|
17231
17283
|
schPinSpacing: distance12.optional(),
|
|
17232
17284
|
schWidth: distance12.optional(),
|
|
17233
17285
|
schHeight: distance12.optional(),
|
|
17234
|
-
noSchematicRepresentation:
|
|
17235
|
-
schShowInternalCircuit:
|
|
17286
|
+
noSchematicRepresentation: z59.boolean().optional(),
|
|
17287
|
+
schShowInternalCircuit: z59.boolean().optional().default(false),
|
|
17236
17288
|
noConnect: noConnectProp.optional(),
|
|
17237
17289
|
connections: connectionsProp.optional(),
|
|
17238
17290
|
spiceModel: spicemodelElement.optional(),
|
|
@@ -17247,38 +17299,38 @@ expectTypesMatch(true);
|
|
|
17247
17299
|
|
|
17248
17300
|
// lib/components/jumper.ts
|
|
17249
17301
|
import { distance as distance13 } from "circuit-json";
|
|
17250
|
-
import { z as
|
|
17302
|
+
import { z as z60 } from "zod";
|
|
17251
17303
|
var jumperProps = commonComponentProps.extend({
|
|
17252
|
-
manufacturerPartNumber:
|
|
17253
|
-
pinLabels:
|
|
17254
|
-
|
|
17255
|
-
schematicPinLabel.or(
|
|
17304
|
+
manufacturerPartNumber: z60.string().optional(),
|
|
17305
|
+
pinLabels: z60.record(
|
|
17306
|
+
z60.number().or(schematicPinLabel),
|
|
17307
|
+
schematicPinLabel.or(z60.array(schematicPinLabel))
|
|
17256
17308
|
).optional(),
|
|
17257
17309
|
schPinStyle: schematicPinStyle.optional(),
|
|
17258
17310
|
schPinSpacing: distance13.optional(),
|
|
17259
17311
|
schWidth: distance13.optional(),
|
|
17260
17312
|
schHeight: distance13.optional(),
|
|
17261
|
-
schDirection:
|
|
17313
|
+
schDirection: z60.enum(["left", "right"]).optional(),
|
|
17262
17314
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
17263
17315
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
17264
|
-
pcbPinLabels:
|
|
17265
|
-
pinCount:
|
|
17266
|
-
internallyConnectedPins:
|
|
17267
|
-
connections:
|
|
17316
|
+
pcbPinLabels: z60.record(z60.string(), z60.string()).optional(),
|
|
17317
|
+
pinCount: z60.union([z60.literal(2), z60.literal(3)]).optional(),
|
|
17318
|
+
internallyConnectedPins: z60.array(z60.array(z60.union([z60.string(), z60.number()]))).optional(),
|
|
17319
|
+
connections: z60.custom().pipe(z60.record(z60.string(), connectionTarget)).optional()
|
|
17268
17320
|
});
|
|
17269
17321
|
expectTypesMatch(true);
|
|
17270
17322
|
|
|
17271
17323
|
// lib/components/solderjumper.ts
|
|
17272
|
-
import { z as
|
|
17324
|
+
import { z as z61 } from "zod";
|
|
17273
17325
|
var solderjumperProps = jumperProps.extend({
|
|
17274
|
-
bridgedPins:
|
|
17275
|
-
bridged:
|
|
17326
|
+
bridgedPins: z61.array(z61.array(z61.string())).optional(),
|
|
17327
|
+
bridged: z61.boolean().optional()
|
|
17276
17328
|
});
|
|
17277
17329
|
expectTypesMatch(true);
|
|
17278
17330
|
|
|
17279
17331
|
// lib/components/connector.ts
|
|
17280
|
-
import { z as
|
|
17281
|
-
var connectorStandard =
|
|
17332
|
+
import { z as z62 } from "zod";
|
|
17333
|
+
var connectorStandard = z62.enum([
|
|
17282
17334
|
"usb_c",
|
|
17283
17335
|
"m2",
|
|
17284
17336
|
"jst_sh",
|
|
@@ -17290,43 +17342,43 @@ var connectorStandard = z60.enum([
|
|
|
17290
17342
|
]);
|
|
17291
17343
|
var connectorProps = chipProps.extend({
|
|
17292
17344
|
standard: connectorStandard.optional(),
|
|
17293
|
-
pinCount:
|
|
17345
|
+
pinCount: z62.number().int().positive().optional()
|
|
17294
17346
|
});
|
|
17295
17347
|
expectTypesMatch(true);
|
|
17296
17348
|
|
|
17297
17349
|
// lib/components/interconnect.ts
|
|
17298
|
-
import { z as
|
|
17350
|
+
import { z as z63 } from "zod";
|
|
17299
17351
|
var interconnectProps = commonComponentProps.extend({
|
|
17300
|
-
standard:
|
|
17301
|
-
pinLabels:
|
|
17302
|
-
|
|
17303
|
-
schematicPinLabel.or(
|
|
17352
|
+
standard: z63.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
17353
|
+
pinLabels: z63.record(
|
|
17354
|
+
z63.number().or(schematicPinLabel),
|
|
17355
|
+
schematicPinLabel.or(z63.array(schematicPinLabel))
|
|
17304
17356
|
).optional(),
|
|
17305
|
-
internallyConnectedPins:
|
|
17357
|
+
internallyConnectedPins: z63.array(z63.array(z63.union([z63.string(), z63.number()]))).optional()
|
|
17306
17358
|
});
|
|
17307
17359
|
expectTypesMatch(true);
|
|
17308
17360
|
|
|
17309
17361
|
// lib/components/fuse.ts
|
|
17310
|
-
import { z as
|
|
17362
|
+
import { z as z64 } from "zod";
|
|
17311
17363
|
var fusePinLabels = ["pin1", "pin2"];
|
|
17312
17364
|
var fuseProps = commonComponentProps.extend({
|
|
17313
|
-
currentRating:
|
|
17314
|
-
voltageRating:
|
|
17315
|
-
schShowRatings:
|
|
17365
|
+
currentRating: z64.union([z64.number(), z64.string()]),
|
|
17366
|
+
voltageRating: z64.union([z64.number(), z64.string()]).optional(),
|
|
17367
|
+
schShowRatings: z64.boolean().optional(),
|
|
17316
17368
|
schOrientation: schematicOrientation.optional(),
|
|
17317
|
-
connections:
|
|
17318
|
-
|
|
17319
|
-
|
|
17320
|
-
|
|
17321
|
-
|
|
17322
|
-
|
|
17369
|
+
connections: z64.record(
|
|
17370
|
+
z64.string(),
|
|
17371
|
+
z64.union([
|
|
17372
|
+
z64.string(),
|
|
17373
|
+
z64.array(z64.string()).readonly(),
|
|
17374
|
+
z64.array(z64.string())
|
|
17323
17375
|
])
|
|
17324
17376
|
).optional()
|
|
17325
17377
|
});
|
|
17326
17378
|
|
|
17327
17379
|
// lib/components/platedhole.ts
|
|
17328
17380
|
import { distance as distance14 } from "circuit-json";
|
|
17329
|
-
import { z as
|
|
17381
|
+
import { z as z65 } from "zod";
|
|
17330
17382
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
17331
17383
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
17332
17384
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -17358,26 +17410,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
17358
17410
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
17359
17411
|
return props;
|
|
17360
17412
|
};
|
|
17361
|
-
var distanceHiddenUndefined =
|
|
17413
|
+
var distanceHiddenUndefined = z65.custom().transform((a) => {
|
|
17362
17414
|
if (a === void 0) return void 0;
|
|
17363
17415
|
return distance14.parse(a);
|
|
17364
17416
|
});
|
|
17365
|
-
var platedHolePropsByShape =
|
|
17417
|
+
var platedHolePropsByShape = z65.discriminatedUnion("shape", [
|
|
17366
17418
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17367
|
-
name:
|
|
17368
|
-
connectsTo:
|
|
17369
|
-
shape:
|
|
17419
|
+
name: z65.string().optional(),
|
|
17420
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17421
|
+
shape: z65.literal("circle"),
|
|
17370
17422
|
holeDiameter: distance14,
|
|
17371
17423
|
outerDiameter: distance14,
|
|
17372
17424
|
padDiameter: distance14.optional().describe("Diameter of the copper pad"),
|
|
17373
17425
|
portHints: portHints.optional(),
|
|
17374
17426
|
solderMaskMargin: distance14.optional(),
|
|
17375
|
-
coveredWithSolderMask:
|
|
17427
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17376
17428
|
}),
|
|
17377
17429
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17378
|
-
name:
|
|
17379
|
-
connectsTo:
|
|
17380
|
-
shape:
|
|
17430
|
+
name: z65.string().optional(),
|
|
17431
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17432
|
+
shape: z65.literal("oval"),
|
|
17381
17433
|
outerWidth: distance14,
|
|
17382
17434
|
outerHeight: distance14,
|
|
17383
17435
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17386,13 +17438,13 @@ var platedHolePropsByShape = z63.discriminatedUnion("shape", [
|
|
|
17386
17438
|
innerHeight: distance14.optional().describe("DEPRECATED use holeHeight"),
|
|
17387
17439
|
portHints: portHints.optional(),
|
|
17388
17440
|
solderMaskMargin: distance14.optional(),
|
|
17389
|
-
coveredWithSolderMask:
|
|
17441
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17390
17442
|
}),
|
|
17391
17443
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17392
|
-
name:
|
|
17393
|
-
connectsTo:
|
|
17394
|
-
shape:
|
|
17395
|
-
rectPad:
|
|
17444
|
+
name: z65.string().optional(),
|
|
17445
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17446
|
+
shape: z65.literal("pill"),
|
|
17447
|
+
rectPad: z65.boolean().optional(),
|
|
17396
17448
|
outerWidth: distance14,
|
|
17397
17449
|
outerHeight: distance14,
|
|
17398
17450
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -17403,30 +17455,30 @@ var platedHolePropsByShape = z63.discriminatedUnion("shape", [
|
|
|
17403
17455
|
holeOffsetX: distance14.optional(),
|
|
17404
17456
|
holeOffsetY: distance14.optional(),
|
|
17405
17457
|
solderMaskMargin: distance14.optional(),
|
|
17406
|
-
coveredWithSolderMask:
|
|
17458
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17407
17459
|
}),
|
|
17408
17460
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17409
|
-
name:
|
|
17410
|
-
connectsTo:
|
|
17411
|
-
shape:
|
|
17461
|
+
name: z65.string().optional(),
|
|
17462
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17463
|
+
shape: z65.literal("circular_hole_with_rect_pad"),
|
|
17412
17464
|
holeDiameter: distance14,
|
|
17413
17465
|
rectPadWidth: distance14,
|
|
17414
17466
|
rectPadHeight: distance14,
|
|
17415
17467
|
rectBorderRadius: distance14.optional(),
|
|
17416
|
-
holeShape:
|
|
17417
|
-
padShape:
|
|
17468
|
+
holeShape: z65.literal("circle").optional(),
|
|
17469
|
+
padShape: z65.literal("rect").optional(),
|
|
17418
17470
|
portHints: portHints.optional(),
|
|
17419
17471
|
holeOffsetX: distance14.optional(),
|
|
17420
17472
|
holeOffsetY: distance14.optional(),
|
|
17421
17473
|
solderMaskMargin: distance14.optional(),
|
|
17422
|
-
coveredWithSolderMask:
|
|
17474
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17423
17475
|
}),
|
|
17424
17476
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
17425
|
-
name:
|
|
17426
|
-
connectsTo:
|
|
17427
|
-
shape:
|
|
17428
|
-
holeShape:
|
|
17429
|
-
padShape:
|
|
17477
|
+
name: z65.string().optional(),
|
|
17478
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17479
|
+
shape: z65.literal("pill_hole_with_rect_pad"),
|
|
17480
|
+
holeShape: z65.literal("pill").optional(),
|
|
17481
|
+
padShape: z65.literal("rect").optional(),
|
|
17430
17482
|
holeWidth: distance14,
|
|
17431
17483
|
holeHeight: distance14,
|
|
17432
17484
|
rectPadWidth: distance14,
|
|
@@ -17436,22 +17488,22 @@ var platedHolePropsByShape = z63.discriminatedUnion("shape", [
|
|
|
17436
17488
|
holeOffsetX: distance14.optional(),
|
|
17437
17489
|
holeOffsetY: distance14.optional(),
|
|
17438
17490
|
solderMaskMargin: distance14.optional(),
|
|
17439
|
-
coveredWithSolderMask:
|
|
17491
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17440
17492
|
}),
|
|
17441
17493
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
17442
|
-
name:
|
|
17443
|
-
connectsTo:
|
|
17444
|
-
shape:
|
|
17445
|
-
holeShape:
|
|
17494
|
+
name: z65.string().optional(),
|
|
17495
|
+
connectsTo: z65.string().or(z65.array(z65.string())).optional(),
|
|
17496
|
+
shape: z65.literal("hole_with_polygon_pad"),
|
|
17497
|
+
holeShape: z65.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
17446
17498
|
holeDiameter: distance14.optional(),
|
|
17447
17499
|
holeWidth: distance14.optional(),
|
|
17448
17500
|
holeHeight: distance14.optional(),
|
|
17449
|
-
padOutline:
|
|
17501
|
+
padOutline: z65.array(point),
|
|
17450
17502
|
holeOffsetX: distance14,
|
|
17451
17503
|
holeOffsetY: distance14,
|
|
17452
17504
|
portHints: portHints.optional(),
|
|
17453
17505
|
solderMaskMargin: distance14.optional(),
|
|
17454
|
-
coveredWithSolderMask:
|
|
17506
|
+
coveredWithSolderMask: z65.boolean().optional()
|
|
17455
17507
|
})
|
|
17456
17508
|
]).transform((a) => {
|
|
17457
17509
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -17462,7 +17514,7 @@ var platedHolePropsByShape = z63.discriminatedUnion("shape", [
|
|
|
17462
17514
|
}
|
|
17463
17515
|
return a;
|
|
17464
17516
|
});
|
|
17465
|
-
var platedHoleProps =
|
|
17517
|
+
var platedHoleProps = z65.preprocess(
|
|
17466
17518
|
inferPlatedHoleShapeAndDefaults,
|
|
17467
17519
|
platedHolePropsByShape
|
|
17468
17520
|
);
|
|
@@ -17470,7 +17522,7 @@ expectTypesMatch(true);
|
|
|
17470
17522
|
|
|
17471
17523
|
// lib/components/resistor.ts
|
|
17472
17524
|
import { resistance } from "circuit-json";
|
|
17473
|
-
import { z as
|
|
17525
|
+
import { z as z66 } from "zod";
|
|
17474
17526
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
17475
17527
|
var resistorImperialFootprintNames = /* @__PURE__ */ new Set([
|
|
17476
17528
|
"01005",
|
|
@@ -17494,7 +17546,7 @@ var resistorFootprintProp = footprintProp.optional().transform(mapResistorFootpr
|
|
|
17494
17546
|
var resistorProps = commonComponentProps.extend({
|
|
17495
17547
|
footprint: resistorFootprintProp,
|
|
17496
17548
|
resistance,
|
|
17497
|
-
tolerance:
|
|
17549
|
+
tolerance: z66.union([z66.string(), z66.number()]).transform((val) => {
|
|
17498
17550
|
if (typeof val === "string") {
|
|
17499
17551
|
if (val.endsWith("%")) {
|
|
17500
17552
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -17503,12 +17555,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
17503
17555
|
}
|
|
17504
17556
|
return val;
|
|
17505
17557
|
}).pipe(
|
|
17506
|
-
|
|
17558
|
+
z66.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
17507
17559
|
).optional(),
|
|
17508
|
-
pullupFor:
|
|
17509
|
-
pullupTo:
|
|
17510
|
-
pulldownFor:
|
|
17511
|
-
pulldownTo:
|
|
17560
|
+
pullupFor: z66.string().optional(),
|
|
17561
|
+
pullupTo: z66.string().optional(),
|
|
17562
|
+
pulldownFor: z66.string().optional(),
|
|
17563
|
+
pulldownTo: z66.string().optional(),
|
|
17512
17564
|
schOrientation: schematicOrientation.optional(),
|
|
17513
17565
|
schSize: schematicSymbolSize.optional(),
|
|
17514
17566
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -17518,18 +17570,18 @@ expectTypesMatch(true);
|
|
|
17518
17570
|
|
|
17519
17571
|
// lib/components/potentiometer.ts
|
|
17520
17572
|
import { resistance as resistance2 } from "circuit-json";
|
|
17521
|
-
import { z as
|
|
17573
|
+
import { z as z67 } from "zod";
|
|
17522
17574
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
17523
17575
|
var potentiometerProps = commonComponentProps.extend({
|
|
17524
17576
|
maxResistance: resistance2,
|
|
17525
|
-
pinVariant:
|
|
17577
|
+
pinVariant: z67.enum(["two_pin", "three_pin"]).optional(),
|
|
17526
17578
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
17527
17579
|
});
|
|
17528
17580
|
expectTypesMatch(true);
|
|
17529
17581
|
|
|
17530
17582
|
// lib/components/crystal.ts
|
|
17531
17583
|
import { capacitance, distance as distance15, frequency } from "circuit-json";
|
|
17532
|
-
import { z as
|
|
17584
|
+
import { z as z68 } from "zod";
|
|
17533
17585
|
var crystalPins = [
|
|
17534
17586
|
"pin1",
|
|
17535
17587
|
"left",
|
|
@@ -17542,8 +17594,8 @@ var crystalProps = commonComponentProps.extend({
|
|
|
17542
17594
|
frequency,
|
|
17543
17595
|
loadCapacitance: capacitance,
|
|
17544
17596
|
maxTraceLength: distance15.optional(),
|
|
17545
|
-
manufacturerPartNumber:
|
|
17546
|
-
pinVariant:
|
|
17597
|
+
manufacturerPartNumber: z68.string().optional(),
|
|
17598
|
+
pinVariant: z68.enum(["two_pin", "four_pin"]).optional(),
|
|
17547
17599
|
schOrientation: schematicOrientation.optional(),
|
|
17548
17600
|
connections: createConnectionsProp(crystalPins).optional()
|
|
17549
17601
|
});
|
|
@@ -17551,34 +17603,34 @@ expectTypesMatch(true);
|
|
|
17551
17603
|
|
|
17552
17604
|
// lib/components/resonator.ts
|
|
17553
17605
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
17554
|
-
import { z as
|
|
17606
|
+
import { z as z69 } from "zod";
|
|
17555
17607
|
var resonatorProps = commonComponentProps.extend({
|
|
17556
17608
|
frequency: frequency2,
|
|
17557
17609
|
loadCapacitance: capacitance2,
|
|
17558
|
-
pinVariant:
|
|
17610
|
+
pinVariant: z69.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
17559
17611
|
});
|
|
17560
17612
|
expectTypesMatch(true);
|
|
17561
17613
|
|
|
17562
17614
|
// lib/components/stampboard.ts
|
|
17563
17615
|
import { distance as distance16 } from "circuit-json";
|
|
17564
|
-
import { z as
|
|
17616
|
+
import { z as z70 } from "zod";
|
|
17565
17617
|
var stampboardProps = boardProps.extend({
|
|
17566
|
-
leftPinCount:
|
|
17567
|
-
rightPinCount:
|
|
17568
|
-
topPinCount:
|
|
17569
|
-
bottomPinCount:
|
|
17570
|
-
leftPins:
|
|
17571
|
-
rightPins:
|
|
17572
|
-
topPins:
|
|
17573
|
-
bottomPins:
|
|
17618
|
+
leftPinCount: z70.number().optional(),
|
|
17619
|
+
rightPinCount: z70.number().optional(),
|
|
17620
|
+
topPinCount: z70.number().optional(),
|
|
17621
|
+
bottomPinCount: z70.number().optional(),
|
|
17622
|
+
leftPins: z70.array(z70.string()).optional(),
|
|
17623
|
+
rightPins: z70.array(z70.string()).optional(),
|
|
17624
|
+
topPins: z70.array(z70.string()).optional(),
|
|
17625
|
+
bottomPins: z70.array(z70.string()).optional(),
|
|
17574
17626
|
pinPitch: distance16.optional(),
|
|
17575
|
-
innerHoles:
|
|
17627
|
+
innerHoles: z70.boolean().optional()
|
|
17576
17628
|
});
|
|
17577
17629
|
expectTypesMatch(true);
|
|
17578
17630
|
|
|
17579
17631
|
// lib/components/capacitor.ts
|
|
17580
17632
|
import { capacitance as capacitance3, distance as distance17, voltage } from "circuit-json";
|
|
17581
|
-
import { z as
|
|
17633
|
+
import { z as z71 } from "zod";
|
|
17582
17634
|
var capacitorPinLabels = [
|
|
17583
17635
|
"pin1",
|
|
17584
17636
|
"pin2",
|
|
@@ -17590,12 +17642,12 @@ var capacitorPinLabels = [
|
|
|
17590
17642
|
var capacitorProps = commonComponentProps.extend({
|
|
17591
17643
|
capacitance: capacitance3,
|
|
17592
17644
|
maxVoltageRating: voltage.optional(),
|
|
17593
|
-
schShowRatings:
|
|
17594
|
-
polarized:
|
|
17595
|
-
decouplingFor:
|
|
17596
|
-
decouplingTo:
|
|
17597
|
-
bypassFor:
|
|
17598
|
-
bypassTo:
|
|
17645
|
+
schShowRatings: z71.boolean().optional().default(false),
|
|
17646
|
+
polarized: z71.boolean().optional().default(false),
|
|
17647
|
+
decouplingFor: z71.string().optional(),
|
|
17648
|
+
decouplingTo: z71.string().optional(),
|
|
17649
|
+
bypassFor: z71.string().optional(),
|
|
17650
|
+
bypassTo: z71.string().optional(),
|
|
17599
17651
|
maxDecouplingTraceLength: distance17.optional(),
|
|
17600
17652
|
schOrientation: schematicOrientation.optional(),
|
|
17601
17653
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -17606,14 +17658,14 @@ expectTypesMatch(true);
|
|
|
17606
17658
|
|
|
17607
17659
|
// lib/components/net.ts
|
|
17608
17660
|
import { distance as distance18 } from "circuit-json";
|
|
17609
|
-
import { z as
|
|
17610
|
-
var netProps =
|
|
17611
|
-
name:
|
|
17612
|
-
connectsTo:
|
|
17613
|
-
routingPhaseIndex:
|
|
17614
|
-
highlightColor:
|
|
17615
|
-
isPowerNet:
|
|
17616
|
-
isGroundNet:
|
|
17661
|
+
import { z as z72 } from "zod";
|
|
17662
|
+
var netProps = z72.object({
|
|
17663
|
+
name: z72.string(),
|
|
17664
|
+
connectsTo: z72.string().or(z72.array(z72.string())).optional(),
|
|
17665
|
+
routingPhaseIndex: z72.number().nullable().optional(),
|
|
17666
|
+
highlightColor: z72.string().optional(),
|
|
17667
|
+
isPowerNet: z72.boolean().optional(),
|
|
17668
|
+
isGroundNet: z72.boolean().optional(),
|
|
17617
17669
|
nominalTraceWidth: distance18.optional()
|
|
17618
17670
|
});
|
|
17619
17671
|
expectTypesMatch(true);
|
|
@@ -17627,55 +17679,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
17627
17679
|
expectTypesMatch(true);
|
|
17628
17680
|
|
|
17629
17681
|
// lib/components/constrainedlayout.ts
|
|
17630
|
-
import { z as
|
|
17631
|
-
var constrainedLayoutProps =
|
|
17632
|
-
name:
|
|
17633
|
-
pcbOnly:
|
|
17634
|
-
schOnly:
|
|
17682
|
+
import { z as z74 } from "zod";
|
|
17683
|
+
var constrainedLayoutProps = z74.object({
|
|
17684
|
+
name: z74.string().optional(),
|
|
17685
|
+
pcbOnly: z74.boolean().optional(),
|
|
17686
|
+
schOnly: z74.boolean().optional()
|
|
17635
17687
|
});
|
|
17636
17688
|
expectTypesMatch(true);
|
|
17637
17689
|
|
|
17638
17690
|
// lib/components/constraint.ts
|
|
17639
|
-
import { z as
|
|
17640
|
-
var pcbXDistConstraintProps =
|
|
17641
|
-
pcb:
|
|
17691
|
+
import { z as z75 } from "zod";
|
|
17692
|
+
var pcbXDistConstraintProps = z75.object({
|
|
17693
|
+
pcb: z75.literal(true).optional(),
|
|
17642
17694
|
xDist: distance,
|
|
17643
|
-
left:
|
|
17644
|
-
right:
|
|
17645
|
-
edgeToEdge:
|
|
17646
|
-
centerToCenter:
|
|
17695
|
+
left: z75.string(),
|
|
17696
|
+
right: z75.string(),
|
|
17697
|
+
edgeToEdge: z75.literal(true).optional(),
|
|
17698
|
+
centerToCenter: z75.literal(true).optional()
|
|
17647
17699
|
});
|
|
17648
17700
|
expectTypesMatch(
|
|
17649
17701
|
true
|
|
17650
17702
|
);
|
|
17651
|
-
var pcbYDistConstraintProps =
|
|
17652
|
-
pcb:
|
|
17703
|
+
var pcbYDistConstraintProps = z75.object({
|
|
17704
|
+
pcb: z75.literal(true).optional(),
|
|
17653
17705
|
yDist: distance,
|
|
17654
|
-
top:
|
|
17655
|
-
bottom:
|
|
17656
|
-
edgeToEdge:
|
|
17657
|
-
centerToCenter:
|
|
17706
|
+
top: z75.string(),
|
|
17707
|
+
bottom: z75.string(),
|
|
17708
|
+
edgeToEdge: z75.literal(true).optional(),
|
|
17709
|
+
centerToCenter: z75.literal(true).optional()
|
|
17658
17710
|
});
|
|
17659
17711
|
expectTypesMatch(
|
|
17660
17712
|
true
|
|
17661
17713
|
);
|
|
17662
|
-
var pcbSameYConstraintProps =
|
|
17663
|
-
pcb:
|
|
17664
|
-
sameY:
|
|
17665
|
-
for:
|
|
17714
|
+
var pcbSameYConstraintProps = z75.object({
|
|
17715
|
+
pcb: z75.literal(true).optional(),
|
|
17716
|
+
sameY: z75.literal(true).optional(),
|
|
17717
|
+
for: z75.array(z75.string())
|
|
17666
17718
|
});
|
|
17667
17719
|
expectTypesMatch(
|
|
17668
17720
|
true
|
|
17669
17721
|
);
|
|
17670
|
-
var pcbSameXConstraintProps =
|
|
17671
|
-
pcb:
|
|
17672
|
-
sameX:
|
|
17673
|
-
for:
|
|
17722
|
+
var pcbSameXConstraintProps = z75.object({
|
|
17723
|
+
pcb: z75.literal(true).optional(),
|
|
17724
|
+
sameX: z75.literal(true).optional(),
|
|
17725
|
+
for: z75.array(z75.string())
|
|
17674
17726
|
});
|
|
17675
17727
|
expectTypesMatch(
|
|
17676
17728
|
true
|
|
17677
17729
|
);
|
|
17678
|
-
var constraintProps =
|
|
17730
|
+
var constraintProps = z75.union([
|
|
17679
17731
|
pcbXDistConstraintProps,
|
|
17680
17732
|
pcbYDistConstraintProps,
|
|
17681
17733
|
pcbSameYConstraintProps,
|
|
@@ -17684,13 +17736,13 @@ var constraintProps = z73.union([
|
|
|
17684
17736
|
expectTypesMatch(true);
|
|
17685
17737
|
|
|
17686
17738
|
// lib/components/cutout.ts
|
|
17687
|
-
import { z as
|
|
17739
|
+
import { z as z76 } from "zod";
|
|
17688
17740
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
17689
17741
|
layer: true,
|
|
17690
17742
|
pcbRotation: true
|
|
17691
17743
|
}).extend({
|
|
17692
|
-
name:
|
|
17693
|
-
shape:
|
|
17744
|
+
name: z76.string().optional(),
|
|
17745
|
+
shape: z76.literal("rect"),
|
|
17694
17746
|
width: distance,
|
|
17695
17747
|
height: distance
|
|
17696
17748
|
});
|
|
@@ -17699,8 +17751,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
17699
17751
|
layer: true,
|
|
17700
17752
|
pcbRotation: true
|
|
17701
17753
|
}).extend({
|
|
17702
|
-
name:
|
|
17703
|
-
shape:
|
|
17754
|
+
name: z76.string().optional(),
|
|
17755
|
+
shape: z76.literal("circle"),
|
|
17704
17756
|
radius: distance
|
|
17705
17757
|
});
|
|
17706
17758
|
expectTypesMatch(true);
|
|
@@ -17708,36 +17760,36 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
17708
17760
|
layer: true,
|
|
17709
17761
|
pcbRotation: true
|
|
17710
17762
|
}).extend({
|
|
17711
|
-
name:
|
|
17712
|
-
shape:
|
|
17713
|
-
points:
|
|
17763
|
+
name: z76.string().optional(),
|
|
17764
|
+
shape: z76.literal("polygon"),
|
|
17765
|
+
points: z76.array(point)
|
|
17714
17766
|
});
|
|
17715
17767
|
expectTypesMatch(true);
|
|
17716
|
-
var cutoutProps =
|
|
17768
|
+
var cutoutProps = z76.discriminatedUnion("shape", [
|
|
17717
17769
|
rectCutoutProps,
|
|
17718
17770
|
circleCutoutProps,
|
|
17719
17771
|
polygonCutoutProps
|
|
17720
17772
|
]);
|
|
17721
17773
|
|
|
17722
17774
|
// lib/components/drc-check.ts
|
|
17723
|
-
import { z as
|
|
17724
|
-
var drcCheckProps =
|
|
17725
|
-
name:
|
|
17775
|
+
import { z as z77 } from "zod";
|
|
17776
|
+
var drcCheckProps = z77.object({
|
|
17777
|
+
name: z77.string().optional(),
|
|
17726
17778
|
checkFn: customDrcCheckFn
|
|
17727
17779
|
});
|
|
17728
17780
|
expectTypesMatch(true);
|
|
17729
17781
|
|
|
17730
17782
|
// lib/components/smtpad.ts
|
|
17731
|
-
import { z as
|
|
17783
|
+
import { z as z78 } from "zod";
|
|
17732
17784
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17733
|
-
name:
|
|
17734
|
-
shape:
|
|
17785
|
+
name: z78.string().optional(),
|
|
17786
|
+
shape: z78.literal("rect"),
|
|
17735
17787
|
width: distance,
|
|
17736
17788
|
height: distance,
|
|
17737
17789
|
rectBorderRadius: distance.optional(),
|
|
17738
17790
|
cornerRadius: distance.optional(),
|
|
17739
17791
|
portHints: portHints.optional(),
|
|
17740
|
-
coveredWithSolderMask:
|
|
17792
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17741
17793
|
solderMaskMargin: distance.optional(),
|
|
17742
17794
|
solderMaskMarginLeft: distance.optional(),
|
|
17743
17795
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17747,14 +17799,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17747
17799
|
});
|
|
17748
17800
|
expectTypesMatch(true);
|
|
17749
17801
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17750
|
-
name:
|
|
17751
|
-
shape:
|
|
17802
|
+
name: z78.string().optional(),
|
|
17803
|
+
shape: z78.literal("rotated_rect"),
|
|
17752
17804
|
width: distance,
|
|
17753
17805
|
height: distance,
|
|
17754
|
-
ccwRotation:
|
|
17806
|
+
ccwRotation: z78.number(),
|
|
17755
17807
|
cornerRadius: distance.optional(),
|
|
17756
17808
|
portHints: portHints.optional(),
|
|
17757
|
-
coveredWithSolderMask:
|
|
17809
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17758
17810
|
solderMaskMargin: distance.optional(),
|
|
17759
17811
|
solderMaskMarginLeft: distance.optional(),
|
|
17760
17812
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -17764,51 +17816,51 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
17764
17816
|
});
|
|
17765
17817
|
expectTypesMatch(true);
|
|
17766
17818
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17767
|
-
name:
|
|
17768
|
-
shape:
|
|
17819
|
+
name: z78.string().optional(),
|
|
17820
|
+
shape: z78.literal("circle"),
|
|
17769
17821
|
radius: distance,
|
|
17770
17822
|
portHints: portHints.optional(),
|
|
17771
|
-
coveredWithSolderMask:
|
|
17823
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17772
17824
|
solderMaskMargin: distance.optional(),
|
|
17773
17825
|
solderPasteMargin: distance.optional()
|
|
17774
17826
|
});
|
|
17775
17827
|
expectTypesMatch(true);
|
|
17776
17828
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17777
|
-
name:
|
|
17778
|
-
shape:
|
|
17829
|
+
name: z78.string().optional(),
|
|
17830
|
+
shape: z78.literal("pill"),
|
|
17779
17831
|
width: distance,
|
|
17780
17832
|
height: distance,
|
|
17781
17833
|
radius: distance,
|
|
17782
17834
|
portHints: portHints.optional(),
|
|
17783
|
-
coveredWithSolderMask:
|
|
17835
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17784
17836
|
solderMaskMargin: distance.optional(),
|
|
17785
17837
|
solderPasteMargin: distance.optional()
|
|
17786
17838
|
});
|
|
17787
17839
|
expectTypesMatch(true);
|
|
17788
17840
|
var rotatedPillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17789
|
-
name:
|
|
17790
|
-
shape:
|
|
17841
|
+
name: z78.string().optional(),
|
|
17842
|
+
shape: z78.literal("rotated_pill"),
|
|
17791
17843
|
width: distance,
|
|
17792
17844
|
height: distance,
|
|
17793
17845
|
radius: distance,
|
|
17794
|
-
ccwRotation:
|
|
17846
|
+
ccwRotation: z78.number(),
|
|
17795
17847
|
portHints: portHints.optional(),
|
|
17796
|
-
coveredWithSolderMask:
|
|
17848
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17797
17849
|
solderMaskMargin: distance.optional(),
|
|
17798
17850
|
solderPasteMargin: distance.optional()
|
|
17799
17851
|
});
|
|
17800
17852
|
expectTypesMatch(true);
|
|
17801
17853
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17802
|
-
name:
|
|
17803
|
-
shape:
|
|
17804
|
-
points:
|
|
17854
|
+
name: z78.string().optional(),
|
|
17855
|
+
shape: z78.literal("polygon"),
|
|
17856
|
+
points: z78.array(point),
|
|
17805
17857
|
portHints: portHints.optional(),
|
|
17806
|
-
coveredWithSolderMask:
|
|
17858
|
+
coveredWithSolderMask: z78.boolean().optional(),
|
|
17807
17859
|
solderMaskMargin: distance.optional(),
|
|
17808
17860
|
solderPasteMargin: distance.optional()
|
|
17809
17861
|
});
|
|
17810
17862
|
expectTypesMatch(true);
|
|
17811
|
-
var smtPadProps =
|
|
17863
|
+
var smtPadProps = z78.discriminatedUnion("shape", [
|
|
17812
17864
|
circleSmtPadProps,
|
|
17813
17865
|
rectSmtPadProps,
|
|
17814
17866
|
rotatedRectSmtPadProps,
|
|
@@ -17819,63 +17871,63 @@ var smtPadProps = z76.discriminatedUnion("shape", [
|
|
|
17819
17871
|
expectTypesMatch(true);
|
|
17820
17872
|
|
|
17821
17873
|
// lib/components/solderpaste.ts
|
|
17822
|
-
import { z as
|
|
17874
|
+
import { z as z79 } from "zod";
|
|
17823
17875
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17824
|
-
shape:
|
|
17876
|
+
shape: z79.literal("rect"),
|
|
17825
17877
|
width: distance,
|
|
17826
17878
|
height: distance
|
|
17827
17879
|
});
|
|
17828
17880
|
expectTypesMatch(true);
|
|
17829
17881
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
17830
|
-
shape:
|
|
17882
|
+
shape: z79.literal("circle"),
|
|
17831
17883
|
radius: distance
|
|
17832
17884
|
});
|
|
17833
17885
|
expectTypesMatch(true);
|
|
17834
|
-
var solderPasteProps =
|
|
17886
|
+
var solderPasteProps = z79.union([
|
|
17835
17887
|
circleSolderPasteProps,
|
|
17836
17888
|
rectSolderPasteProps
|
|
17837
17889
|
]);
|
|
17838
17890
|
expectTypesMatch(true);
|
|
17839
17891
|
|
|
17840
17892
|
// lib/components/hole.ts
|
|
17841
|
-
import { z as
|
|
17893
|
+
import { z as z80 } from "zod";
|
|
17842
17894
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
17843
|
-
name:
|
|
17844
|
-
shape:
|
|
17895
|
+
name: z80.string().optional(),
|
|
17896
|
+
shape: z80.literal("circle").optional(),
|
|
17845
17897
|
diameter: distance.optional(),
|
|
17846
17898
|
radius: distance.optional(),
|
|
17847
17899
|
solderMaskMargin: distance.optional(),
|
|
17848
|
-
coveredWithSolderMask:
|
|
17900
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17849
17901
|
}).transform((d) => ({
|
|
17850
17902
|
...d,
|
|
17851
17903
|
diameter: d.diameter ?? 2 * d.radius,
|
|
17852
17904
|
radius: d.radius ?? d.diameter / 2
|
|
17853
17905
|
}));
|
|
17854
17906
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
17855
|
-
name:
|
|
17856
|
-
shape:
|
|
17907
|
+
name: z80.string().optional(),
|
|
17908
|
+
shape: z80.literal("pill"),
|
|
17857
17909
|
width: distance,
|
|
17858
17910
|
height: distance,
|
|
17859
17911
|
solderMaskMargin: distance.optional(),
|
|
17860
|
-
coveredWithSolderMask:
|
|
17912
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17861
17913
|
});
|
|
17862
17914
|
var ovalHoleProps = pcbLayoutProps.extend({
|
|
17863
|
-
name:
|
|
17864
|
-
shape:
|
|
17915
|
+
name: z80.string().optional(),
|
|
17916
|
+
shape: z80.literal("oval"),
|
|
17865
17917
|
width: distance,
|
|
17866
17918
|
height: distance,
|
|
17867
17919
|
solderMaskMargin: distance.optional(),
|
|
17868
|
-
coveredWithSolderMask:
|
|
17920
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17869
17921
|
});
|
|
17870
17922
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
17871
|
-
name:
|
|
17872
|
-
shape:
|
|
17923
|
+
name: z80.string().optional(),
|
|
17924
|
+
shape: z80.literal("rect"),
|
|
17873
17925
|
width: distance,
|
|
17874
17926
|
height: distance,
|
|
17875
17927
|
solderMaskMargin: distance.optional(),
|
|
17876
|
-
coveredWithSolderMask:
|
|
17928
|
+
coveredWithSolderMask: z80.boolean().optional()
|
|
17877
17929
|
});
|
|
17878
|
-
var holeProps =
|
|
17930
|
+
var holeProps = z80.union([
|
|
17879
17931
|
circleHoleProps,
|
|
17880
17932
|
pillHoleProps,
|
|
17881
17933
|
ovalHoleProps,
|
|
@@ -17884,7 +17936,7 @@ var holeProps = z78.union([
|
|
|
17884
17936
|
expectTypesMatch(true);
|
|
17885
17937
|
|
|
17886
17938
|
// lib/components/antenna.ts
|
|
17887
|
-
import { z as
|
|
17939
|
+
import { z as z81 } from "zod";
|
|
17888
17940
|
var antennaShapes = [
|
|
17889
17941
|
"2.4ghz_quarter_wave_monopole",
|
|
17890
17942
|
"2.4ghz_meandered_monopole",
|
|
@@ -17892,7 +17944,7 @@ var antennaShapes = [
|
|
|
17892
17944
|
"2.4ghz_meandered_inverted_f",
|
|
17893
17945
|
"2.4ghz_folded_dipole"
|
|
17894
17946
|
];
|
|
17895
|
-
var antennaShape =
|
|
17947
|
+
var antennaShape = z81.enum(antennaShapes);
|
|
17896
17948
|
var antennaFrequencyBands = [
|
|
17897
17949
|
"2.4ghz",
|
|
17898
17950
|
"5ghz",
|
|
@@ -17900,7 +17952,7 @@ var antennaFrequencyBands = [
|
|
|
17900
17952
|
"dual_band_2.4ghz_5ghz",
|
|
17901
17953
|
"tri_band_2.4ghz_5ghz_6ghz"
|
|
17902
17954
|
];
|
|
17903
|
-
var antennaFrequencyBand =
|
|
17955
|
+
var antennaFrequencyBand = z81.enum(antennaFrequencyBands);
|
|
17904
17956
|
var antennaProps = commonComponentProps.extend({
|
|
17905
17957
|
antennaShape: antennaShape.optional(),
|
|
17906
17958
|
frequencyBand: antennaFrequencyBand.optional(),
|
|
@@ -17910,39 +17962,39 @@ expectTypesMatch(true);
|
|
|
17910
17962
|
|
|
17911
17963
|
// lib/components/trace.ts
|
|
17912
17964
|
import { distance as distance19, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
17913
|
-
import { z as
|
|
17914
|
-
var portRef =
|
|
17915
|
-
|
|
17916
|
-
|
|
17965
|
+
import { z as z82 } from "zod";
|
|
17966
|
+
var portRef = z82.union([
|
|
17967
|
+
z82.string(),
|
|
17968
|
+
z82.custom(
|
|
17917
17969
|
(v) => typeof v === "object" && v !== null && "getPortSelector" in v && typeof v.getPortSelector === "function"
|
|
17918
17970
|
)
|
|
17919
17971
|
]);
|
|
17920
|
-
var baseTraceProps =
|
|
17921
|
-
key:
|
|
17922
|
-
name:
|
|
17923
|
-
displayName:
|
|
17972
|
+
var baseTraceProps = z82.object({
|
|
17973
|
+
key: z82.string().optional(),
|
|
17974
|
+
name: z82.string().optional(),
|
|
17975
|
+
displayName: z82.string().optional(),
|
|
17924
17976
|
thickness: distance19.optional(),
|
|
17925
17977
|
width: distance19.optional().describe("Alias for trace thickness"),
|
|
17926
|
-
schematicRouteHints:
|
|
17927
|
-
pcbRouteHints:
|
|
17928
|
-
pcbTeardrops:
|
|
17929
|
-
pcbTeardropStart:
|
|
17930
|
-
pcbTeardropEnd:
|
|
17931
|
-
pcbPathRelativeTo:
|
|
17978
|
+
schematicRouteHints: z82.array(point).optional(),
|
|
17979
|
+
pcbRouteHints: z82.array(route_hint_point2).optional(),
|
|
17980
|
+
pcbTeardrops: z82.boolean().optional().describe("Enable PCB trace teardrops."),
|
|
17981
|
+
pcbTeardropStart: z82.boolean().optional().describe("Teardrop at the start (from) of trace"),
|
|
17982
|
+
pcbTeardropEnd: z82.boolean().optional().describe("Teardrop at the end (to) of trace"),
|
|
17983
|
+
pcbPathRelativeTo: z82.string().optional(),
|
|
17932
17984
|
pcbPath: pcbPath.optional(),
|
|
17933
|
-
pcbPaths:
|
|
17934
|
-
routingPhaseIndex:
|
|
17935
|
-
pcbStraightLine:
|
|
17936
|
-
schDisplayLabel:
|
|
17937
|
-
schStroke:
|
|
17938
|
-
highlightColor:
|
|
17985
|
+
pcbPaths: z82.array(pcbPath).optional(),
|
|
17986
|
+
routingPhaseIndex: z82.number().nullable().optional(),
|
|
17987
|
+
pcbStraightLine: z82.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
17988
|
+
schDisplayLabel: z82.string().optional(),
|
|
17989
|
+
schStroke: z82.string().optional(),
|
|
17990
|
+
highlightColor: z82.string().optional(),
|
|
17939
17991
|
maxLength: distance19.optional(),
|
|
17940
|
-
maxViaCount:
|
|
17941
|
-
connectsTo:
|
|
17992
|
+
maxViaCount: z82.number().int().nonnegative().optional().describe("Maximum number of vias allowed in the PCB trace route"),
|
|
17993
|
+
connectsTo: z82.string().or(z82.array(z82.string())).optional()
|
|
17942
17994
|
});
|
|
17943
|
-
var traceProps =
|
|
17995
|
+
var traceProps = z82.union([
|
|
17944
17996
|
baseTraceProps.extend({
|
|
17945
|
-
path:
|
|
17997
|
+
path: z82.array(portRef)
|
|
17946
17998
|
}),
|
|
17947
17999
|
baseTraceProps.extend({
|
|
17948
18000
|
from: portRef,
|
|
@@ -17956,29 +18008,29 @@ var traceProps = z80.union([
|
|
|
17956
18008
|
|
|
17957
18009
|
// lib/common/routeLength.ts
|
|
17958
18010
|
import { distance as distance20 } from "circuit-json";
|
|
17959
|
-
import { z as
|
|
18011
|
+
import { z as z83 } from "zod";
|
|
17960
18012
|
var nonnegativeRouteDistance = distance20.pipe(
|
|
17961
|
-
|
|
18013
|
+
z83.number().nonnegative().finite()
|
|
17962
18014
|
);
|
|
17963
|
-
var routeLength =
|
|
18015
|
+
var routeLength = z83.union([
|
|
17964
18016
|
nonnegativeRouteDistance,
|
|
17965
|
-
|
|
17966
|
-
reference:
|
|
17967
|
-
of:
|
|
17968
|
-
offset: distance20.pipe(
|
|
18017
|
+
z83.object({
|
|
18018
|
+
reference: z83.literal("longest_manhattan"),
|
|
18019
|
+
of: z83.array(z83.string().min(1)).min(1).optional(),
|
|
18020
|
+
offset: distance20.pipe(z83.number().finite()).optional()
|
|
17969
18021
|
}).strict()
|
|
17970
18022
|
]);
|
|
17971
18023
|
expectTypesMatch(true);
|
|
17972
18024
|
function validateRouteLengths(props, ctx) {
|
|
17973
18025
|
if (Boolean(props.targetLength !== void 0) !== Boolean(props.lengthTolerance !== void 0))
|
|
17974
18026
|
ctx.addIssue({
|
|
17975
|
-
code:
|
|
18027
|
+
code: z83.ZodIssueCode.custom,
|
|
17976
18028
|
path: ["lengthTolerance"],
|
|
17977
18029
|
message: "targetLength and lengthTolerance must be supplied together"
|
|
17978
18030
|
});
|
|
17979
18031
|
if (props.lengthMatchTo !== void 0 && props.maxLengthSkew === void 0)
|
|
17980
18032
|
ctx.addIssue({
|
|
17981
|
-
code:
|
|
18033
|
+
code: z83.ZodIssueCode.custom,
|
|
17982
18034
|
path: ["maxLengthSkew"],
|
|
17983
18035
|
message: "lengthMatchTo requires an explicit maxLengthSkew"
|
|
17984
18036
|
});
|
|
@@ -17994,61 +18046,61 @@ function validateRouteLengths(props, ctx) {
|
|
|
17994
18046
|
const target = props.targetLength === void 0 ? void 0 : comparable(props.targetLength);
|
|
17995
18047
|
if (min && max && min.basis === max.basis && min.amount > max.amount)
|
|
17996
18048
|
ctx.addIssue({
|
|
17997
|
-
code:
|
|
18049
|
+
code: z83.ZodIssueCode.custom,
|
|
17998
18050
|
path: ["maxLength"],
|
|
17999
18051
|
message: "maxLength cannot be below minLength for the same reference"
|
|
18000
18052
|
});
|
|
18001
18053
|
if (target && min && target.basis === min.basis && target.amount + (props.lengthTolerance ?? 0) < min.amount || target && max && target.basis === max.basis && target.amount - (props.lengthTolerance ?? 0) > max.amount)
|
|
18002
18054
|
ctx.addIssue({
|
|
18003
|
-
code:
|
|
18055
|
+
code: z83.ZodIssueCode.custom,
|
|
18004
18056
|
path: ["targetLength"],
|
|
18005
18057
|
message: "targetLength tolerance window does not intersect the declared length bounds"
|
|
18006
18058
|
});
|
|
18007
18059
|
}
|
|
18008
|
-
var lengthMatchTo =
|
|
18009
|
-
|
|
18010
|
-
|
|
18060
|
+
var lengthMatchTo = z83.union([
|
|
18061
|
+
z83.string().min(1),
|
|
18062
|
+
z83.array(z83.string().min(1)).min(1)
|
|
18011
18063
|
]);
|
|
18012
18064
|
|
|
18013
18065
|
// lib/common/traceSpacing.ts
|
|
18014
18066
|
import { distance as distance21 } from "circuit-json";
|
|
18015
|
-
import { z as
|
|
18016
|
-
var widthSpacing =
|
|
18067
|
+
import { z as z84 } from "zod";
|
|
18068
|
+
var widthSpacing = z84.string().regex(/^\s*(?:\d+(?:\.\d*)?|\.\d+)(?:[eE][+-]?\d+)?\s*w\s*$/i).transform((value) => ({
|
|
18017
18069
|
widthMultiplier: Number(value.trim().replace(/w$/i, ""))
|
|
18018
|
-
})).pipe(
|
|
18019
|
-
var absoluteSpacing = distance21.pipe(
|
|
18020
|
-
var traceSpacing =
|
|
18070
|
+
})).pipe(z84.object({ widthMultiplier: z84.number().positive().finite() }));
|
|
18071
|
+
var absoluteSpacing = distance21.pipe(z84.number().positive().finite());
|
|
18072
|
+
var traceSpacing = z84.union([widthSpacing, absoluteSpacing]);
|
|
18021
18073
|
expectTypesMatch(true);
|
|
18022
18074
|
|
|
18023
18075
|
// lib/common/impedanceTarget.ts
|
|
18024
18076
|
import { resistance as resistance3 } from "circuit-json";
|
|
18025
|
-
import { z as
|
|
18026
|
-
var positiveImpedance =
|
|
18027
|
-
|
|
18028
|
-
|
|
18077
|
+
import { z as z85 } from "zod";
|
|
18078
|
+
var positiveImpedance = z85.union([
|
|
18079
|
+
z85.number(),
|
|
18080
|
+
z85.string().refine(
|
|
18029
18081
|
(value) => !/(?:±|\+\/-)/.test(value),
|
|
18030
18082
|
"Use a scalar impedance for explicit bounds"
|
|
18031
18083
|
)
|
|
18032
|
-
]).pipe(resistance3).pipe(
|
|
18084
|
+
]).pipe(resistance3).pipe(z85.number().positive().finite());
|
|
18033
18085
|
var quantity = /^([+-]?(?:\d+(?:\.\d*)?|\.\d+)(?:e[+-]?\d+)?)\s*(.*?)$/i;
|
|
18034
|
-
var tolerantImpedance =
|
|
18086
|
+
var tolerantImpedance = z85.string().regex(/(?:±|\+\/-)/).transform((value, ctx) => {
|
|
18035
18087
|
const parts = value.trim().split(/\s*(?:±|\+\/-)\s*/);
|
|
18036
18088
|
const nominal = parts.length === 2 ? parts[0].match(quantity) : null;
|
|
18037
18089
|
const tolerance = parts.length === 2 ? parts[1].match(quantity) : null;
|
|
18038
18090
|
if (!nominal || !tolerance) {
|
|
18039
18091
|
ctx.addIssue({
|
|
18040
|
-
code:
|
|
18092
|
+
code: z85.ZodIssueCode.custom,
|
|
18041
18093
|
message: "Use a nominal impedance \xB1 an absolute ohm tolerance"
|
|
18042
18094
|
});
|
|
18043
|
-
return
|
|
18095
|
+
return z85.NEVER;
|
|
18044
18096
|
}
|
|
18045
18097
|
const ohmUnit = /^(?:[yzafpnumkKMGTPEZYµμ])?(?:ohms?|Ω)$/i;
|
|
18046
18098
|
if (nominal[2] && !ohmUnit.test(nominal[2]) || tolerance[2] && !ohmUnit.test(tolerance[2])) {
|
|
18047
18099
|
ctx.addIssue({
|
|
18048
|
-
code:
|
|
18100
|
+
code: z85.ZodIssueCode.custom,
|
|
18049
18101
|
message: "Use an absolute ohm tolerance, not a percentage or another unit"
|
|
18050
18102
|
});
|
|
18051
|
-
return
|
|
18103
|
+
return z85.NEVER;
|
|
18052
18104
|
}
|
|
18053
18105
|
const nominalValue = resistance3.safeParse(
|
|
18054
18106
|
`${nominal[1]}${nominal[2] || tolerance[2] || "ohm"}`
|
|
@@ -18058,10 +18110,10 @@ var tolerantImpedance = z83.string().regex(/(?:±|\+\/-)/).transform((value, ctx
|
|
|
18058
18110
|
);
|
|
18059
18111
|
if (!nominalValue.success || !toleranceValue.success || !Number.isFinite(nominalValue.data) || !Number.isFinite(toleranceValue.data) || nominalValue.data <= 0 || toleranceValue.data < 0) {
|
|
18060
18112
|
ctx.addIssue({
|
|
18061
|
-
code:
|
|
18113
|
+
code: z85.ZodIssueCode.custom,
|
|
18062
18114
|
message: "Nominal impedance must be positive and tolerance nonnegative, in ohms"
|
|
18063
18115
|
});
|
|
18064
|
-
return
|
|
18116
|
+
return z85.NEVER;
|
|
18065
18117
|
}
|
|
18066
18118
|
return {
|
|
18067
18119
|
nominal: nominalValue.data,
|
|
@@ -18069,19 +18121,19 @@ var tolerantImpedance = z83.string().regex(/(?:±|\+\/-)/).transform((value, ctx
|
|
|
18069
18121
|
max: nominalValue.data + toleranceValue.data
|
|
18070
18122
|
};
|
|
18071
18123
|
}).pipe(
|
|
18072
|
-
|
|
18073
|
-
nominal:
|
|
18074
|
-
min:
|
|
18075
|
-
max:
|
|
18124
|
+
z85.object({
|
|
18125
|
+
nominal: z85.number().positive().finite(),
|
|
18126
|
+
min: z85.number().positive().finite(),
|
|
18127
|
+
max: z85.number().positive().finite()
|
|
18076
18128
|
})
|
|
18077
18129
|
);
|
|
18078
18130
|
var scalarImpedance = positiveImpedance;
|
|
18079
|
-
var impedanceTarget =
|
|
18131
|
+
var impedanceTarget = z85.union([tolerantImpedance, scalarImpedance]);
|
|
18080
18132
|
expectTypesMatch(true);
|
|
18081
18133
|
function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
18082
18134
|
if (min !== void 0 && max !== void 0 && min > max)
|
|
18083
18135
|
ctx.addIssue({
|
|
18084
|
-
code:
|
|
18136
|
+
code: z85.ZodIssueCode.custom,
|
|
18085
18137
|
path: [`${propName}Max`],
|
|
18086
18138
|
message: "Maximum impedance cannot be below minimum impedance"
|
|
18087
18139
|
});
|
|
@@ -18092,13 +18144,13 @@ function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
|
18092
18144
|
])
|
|
18093
18145
|
if (explicit !== void 0 && Math.abs(explicit - derived) > 1e-9 * Math.max(1, Math.abs(derived)))
|
|
18094
18146
|
ctx.addIssue({
|
|
18095
|
-
code:
|
|
18147
|
+
code: z85.ZodIssueCode.custom,
|
|
18096
18148
|
path: [`${propName}${suffix}`],
|
|
18097
18149
|
message: "Explicit impedance bound conflicts with the target tolerance"
|
|
18098
18150
|
});
|
|
18099
18151
|
} else if (target !== void 0 && (min !== void 0 && target < min || max !== void 0 && target > max))
|
|
18100
18152
|
ctx.addIssue({
|
|
18101
|
-
code:
|
|
18153
|
+
code: z85.ZodIssueCode.custom,
|
|
18102
18154
|
path: [propName],
|
|
18103
18155
|
message: "Target impedance must lie within its declared bounds"
|
|
18104
18156
|
});
|
|
@@ -18106,9 +18158,9 @@ function validateImpedanceTarget(target, min, max, ctx, propName) {
|
|
|
18106
18158
|
|
|
18107
18159
|
// lib/components/bus.ts
|
|
18108
18160
|
import { distance as distance22, layer_ref as layer_ref7 } from "circuit-json";
|
|
18109
|
-
import { z as
|
|
18110
|
-
var busProps =
|
|
18111
|
-
name:
|
|
18161
|
+
import { z as z86 } from "zod";
|
|
18162
|
+
var busProps = z86.object({
|
|
18163
|
+
name: z86.string().optional(),
|
|
18112
18164
|
lengthMatchTo: lengthMatchTo.optional(),
|
|
18113
18165
|
minLength: routeLength.optional(),
|
|
18114
18166
|
maxLength: routeLength.optional(),
|
|
@@ -18116,16 +18168,16 @@ var busProps = z84.object({
|
|
|
18116
18168
|
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18117
18169
|
pcbTraceSpacing: traceSpacing.optional(),
|
|
18118
18170
|
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18119
|
-
connections:
|
|
18120
|
-
routingPhaseIndex:
|
|
18121
|
-
maxLengthSkew: distance22.pipe(
|
|
18171
|
+
connections: z86.array(z86.string()).min(1),
|
|
18172
|
+
routingPhaseIndex: z86.number().nullable().optional(),
|
|
18173
|
+
maxLengthSkew: distance22.pipe(z86.number().min(0).finite()).optional(),
|
|
18122
18174
|
targetImpedance: impedanceTarget.optional(),
|
|
18123
18175
|
targetImpedanceMin: positiveImpedance.optional(),
|
|
18124
18176
|
targetImpedanceMax: positiveImpedance.optional(),
|
|
18125
|
-
pcbTraceWidth: distance22.pipe(
|
|
18126
|
-
pcbAllowedLayers:
|
|
18177
|
+
pcbTraceWidth: distance22.pipe(z86.number().positive().finite()).optional(),
|
|
18178
|
+
pcbAllowedLayers: z86.array(layer_ref7).min(1).optional(),
|
|
18127
18179
|
preferredLayer: layer_ref7.optional(),
|
|
18128
|
-
preferredLayers:
|
|
18180
|
+
preferredLayers: z86.array(layer_ref7).min(1).optional()
|
|
18129
18181
|
}).superRefine((props, ctx) => {
|
|
18130
18182
|
validateRouteLengths(props, ctx);
|
|
18131
18183
|
validateImpedanceTarget(
|
|
@@ -18155,23 +18207,23 @@ expectTypesMatch(true);
|
|
|
18155
18207
|
|
|
18156
18208
|
// lib/components/differentialpair.ts
|
|
18157
18209
|
import { distance as distance23 } from "circuit-json";
|
|
18158
|
-
import { z as
|
|
18159
|
-
var differentialPairProps =
|
|
18160
|
-
name:
|
|
18210
|
+
import { z as z87 } from "zod";
|
|
18211
|
+
var differentialPairProps = z87.object({
|
|
18212
|
+
name: z87.string().optional(),
|
|
18161
18213
|
lengthMatchTo: lengthMatchTo.optional(),
|
|
18162
18214
|
minLength: routeLength.optional(),
|
|
18163
18215
|
maxLength: routeLength.optional(),
|
|
18164
18216
|
targetLength: routeLength.optional(),
|
|
18165
18217
|
lengthTolerance: nonnegativeRouteDistance.optional(),
|
|
18166
18218
|
pcbSpacingToOtherSignals: traceSpacing.optional(),
|
|
18167
|
-
positiveConnection:
|
|
18168
|
-
negativeConnection:
|
|
18169
|
-
maxLengthSkew: distance23.pipe(
|
|
18219
|
+
positiveConnection: z87.string(),
|
|
18220
|
+
negativeConnection: z87.string(),
|
|
18221
|
+
maxLengthSkew: distance23.pipe(z87.number().min(0).finite()).optional(),
|
|
18170
18222
|
targetDifferentialImpedance: impedanceTarget.optional(),
|
|
18171
18223
|
targetDifferentialImpedanceMin: positiveImpedance.optional(),
|
|
18172
18224
|
targetDifferentialImpedanceMax: positiveImpedance.optional(),
|
|
18173
|
-
pcbTraceGap: distance23.pipe(
|
|
18174
|
-
maxUncoupledLength: distance23.pipe(
|
|
18225
|
+
pcbTraceGap: distance23.pipe(z87.number().positive().finite()).optional(),
|
|
18226
|
+
maxUncoupledLength: distance23.pipe(z87.number().min(0).finite()).optional()
|
|
18175
18227
|
}).superRefine((props, ctx) => {
|
|
18176
18228
|
validateRouteLengths(props, ctx);
|
|
18177
18229
|
validateImpedanceTarget(
|
|
@@ -18203,8 +18255,8 @@ expectTypesMatch(true);
|
|
|
18203
18255
|
import {
|
|
18204
18256
|
layer_ref as layer_ref8
|
|
18205
18257
|
} from "circuit-json";
|
|
18206
|
-
import { z as
|
|
18207
|
-
var footprintInsertionDirection =
|
|
18258
|
+
import { z as z88 } from "zod";
|
|
18259
|
+
var footprintInsertionDirection = z88.enum([
|
|
18208
18260
|
"from_left",
|
|
18209
18261
|
"from_right",
|
|
18210
18262
|
"from_top",
|
|
@@ -18222,11 +18274,11 @@ var footprintInsertionDirection = z86.enum([
|
|
|
18222
18274
|
"from_back"
|
|
18223
18275
|
]);
|
|
18224
18276
|
expectTypesMatch(true);
|
|
18225
|
-
var footprintProps =
|
|
18226
|
-
children:
|
|
18227
|
-
name:
|
|
18277
|
+
var footprintProps = z88.object({
|
|
18278
|
+
children: z88.any().optional(),
|
|
18279
|
+
name: z88.string().optional(),
|
|
18228
18280
|
originalLayer: layer_ref8.default("top").optional(),
|
|
18229
|
-
circuitJson:
|
|
18281
|
+
circuitJson: z88.array(z88.any()).optional(),
|
|
18230
18282
|
src: footprintProp.describe("Can be a footprint or kicad string").optional(),
|
|
18231
18283
|
insertionDirection: footprintInsertionDirection.optional().describe(
|
|
18232
18284
|
"Direction a cable or mating part is attached from, named for the side of the footprint it approaches from, in its unrotated orientation."
|
|
@@ -18238,19 +18290,19 @@ var footprintProps = z86.object({
|
|
|
18238
18290
|
expectTypesMatch(true);
|
|
18239
18291
|
|
|
18240
18292
|
// lib/components/symbol.ts
|
|
18241
|
-
import { z as
|
|
18242
|
-
var symbolProps =
|
|
18243
|
-
originalFacingDirection:
|
|
18293
|
+
import { z as z89 } from "zod";
|
|
18294
|
+
var symbolProps = z89.object({
|
|
18295
|
+
originalFacingDirection: z89.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
18244
18296
|
width: distance.optional(),
|
|
18245
18297
|
height: distance.optional(),
|
|
18246
|
-
name:
|
|
18298
|
+
name: z89.string().optional()
|
|
18247
18299
|
});
|
|
18248
18300
|
expectTypesMatch(true);
|
|
18249
18301
|
|
|
18250
18302
|
// lib/components/battery.ts
|
|
18251
18303
|
import { voltage as voltage2 } from "circuit-json";
|
|
18252
|
-
import { z as
|
|
18253
|
-
var capacity =
|
|
18304
|
+
import { z as z90 } from "zod";
|
|
18305
|
+
var capacity = z90.number().or(z90.string().endsWith("mAh")).transform((v) => {
|
|
18254
18306
|
if (typeof v === "string") {
|
|
18255
18307
|
const valString = v.replace("mAh", "");
|
|
18256
18308
|
const num = Number.parseFloat(valString);
|
|
@@ -18265,14 +18317,14 @@ var batteryPins = lrPolarPins;
|
|
|
18265
18317
|
var batteryProps = commonComponentProps.extend({
|
|
18266
18318
|
capacity: capacity.optional(),
|
|
18267
18319
|
voltage: voltage2.optional(),
|
|
18268
|
-
standard:
|
|
18320
|
+
standard: z90.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
18269
18321
|
schOrientation: schematicOrientation.optional(),
|
|
18270
18322
|
connections: createConnectionsProp(batteryPins).optional()
|
|
18271
18323
|
});
|
|
18272
18324
|
expectTypesMatch(true);
|
|
18273
18325
|
|
|
18274
18326
|
// lib/components/mountedboard.ts
|
|
18275
|
-
import { z as
|
|
18327
|
+
import { z as z91 } from "zod";
|
|
18276
18328
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
18277
18329
|
mpn: chipProps.shape.mpn,
|
|
18278
18330
|
mfn: chipProps.shape.mfn,
|
|
@@ -18286,7 +18338,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
18286
18338
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
18287
18339
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
18288
18340
|
boardToBoardDistance: distance.optional(),
|
|
18289
|
-
mountOrientation:
|
|
18341
|
+
mountOrientation: z91.enum(["faceDown", "faceUp"]).optional()
|
|
18290
18342
|
});
|
|
18291
18343
|
expectTypesMatch(true);
|
|
18292
18344
|
|
|
@@ -18294,40 +18346,40 @@ expectTypesMatch(true);
|
|
|
18294
18346
|
import { distance as distance24 } from "circuit-json";
|
|
18295
18347
|
|
|
18296
18348
|
// lib/common/pcbOrientation.ts
|
|
18297
|
-
import { z as
|
|
18298
|
-
var pcbOrientation =
|
|
18349
|
+
import { z as z92 } from "zod";
|
|
18350
|
+
var pcbOrientation = z92.enum(["vertical", "horizontal"]).describe(
|
|
18299
18351
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
18300
18352
|
);
|
|
18301
18353
|
expectTypesMatch(true);
|
|
18302
18354
|
|
|
18303
18355
|
// lib/components/pin-header.ts
|
|
18304
|
-
import { z as
|
|
18356
|
+
import { z as z93 } from "zod";
|
|
18305
18357
|
var pinHeaderProps = commonComponentProps.extend({
|
|
18306
|
-
pinCount:
|
|
18358
|
+
pinCount: z93.number(),
|
|
18307
18359
|
pitch: distance24.optional(),
|
|
18308
|
-
schFacingDirection:
|
|
18309
|
-
gender:
|
|
18310
|
-
showSilkscreenPinLabels:
|
|
18311
|
-
pcbPinLabels:
|
|
18312
|
-
doubleRow:
|
|
18313
|
-
rightAngle:
|
|
18360
|
+
schFacingDirection: z93.enum(["up", "down", "left", "right"]).optional(),
|
|
18361
|
+
gender: z93.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
18362
|
+
showSilkscreenPinLabels: z93.boolean().optional(),
|
|
18363
|
+
pcbPinLabels: z93.record(z93.string(), z93.string()).optional(),
|
|
18364
|
+
doubleRow: z93.boolean().optional(),
|
|
18365
|
+
rightAngle: z93.boolean().optional(),
|
|
18314
18366
|
pcbOrientation: pcbOrientation.optional(),
|
|
18315
18367
|
holeDiameter: distance24.optional(),
|
|
18316
18368
|
platedDiameter: distance24.optional(),
|
|
18317
|
-
pinLabels:
|
|
18318
|
-
connections:
|
|
18319
|
-
facingDirection:
|
|
18369
|
+
pinLabels: z93.record(z93.string(), schematicPinLabel).or(z93.array(schematicPinLabel)).optional(),
|
|
18370
|
+
connections: z93.custom().pipe(z93.record(z93.string(), connectionTarget)).optional(),
|
|
18371
|
+
facingDirection: z93.enum(["left", "right"]).optional(),
|
|
18320
18372
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
18321
18373
|
schPinStyle: schematicPinStyle.optional(),
|
|
18322
18374
|
schPinSpacing: distance24.optional(),
|
|
18323
18375
|
schWidth: distance24.optional(),
|
|
18324
18376
|
schHeight: distance24.optional(),
|
|
18325
|
-
connectsFromAbove:
|
|
18326
|
-
connectsFromBelow:
|
|
18377
|
+
connectsFromAbove: z93.boolean().optional(),
|
|
18378
|
+
connectsFromBelow: z93.boolean().optional()
|
|
18327
18379
|
}).superRefine((props, ctx) => {
|
|
18328
18380
|
if (props.connectsFromAbove && props.connectsFromBelow) {
|
|
18329
18381
|
ctx.addIssue({
|
|
18330
|
-
code:
|
|
18382
|
+
code: z93.ZodIssueCode.custom,
|
|
18331
18383
|
message: "connectsFromAbove and connectsFromBelow are opposites; set at most one"
|
|
18332
18384
|
});
|
|
18333
18385
|
}
|
|
@@ -18338,30 +18390,30 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
18338
18390
|
expectTypesMatch(true);
|
|
18339
18391
|
|
|
18340
18392
|
// lib/components/netalias.ts
|
|
18341
|
-
import { z as
|
|
18393
|
+
import { z as z94 } from "zod";
|
|
18342
18394
|
import { rotation as rotation4 } from "circuit-json";
|
|
18343
|
-
var netAliasProps =
|
|
18344
|
-
net:
|
|
18345
|
-
connection:
|
|
18395
|
+
var netAliasProps = z94.object({
|
|
18396
|
+
net: z94.string().optional(),
|
|
18397
|
+
connection: z94.string().optional(),
|
|
18346
18398
|
schX: distance.optional(),
|
|
18347
18399
|
schY: distance.optional(),
|
|
18348
18400
|
schRotation: rotation4.optional(),
|
|
18349
|
-
anchorSide:
|
|
18401
|
+
anchorSide: z94.enum(["left", "top", "right", "bottom"]).optional()
|
|
18350
18402
|
});
|
|
18351
18403
|
expectTypesMatch(true);
|
|
18352
18404
|
|
|
18353
18405
|
// lib/components/netlabel.ts
|
|
18354
|
-
import { z as
|
|
18406
|
+
import { z as z95 } from "zod";
|
|
18355
18407
|
import { rotation as rotation5 } from "circuit-json";
|
|
18356
|
-
var netLabelProps =
|
|
18357
|
-
net:
|
|
18358
|
-
connection:
|
|
18359
|
-
connectsTo:
|
|
18360
|
-
inline:
|
|
18408
|
+
var netLabelProps = z95.object({
|
|
18409
|
+
net: z95.string().optional(),
|
|
18410
|
+
connection: z95.string().optional(),
|
|
18411
|
+
connectsTo: z95.string().or(z95.array(z95.string())).optional(),
|
|
18412
|
+
inline: z95.boolean().optional(),
|
|
18361
18413
|
schX: distance.optional(),
|
|
18362
18414
|
schY: distance.optional(),
|
|
18363
18415
|
schRotation: rotation5.optional(),
|
|
18364
|
-
anchorSide:
|
|
18416
|
+
anchorSide: z95.enum(["left", "top", "right", "bottom"]).optional()
|
|
18365
18417
|
});
|
|
18366
18418
|
expectTypesMatch(true);
|
|
18367
18419
|
|
|
@@ -18376,32 +18428,32 @@ expectTypesMatch(true);
|
|
|
18376
18428
|
|
|
18377
18429
|
// lib/components/analogsimulation.ts
|
|
18378
18430
|
import { ms } from "circuit-json";
|
|
18379
|
-
import { z as
|
|
18380
|
-
var spiceEngine =
|
|
18431
|
+
import { z as z97 } from "zod";
|
|
18432
|
+
var spiceEngine = z97.custom(
|
|
18381
18433
|
(value) => typeof value === "string"
|
|
18382
18434
|
);
|
|
18383
|
-
var spiceOptions =
|
|
18384
|
-
method:
|
|
18385
|
-
reltol:
|
|
18386
|
-
abstol:
|
|
18387
|
-
vntol:
|
|
18435
|
+
var spiceOptions = z97.object({
|
|
18436
|
+
method: z97.enum(["trap", "gear"]).optional(),
|
|
18437
|
+
reltol: z97.union([z97.number(), z97.string()]).optional(),
|
|
18438
|
+
abstol: z97.union([z97.number(), z97.string()]).optional(),
|
|
18439
|
+
vntol: z97.union([z97.number(), z97.string()]).optional()
|
|
18388
18440
|
});
|
|
18389
18441
|
var analogAnalysisSimulationBaseProps = {
|
|
18390
|
-
name:
|
|
18442
|
+
name: z97.string().optional(),
|
|
18391
18443
|
spiceEngine: spiceEngine.optional(),
|
|
18392
18444
|
spiceOptions: spiceOptions.optional(),
|
|
18393
|
-
graphIndependentAxes:
|
|
18394
|
-
children:
|
|
18445
|
+
graphIndependentAxes: z97.boolean().optional(),
|
|
18446
|
+
children: z97.custom().optional()
|
|
18395
18447
|
};
|
|
18396
|
-
var analogSimulationProps =
|
|
18397
|
-
name:
|
|
18398
|
-
simulationType:
|
|
18448
|
+
var analogSimulationProps = z97.object({
|
|
18449
|
+
name: z97.string().optional(),
|
|
18450
|
+
simulationType: z97.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
18399
18451
|
duration: ms.optional(),
|
|
18400
18452
|
startTime: ms.optional(),
|
|
18401
18453
|
timePerStep: ms.optional(),
|
|
18402
18454
|
spiceEngine: spiceEngine.optional(),
|
|
18403
18455
|
spiceOptions: spiceOptions.optional(),
|
|
18404
|
-
graphIndependentAxes:
|
|
18456
|
+
graphIndependentAxes: z97.boolean().optional()
|
|
18405
18457
|
});
|
|
18406
18458
|
expectTypesMatch(
|
|
18407
18459
|
true
|
|
@@ -18409,12 +18461,12 @@ expectTypesMatch(
|
|
|
18409
18461
|
|
|
18410
18462
|
// lib/components/analogtransientsimulation.ts
|
|
18411
18463
|
import { ms as ms2 } from "circuit-json";
|
|
18412
|
-
import { z as
|
|
18464
|
+
import { z as z98 } from "zod";
|
|
18413
18465
|
var positiveMilliseconds = ms2.refine(
|
|
18414
18466
|
(milliseconds) => milliseconds > 0,
|
|
18415
18467
|
"Time must be positive"
|
|
18416
18468
|
);
|
|
18417
|
-
var analogTransientSimulationProps =
|
|
18469
|
+
var analogTransientSimulationProps = z98.object({
|
|
18418
18470
|
...analogAnalysisSimulationBaseProps,
|
|
18419
18471
|
duration: positiveMilliseconds.default("10ms"),
|
|
18420
18472
|
startTime: ms2.default("0ms"),
|
|
@@ -18422,7 +18474,7 @@ var analogTransientSimulationProps = z96.object({
|
|
|
18422
18474
|
}).superRefine((simulation, context) => {
|
|
18423
18475
|
if (simulation.startTime < 0 || simulation.startTime > simulation.duration) {
|
|
18424
18476
|
context.addIssue({
|
|
18425
|
-
code:
|
|
18477
|
+
code: z98.ZodIssueCode.custom,
|
|
18426
18478
|
path: ["startTime"],
|
|
18427
18479
|
message: "startTime must be between zero and duration"
|
|
18428
18480
|
});
|
|
@@ -18431,19 +18483,19 @@ var analogTransientSimulationProps = z96.object({
|
|
|
18431
18483
|
expectTypesMatch(true);
|
|
18432
18484
|
|
|
18433
18485
|
// lib/components/analogdcoperatingpointsimulation.ts
|
|
18434
|
-
import { z as
|
|
18435
|
-
var analogDcOperatingPointSimulationProps =
|
|
18486
|
+
import { z as z99 } from "zod";
|
|
18487
|
+
var analogDcOperatingPointSimulationProps = z99.object({
|
|
18436
18488
|
...analogAnalysisSimulationBaseProps
|
|
18437
18489
|
});
|
|
18438
18490
|
expectTypesMatch(true);
|
|
18439
18491
|
|
|
18440
18492
|
// lib/components/analogdcsweepsimulation.ts
|
|
18441
18493
|
import { current, voltage as voltage3 } from "circuit-json";
|
|
18442
|
-
import { z as
|
|
18443
|
-
var dcSweepQuantity =
|
|
18444
|
-
var analogDcSweepSimulationProps =
|
|
18494
|
+
import { z as z100 } from "zod";
|
|
18495
|
+
var dcSweepQuantity = z100.union([voltage3, current]);
|
|
18496
|
+
var analogDcSweepSimulationProps = z100.object({
|
|
18445
18497
|
...analogAnalysisSimulationBaseProps,
|
|
18446
|
-
sweepSource:
|
|
18498
|
+
sweepSource: z100.string().min(1),
|
|
18447
18499
|
sweepStart: dcSweepQuantity,
|
|
18448
18500
|
sweepStop: dcSweepQuantity,
|
|
18449
18501
|
sweepStep: dcSweepQuantity.refine(
|
|
@@ -18453,7 +18505,7 @@ var analogDcSweepSimulationProps = z98.object({
|
|
|
18453
18505
|
}).superRefine((simulation, context) => {
|
|
18454
18506
|
if (Math.sign(simulation.sweepStop - simulation.sweepStart) !== Math.sign(simulation.sweepStep)) {
|
|
18455
18507
|
context.addIssue({
|
|
18456
|
-
code:
|
|
18508
|
+
code: z100.ZodIssueCode.custom,
|
|
18457
18509
|
path: ["sweepStep"],
|
|
18458
18510
|
message: "sweepStep must move from sweepStart toward sweepStop"
|
|
18459
18511
|
});
|
|
@@ -18463,10 +18515,10 @@ expectTypesMatch(true);
|
|
|
18463
18515
|
|
|
18464
18516
|
// lib/components/analogacsweepsimulation.ts
|
|
18465
18517
|
import { frequency as frequency3 } from "circuit-json";
|
|
18466
|
-
import { z as
|
|
18467
|
-
var analogAcSweepSimulationProps =
|
|
18518
|
+
import { z as z101 } from "zod";
|
|
18519
|
+
var analogAcSweepSimulationProps = z101.object({
|
|
18468
18520
|
...analogAnalysisSimulationBaseProps,
|
|
18469
|
-
sweepType:
|
|
18521
|
+
sweepType: z101.enum(["linear", "decade", "octave"]),
|
|
18470
18522
|
startFrequency: frequency3.refine(
|
|
18471
18523
|
(startFrequencyHz) => startFrequencyHz > 0,
|
|
18472
18524
|
"startFrequency must be positive"
|
|
@@ -18475,12 +18527,12 @@ var analogAcSweepSimulationProps = z99.object({
|
|
|
18475
18527
|
(stopFrequencyHz) => stopFrequencyHz > 0,
|
|
18476
18528
|
"stopFrequency must be positive"
|
|
18477
18529
|
),
|
|
18478
|
-
samplesPerInterval:
|
|
18479
|
-
sampleCount:
|
|
18530
|
+
samplesPerInterval: z101.number().int().positive().optional(),
|
|
18531
|
+
sampleCount: z101.number().int().positive().optional()
|
|
18480
18532
|
}).superRefine((simulation, context) => {
|
|
18481
18533
|
if (simulation.stopFrequency <= simulation.startFrequency) {
|
|
18482
18534
|
context.addIssue({
|
|
18483
|
-
code:
|
|
18535
|
+
code: z101.ZodIssueCode.custom,
|
|
18484
18536
|
path: ["stopFrequency"],
|
|
18485
18537
|
message: "stopFrequency must be greater than startFrequency"
|
|
18486
18538
|
});
|
|
@@ -18488,14 +18540,14 @@ var analogAcSweepSimulationProps = z99.object({
|
|
|
18488
18540
|
if (simulation.sweepType === "linear") {
|
|
18489
18541
|
if (simulation.sampleCount === void 0) {
|
|
18490
18542
|
context.addIssue({
|
|
18491
|
-
code:
|
|
18543
|
+
code: z101.ZodIssueCode.custom,
|
|
18492
18544
|
path: ["sampleCount"],
|
|
18493
18545
|
message: "sampleCount is required for a linear AC sweep"
|
|
18494
18546
|
});
|
|
18495
18547
|
}
|
|
18496
18548
|
if (simulation.samplesPerInterval !== void 0) {
|
|
18497
18549
|
context.addIssue({
|
|
18498
|
-
code:
|
|
18550
|
+
code: z101.ZodIssueCode.custom,
|
|
18499
18551
|
path: ["samplesPerInterval"],
|
|
18500
18552
|
message: "samplesPerInterval is only valid for decade or octave sweeps"
|
|
18501
18553
|
});
|
|
@@ -18504,14 +18556,14 @@ var analogAcSweepSimulationProps = z99.object({
|
|
|
18504
18556
|
}
|
|
18505
18557
|
if (simulation.samplesPerInterval === void 0) {
|
|
18506
18558
|
context.addIssue({
|
|
18507
|
-
code:
|
|
18559
|
+
code: z101.ZodIssueCode.custom,
|
|
18508
18560
|
path: ["samplesPerInterval"],
|
|
18509
18561
|
message: "samplesPerInterval is required for decade or octave sweeps"
|
|
18510
18562
|
});
|
|
18511
18563
|
}
|
|
18512
18564
|
if (simulation.sampleCount !== void 0) {
|
|
18513
18565
|
context.addIssue({
|
|
18514
|
-
code:
|
|
18566
|
+
code: z101.ZodIssueCode.custom,
|
|
18515
18567
|
path: ["sampleCount"],
|
|
18516
18568
|
message: "sampleCount is only valid for a linear sweep"
|
|
18517
18569
|
});
|
|
@@ -18527,43 +18579,43 @@ import {
|
|
|
18527
18579
|
resistance as resistance4,
|
|
18528
18580
|
voltage as voltage4
|
|
18529
18581
|
} from "circuit-json";
|
|
18530
|
-
import { z as
|
|
18531
|
-
var resistanceSweepQuantity = resistance4.pipe(
|
|
18532
|
-
var capacitanceSweepQuantity = capacitance4.pipe(
|
|
18533
|
-
var inductanceSweepQuantity = inductance.pipe(
|
|
18534
|
-
var voltageSweepQuantity = voltage4.pipe(
|
|
18535
|
-
var currentSweepQuantity = current2.pipe(
|
|
18582
|
+
import { z as z102 } from "zod";
|
|
18583
|
+
var resistanceSweepQuantity = resistance4.pipe(z102.number());
|
|
18584
|
+
var capacitanceSweepQuantity = capacitance4.pipe(z102.number());
|
|
18585
|
+
var inductanceSweepQuantity = inductance.pipe(z102.number());
|
|
18586
|
+
var voltageSweepQuantity = voltage4.pipe(z102.number());
|
|
18587
|
+
var currentSweepQuantity = current2.pipe(z102.number());
|
|
18536
18588
|
var createAnalogSweepCoordinateProps = (sweepQuantity) => ({
|
|
18537
|
-
name:
|
|
18538
|
-
values:
|
|
18589
|
+
name: z102.string().optional(),
|
|
18590
|
+
values: z102.array(sweepQuantity).min(1).optional(),
|
|
18539
18591
|
start: sweepQuantity.optional(),
|
|
18540
18592
|
stop: sweepQuantity.optional(),
|
|
18541
18593
|
step: sweepQuantity.optional()
|
|
18542
18594
|
});
|
|
18543
|
-
var analogResistanceSweepParameterProps =
|
|
18595
|
+
var analogResistanceSweepParameterProps = z102.object({
|
|
18544
18596
|
...createAnalogSweepCoordinateProps(resistanceSweepQuantity),
|
|
18545
|
-
parameterType:
|
|
18546
|
-
resistorRef:
|
|
18597
|
+
parameterType: z102.literal("resistance"),
|
|
18598
|
+
resistorRef: z102.string().min(1)
|
|
18547
18599
|
}).strict();
|
|
18548
|
-
var analogCapacitanceSweepParameterProps =
|
|
18600
|
+
var analogCapacitanceSweepParameterProps = z102.object({
|
|
18549
18601
|
...createAnalogSweepCoordinateProps(capacitanceSweepQuantity),
|
|
18550
|
-
parameterType:
|
|
18551
|
-
capacitorRef:
|
|
18602
|
+
parameterType: z102.literal("capacitance"),
|
|
18603
|
+
capacitorRef: z102.string().min(1)
|
|
18552
18604
|
}).strict();
|
|
18553
|
-
var analogInductanceSweepParameterProps =
|
|
18605
|
+
var analogInductanceSweepParameterProps = z102.object({
|
|
18554
18606
|
...createAnalogSweepCoordinateProps(inductanceSweepQuantity),
|
|
18555
|
-
parameterType:
|
|
18556
|
-
inductorRef:
|
|
18607
|
+
parameterType: z102.literal("inductance"),
|
|
18608
|
+
inductorRef: z102.string().min(1)
|
|
18557
18609
|
}).strict();
|
|
18558
|
-
var analogVoltageSweepParameterProps =
|
|
18610
|
+
var analogVoltageSweepParameterProps = z102.object({
|
|
18559
18611
|
...createAnalogSweepCoordinateProps(voltageSweepQuantity),
|
|
18560
|
-
parameterType:
|
|
18561
|
-
net:
|
|
18612
|
+
parameterType: z102.literal("voltage"),
|
|
18613
|
+
net: z102.string().min(1)
|
|
18562
18614
|
}).strict();
|
|
18563
|
-
var analogCurrentSweepParameterProps =
|
|
18615
|
+
var analogCurrentSweepParameterProps = z102.object({
|
|
18564
18616
|
...createAnalogSweepCoordinateProps(currentSweepQuantity),
|
|
18565
|
-
parameterType:
|
|
18566
|
-
currentSourceRef:
|
|
18617
|
+
parameterType: z102.literal("current"),
|
|
18618
|
+
currentSourceRef: z102.string().min(1)
|
|
18567
18619
|
}).strict();
|
|
18568
18620
|
var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
18569
18621
|
const hasExplicitSweepCoordinates = sweepCoordinates.values !== void 0;
|
|
@@ -18575,34 +18627,34 @@ var validateAnalogSweepCoordinates = (sweepCoordinates, context) => {
|
|
|
18575
18627
|
const hasRangeCoordinates = rangeCoordinateCount > 0;
|
|
18576
18628
|
if (hasExplicitSweepCoordinates === hasRangeCoordinates) {
|
|
18577
18629
|
context.addIssue({
|
|
18578
|
-
code:
|
|
18630
|
+
code: z102.ZodIssueCode.custom,
|
|
18579
18631
|
message: "Provide either values or start/stop/step"
|
|
18580
18632
|
});
|
|
18581
18633
|
return;
|
|
18582
18634
|
}
|
|
18583
18635
|
if (rangeCoordinateCount !== 0 && rangeCoordinateCount !== 3) {
|
|
18584
18636
|
context.addIssue({
|
|
18585
|
-
code:
|
|
18637
|
+
code: z102.ZodIssueCode.custom,
|
|
18586
18638
|
message: "start, stop, and step must be provided together"
|
|
18587
18639
|
});
|
|
18588
18640
|
return;
|
|
18589
18641
|
}
|
|
18590
18642
|
if (sweepCoordinates.step === 0) {
|
|
18591
18643
|
context.addIssue({
|
|
18592
|
-
code:
|
|
18644
|
+
code: z102.ZodIssueCode.custom,
|
|
18593
18645
|
path: ["step"],
|
|
18594
18646
|
message: "step must be nonzero"
|
|
18595
18647
|
});
|
|
18596
18648
|
}
|
|
18597
18649
|
if (sweepCoordinates.start !== void 0 && sweepCoordinates.stop !== void 0 && sweepCoordinates.step !== void 0 && Math.sign(sweepCoordinates.stop - sweepCoordinates.start) !== Math.sign(sweepCoordinates.step)) {
|
|
18598
18650
|
context.addIssue({
|
|
18599
|
-
code:
|
|
18651
|
+
code: z102.ZodIssueCode.custom,
|
|
18600
18652
|
path: ["step"],
|
|
18601
18653
|
message: "step must move from start toward stop"
|
|
18602
18654
|
});
|
|
18603
18655
|
}
|
|
18604
18656
|
};
|
|
18605
|
-
var analogSweepParameterProps =
|
|
18657
|
+
var analogSweepParameterProps = z102.discriminatedUnion("parameterType", [
|
|
18606
18658
|
analogResistanceSweepParameterProps,
|
|
18607
18659
|
analogCapacitanceSweepParameterProps,
|
|
18608
18660
|
analogInductanceSweepParameterProps,
|
|
@@ -18617,26 +18669,26 @@ expectTypesMatch(true);
|
|
|
18617
18669
|
expectTypesMatch(true);
|
|
18618
18670
|
|
|
18619
18671
|
// lib/components/autoroutingphase.ts
|
|
18620
|
-
import { z as
|
|
18621
|
-
var autoroutingPhaseProps =
|
|
18622
|
-
key:
|
|
18623
|
-
name:
|
|
18672
|
+
import { z as z103 } from "zod";
|
|
18673
|
+
var autoroutingPhaseProps = z103.object({
|
|
18674
|
+
key: z103.any().optional(),
|
|
18675
|
+
name: z103.string().optional(),
|
|
18624
18676
|
autorouter: autorouterProp.optional(),
|
|
18625
18677
|
algorithmFn: autorouterConfig.shape.algorithmFn,
|
|
18626
18678
|
preflightRoutingCheckPolicy: preflightRoutingCheckPolicy.optional(),
|
|
18627
|
-
phaseIndex:
|
|
18628
|
-
pcbTracePaths:
|
|
18679
|
+
phaseIndex: z103.number().optional(),
|
|
18680
|
+
pcbTracePaths: z103.array(fanoutTracePath).optional(),
|
|
18629
18681
|
...routingTolerances.shape,
|
|
18630
|
-
region:
|
|
18631
|
-
shape:
|
|
18632
|
-
minX:
|
|
18633
|
-
maxX:
|
|
18634
|
-
minY:
|
|
18635
|
-
maxY:
|
|
18682
|
+
region: z103.object({
|
|
18683
|
+
shape: z103.literal("rect").optional(),
|
|
18684
|
+
minX: z103.number(),
|
|
18685
|
+
maxX: z103.number(),
|
|
18686
|
+
minY: z103.number(),
|
|
18687
|
+
maxY: z103.number()
|
|
18636
18688
|
}).optional(),
|
|
18637
|
-
connection:
|
|
18638
|
-
connections:
|
|
18639
|
-
reroute:
|
|
18689
|
+
connection: z103.string().optional(),
|
|
18690
|
+
connections: z103.array(z103.string()).optional(),
|
|
18691
|
+
reroute: z103.boolean().optional(),
|
|
18640
18692
|
...fanoutProps.shape
|
|
18641
18693
|
}).superRefine((value, ctx) => {
|
|
18642
18694
|
const isSimplifyAutorouter = value.autorouter === "simplify" || typeof value.autorouter === "object" && value.autorouter?.preset === "simplify";
|
|
@@ -18647,7 +18699,7 @@ var autoroutingPhaseProps = z101.object({
|
|
|
18647
18699
|
}
|
|
18648
18700
|
if (value.reroute !== void 0 && !(isSimplifyAutorouter && value.reroute === true) && value.region === void 0 && value.connection === void 0 && value.connections === void 0) {
|
|
18649
18701
|
ctx.addIssue({
|
|
18650
|
-
code:
|
|
18702
|
+
code: z103.ZodIssueCode.custom,
|
|
18651
18703
|
message: "region, connection, or connections is required when reroute is provided",
|
|
18652
18704
|
path: ["region"]
|
|
18653
18705
|
});
|
|
@@ -18656,15 +18708,15 @@ var autoroutingPhaseProps = z101.object({
|
|
|
18656
18708
|
expectTypesMatch(true);
|
|
18657
18709
|
|
|
18658
18710
|
// lib/components/spicemodel.ts
|
|
18659
|
-
import { z as
|
|
18660
|
-
var spicemodelProps =
|
|
18661
|
-
source:
|
|
18662
|
-
spicePinMapping:
|
|
18711
|
+
import { z as z104 } from "zod";
|
|
18712
|
+
var spicemodelProps = z104.object({
|
|
18713
|
+
source: z104.string(),
|
|
18714
|
+
spicePinMapping: z104.record(z104.string(), z104.string()).optional()
|
|
18663
18715
|
});
|
|
18664
18716
|
expectTypesMatch(true);
|
|
18665
18717
|
|
|
18666
18718
|
// lib/components/transistor.ts
|
|
18667
|
-
import { z as
|
|
18719
|
+
import { z as z105 } from "zod";
|
|
18668
18720
|
var transistorPinsLabels = [
|
|
18669
18721
|
"pin1",
|
|
18670
18722
|
"pin2",
|
|
@@ -18677,7 +18729,7 @@ var transistorPinsLabels = [
|
|
|
18677
18729
|
"drain"
|
|
18678
18730
|
];
|
|
18679
18731
|
var transistorProps = commonComponentProps.extend({
|
|
18680
|
-
type:
|
|
18732
|
+
type: z105.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
18681
18733
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
18682
18734
|
});
|
|
18683
18735
|
var transistorPins = [
|
|
@@ -18691,7 +18743,7 @@ var transistorPins = [
|
|
|
18691
18743
|
expectTypesMatch(true);
|
|
18692
18744
|
|
|
18693
18745
|
// lib/components/mosfet.ts
|
|
18694
|
-
import { z as
|
|
18746
|
+
import { z as z106 } from "zod";
|
|
18695
18747
|
var mosfetPins = [
|
|
18696
18748
|
"pin1",
|
|
18697
18749
|
"drain",
|
|
@@ -18701,11 +18753,11 @@ var mosfetPins = [
|
|
|
18701
18753
|
"gate"
|
|
18702
18754
|
];
|
|
18703
18755
|
var mosfetProps = commonComponentProps.extend({
|
|
18704
|
-
channelType:
|
|
18705
|
-
mosfetMode:
|
|
18706
|
-
symbolDrainSide:
|
|
18707
|
-
symbolSourceSide:
|
|
18708
|
-
symbolGateSide:
|
|
18756
|
+
channelType: z106.enum(["n", "p"]),
|
|
18757
|
+
mosfetMode: z106.enum(["enhancement", "depletion"]),
|
|
18758
|
+
symbolDrainSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18759
|
+
symbolSourceSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18760
|
+
symbolGateSide: z106.enum(["left", "right", "top", "bottom"]).optional(),
|
|
18709
18761
|
connections: createConnectionsProp(mosfetPins).optional()
|
|
18710
18762
|
});
|
|
18711
18763
|
expectTypesMatch(true);
|
|
@@ -18727,29 +18779,29 @@ expectTypesMatch(true);
|
|
|
18727
18779
|
|
|
18728
18780
|
// lib/components/inductor.ts
|
|
18729
18781
|
import { inductance as inductance2 } from "circuit-json";
|
|
18730
|
-
import { z as
|
|
18782
|
+
import { z as z108 } from "zod";
|
|
18731
18783
|
var inductorPins = lrPins;
|
|
18732
18784
|
var inductorProps = commonComponentProps.extend({
|
|
18733
18785
|
inductance: inductance2,
|
|
18734
|
-
maxCurrentRating:
|
|
18786
|
+
maxCurrentRating: z108.union([z108.string(), z108.number()]).optional(),
|
|
18735
18787
|
schOrientation: schematicOrientation.optional(),
|
|
18736
18788
|
connections: createConnectionsProp(inductorPins).optional()
|
|
18737
18789
|
});
|
|
18738
18790
|
expectTypesMatch(true);
|
|
18739
18791
|
|
|
18740
18792
|
// lib/components/internal-circuit.ts
|
|
18741
|
-
import { z as
|
|
18742
|
-
var internalCircuitProps =
|
|
18743
|
-
children:
|
|
18793
|
+
import { z as z109 } from "zod";
|
|
18794
|
+
var internalCircuitProps = z109.object({
|
|
18795
|
+
children: z109.custom().optional()
|
|
18744
18796
|
});
|
|
18745
18797
|
expectTypesMatch(
|
|
18746
18798
|
true
|
|
18747
18799
|
);
|
|
18748
18800
|
|
|
18749
18801
|
// lib/components/diode.ts
|
|
18750
|
-
import { z as
|
|
18802
|
+
import { z as z110 } from "zod";
|
|
18751
18803
|
var diodePins = lrPolarPins;
|
|
18752
|
-
var diodeConnectionKeys =
|
|
18804
|
+
var diodeConnectionKeys = z110.enum([
|
|
18753
18805
|
"anode",
|
|
18754
18806
|
"cathode",
|
|
18755
18807
|
"pin1",
|
|
@@ -18757,13 +18809,13 @@ var diodeConnectionKeys = z108.enum([
|
|
|
18757
18809
|
"pos",
|
|
18758
18810
|
"neg"
|
|
18759
18811
|
]);
|
|
18760
|
-
var connectionTarget3 =
|
|
18761
|
-
var connectionsProp2 =
|
|
18762
|
-
var diodePinLabelsProp =
|
|
18763
|
-
|
|
18764
|
-
schematicPinLabel.or(
|
|
18812
|
+
var connectionTarget3 = z110.string().or(z110.array(z110.string()).readonly()).or(z110.array(z110.string()));
|
|
18813
|
+
var connectionsProp2 = z110.record(diodeConnectionKeys, connectionTarget3);
|
|
18814
|
+
var diodePinLabelsProp = z110.record(
|
|
18815
|
+
z110.enum(diodePins),
|
|
18816
|
+
schematicPinLabel.or(z110.array(schematicPinLabel).readonly()).or(z110.array(schematicPinLabel))
|
|
18765
18817
|
);
|
|
18766
|
-
var diodeVariant =
|
|
18818
|
+
var diodeVariant = z110.enum([
|
|
18767
18819
|
"standard",
|
|
18768
18820
|
"schottky",
|
|
18769
18821
|
"zener",
|
|
@@ -18774,12 +18826,12 @@ var diodeVariant = z108.enum([
|
|
|
18774
18826
|
var diodeProps = commonComponentProps.extend({
|
|
18775
18827
|
connections: connectionsProp2.optional(),
|
|
18776
18828
|
variant: diodeVariant.optional().default("standard"),
|
|
18777
|
-
standard:
|
|
18778
|
-
schottky:
|
|
18779
|
-
zener:
|
|
18780
|
-
avalanche:
|
|
18781
|
-
photo:
|
|
18782
|
-
tvs:
|
|
18829
|
+
standard: z110.boolean().optional(),
|
|
18830
|
+
schottky: z110.boolean().optional(),
|
|
18831
|
+
zener: z110.boolean().optional(),
|
|
18832
|
+
avalanche: z110.boolean().optional(),
|
|
18833
|
+
photo: z110.boolean().optional(),
|
|
18834
|
+
tvs: z110.boolean().optional(),
|
|
18783
18835
|
schOrientation: schematicOrientation.optional(),
|
|
18784
18836
|
schSize: schematicSymbolSize.optional(),
|
|
18785
18837
|
pinLabels: diodePinLabelsProp.optional()
|
|
@@ -18794,11 +18846,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18794
18846
|
].filter(Boolean).length;
|
|
18795
18847
|
if (enabledFlags > 1) {
|
|
18796
18848
|
ctx.addIssue({
|
|
18797
|
-
code:
|
|
18849
|
+
code: z110.ZodIssueCode.custom,
|
|
18798
18850
|
message: "Exactly one diode variant must be enabled",
|
|
18799
18851
|
path: []
|
|
18800
18852
|
});
|
|
18801
|
-
return
|
|
18853
|
+
return z110.INVALID;
|
|
18802
18854
|
}
|
|
18803
18855
|
}).transform((data) => {
|
|
18804
18856
|
const result = {
|
|
@@ -18844,18 +18896,18 @@ var diodeProps = commonComponentProps.extend({
|
|
|
18844
18896
|
expectTypesMatch(true);
|
|
18845
18897
|
|
|
18846
18898
|
// lib/components/led.ts
|
|
18847
|
-
import { z as
|
|
18848
|
-
var legacyNumericLedPinLabelsProp =
|
|
18849
|
-
|
|
18850
|
-
schematicPinLabel.or(
|
|
18899
|
+
import { z as z111 } from "zod";
|
|
18900
|
+
var legacyNumericLedPinLabelsProp = z111.record(
|
|
18901
|
+
z111.enum(["1", "2"]),
|
|
18902
|
+
schematicPinLabel.or(z111.array(schematicPinLabel).readonly()).or(z111.array(schematicPinLabel))
|
|
18851
18903
|
).transform((pinLabels) => ({
|
|
18852
18904
|
...pinLabels["1"] === void 0 ? {} : { pin1: pinLabels["1"] },
|
|
18853
18905
|
...pinLabels["2"] === void 0 ? {} : { pin2: pinLabels["2"] }
|
|
18854
18906
|
}));
|
|
18855
18907
|
var ledProps = commonComponentProps.extend({
|
|
18856
|
-
color:
|
|
18857
|
-
wavelength:
|
|
18858
|
-
schDisplayValue:
|
|
18908
|
+
color: z111.string().optional(),
|
|
18909
|
+
wavelength: z111.string().optional(),
|
|
18910
|
+
schDisplayValue: z111.string().optional(),
|
|
18859
18911
|
schOrientation: schematicOrientation.optional(),
|
|
18860
18912
|
/** Select a compact schematic symbol; omitted, default, and md retain the standard symbol. */
|
|
18861
18913
|
schSize: schematicSymbolSize.optional(),
|
|
@@ -18863,28 +18915,28 @@ var ledProps = commonComponentProps.extend({
|
|
|
18863
18915
|
// wrappers, then normalized to the canonical pin1/pin2 representation.
|
|
18864
18916
|
pinLabels: diodePinLabelsProp.or(legacyNumericLedPinLabelsProp).optional(),
|
|
18865
18917
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
18866
|
-
laser:
|
|
18918
|
+
laser: z111.boolean().optional()
|
|
18867
18919
|
});
|
|
18868
18920
|
var ledPins = lrPolarPins;
|
|
18869
18921
|
|
|
18870
18922
|
// lib/components/switch.ts
|
|
18871
18923
|
import { ms as ms3, frequency as frequency4 } from "circuit-json";
|
|
18872
|
-
import { z as
|
|
18924
|
+
import { z as z112 } from "zod";
|
|
18873
18925
|
var switchProps = commonComponentProps.extend({
|
|
18874
|
-
type:
|
|
18875
|
-
isNormallyClosed:
|
|
18876
|
-
spst:
|
|
18877
|
-
spdt:
|
|
18878
|
-
dpst:
|
|
18879
|
-
dpdt:
|
|
18926
|
+
type: z112.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
18927
|
+
isNormallyClosed: z112.boolean().optional().default(false),
|
|
18928
|
+
spst: z112.boolean().optional(),
|
|
18929
|
+
spdt: z112.boolean().optional(),
|
|
18930
|
+
dpst: z112.boolean().optional(),
|
|
18931
|
+
dpdt: z112.boolean().optional(),
|
|
18880
18932
|
pinLabels: pinLabelsProp.optional(),
|
|
18881
18933
|
noConnect: noConnectProp.optional(),
|
|
18882
18934
|
simSwitchFrequency: frequency4.optional(),
|
|
18883
18935
|
simCloseAt: ms3.optional(),
|
|
18884
18936
|
simOpenAt: ms3.optional(),
|
|
18885
|
-
simStartClosed:
|
|
18886
|
-
simStartOpen:
|
|
18887
|
-
connections:
|
|
18937
|
+
simStartClosed: z112.boolean().optional(),
|
|
18938
|
+
simStartOpen: z112.boolean().optional(),
|
|
18939
|
+
connections: z112.custom().pipe(z112.record(z112.string(), connectionTarget)).optional()
|
|
18888
18940
|
}).transform((props) => {
|
|
18889
18941
|
const updatedProps = { ...props };
|
|
18890
18942
|
if (updatedProps.dpdt) {
|
|
@@ -18916,33 +18968,33 @@ expectTypesMatch(true);
|
|
|
18916
18968
|
|
|
18917
18969
|
// lib/components/fabrication-note-text.ts
|
|
18918
18970
|
import { length as length4 } from "circuit-json";
|
|
18919
|
-
import { z as
|
|
18971
|
+
import { z as z113 } from "zod";
|
|
18920
18972
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
18921
|
-
text:
|
|
18922
|
-
anchorAlignment:
|
|
18923
|
-
font:
|
|
18973
|
+
text: z113.string(),
|
|
18974
|
+
anchorAlignment: z113.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
18975
|
+
font: z113.enum(["tscircuit2024"]).optional(),
|
|
18924
18976
|
fontSize: length4.optional(),
|
|
18925
|
-
color:
|
|
18977
|
+
color: z113.string().optional()
|
|
18926
18978
|
});
|
|
18927
18979
|
expectTypesMatch(true);
|
|
18928
18980
|
|
|
18929
18981
|
// lib/components/fabrication-note-rect.ts
|
|
18930
18982
|
import { distance as distance25 } from "circuit-json";
|
|
18931
|
-
import { z as
|
|
18983
|
+
import { z as z114 } from "zod";
|
|
18932
18984
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
18933
18985
|
width: distance25,
|
|
18934
18986
|
height: distance25,
|
|
18935
18987
|
strokeWidth: distance25.optional(),
|
|
18936
|
-
isFilled:
|
|
18937
|
-
hasStroke:
|
|
18938
|
-
isStrokeDashed:
|
|
18939
|
-
color:
|
|
18988
|
+
isFilled: z114.boolean().optional(),
|
|
18989
|
+
hasStroke: z114.boolean().optional(),
|
|
18990
|
+
isStrokeDashed: z114.boolean().optional(),
|
|
18991
|
+
color: z114.string().optional(),
|
|
18940
18992
|
cornerRadius: distance25.optional()
|
|
18941
18993
|
});
|
|
18942
18994
|
|
|
18943
18995
|
// lib/components/fabrication-note-path.ts
|
|
18944
18996
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
18945
|
-
import { z as
|
|
18997
|
+
import { z as z115 } from "zod";
|
|
18946
18998
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
18947
18999
|
pcbLeftEdgeX: true,
|
|
18948
19000
|
pcbRightEdgeX: true,
|
|
@@ -18954,15 +19006,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
18954
19006
|
pcbOffsetY: true,
|
|
18955
19007
|
pcbRotation: true
|
|
18956
19008
|
}).extend({
|
|
18957
|
-
route:
|
|
19009
|
+
route: z115.array(route_hint_point3),
|
|
18958
19010
|
strokeWidth: length5.optional(),
|
|
18959
|
-
color:
|
|
19011
|
+
color: z115.string().optional()
|
|
18960
19012
|
});
|
|
18961
19013
|
|
|
18962
19014
|
// lib/components/fabrication-note-dimension.ts
|
|
18963
19015
|
import { distance as distance26, length as length6 } from "circuit-json";
|
|
18964
|
-
import { z as
|
|
18965
|
-
var dimensionTarget =
|
|
19016
|
+
import { z as z116 } from "zod";
|
|
19017
|
+
var dimensionTarget = z116.union([z116.string(), point]);
|
|
18966
19018
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
18967
19019
|
pcbLeftEdgeX: true,
|
|
18968
19020
|
pcbRightEdgeX: true,
|
|
@@ -18976,44 +19028,44 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
18976
19028
|
}).extend({
|
|
18977
19029
|
from: dimensionTarget,
|
|
18978
19030
|
to: dimensionTarget,
|
|
18979
|
-
text:
|
|
19031
|
+
text: z116.string().optional(),
|
|
18980
19032
|
offset: distance26.optional(),
|
|
18981
|
-
offsetDirection:
|
|
18982
|
-
font:
|
|
19033
|
+
offsetDirection: z116.object({ x: z116.number().finite(), y: z116.number().finite() }).optional(),
|
|
19034
|
+
font: z116.enum(["tscircuit2024"]).optional(),
|
|
18983
19035
|
fontSize: length6.optional(),
|
|
18984
|
-
color:
|
|
19036
|
+
color: z116.string().optional(),
|
|
18985
19037
|
arrowSize: distance26.optional(),
|
|
18986
|
-
units:
|
|
18987
|
-
outerEdgeToEdge:
|
|
18988
|
-
centerToCenter:
|
|
18989
|
-
innerEdgeToEdge:
|
|
19038
|
+
units: z116.enum(["in", "mm"]).optional(),
|
|
19039
|
+
outerEdgeToEdge: z116.literal(true).optional(),
|
|
19040
|
+
centerToCenter: z116.literal(true).optional(),
|
|
19041
|
+
innerEdgeToEdge: z116.literal(true).optional()
|
|
18990
19042
|
});
|
|
18991
19043
|
expectTypesMatch(true);
|
|
18992
19044
|
|
|
18993
19045
|
// lib/components/pcb-trace.ts
|
|
18994
19046
|
import { distance as distance27, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
18995
|
-
import { z as
|
|
18996
|
-
var pcbTraceProps =
|
|
18997
|
-
layer:
|
|
19047
|
+
import { z as z117 } from "zod";
|
|
19048
|
+
var pcbTraceProps = z117.object({
|
|
19049
|
+
layer: z117.string().optional(),
|
|
18998
19050
|
thickness: distance27.optional(),
|
|
18999
|
-
route:
|
|
19051
|
+
route: z117.array(route_hint_point4)
|
|
19000
19052
|
});
|
|
19001
19053
|
|
|
19002
19054
|
// lib/components/via.ts
|
|
19003
19055
|
import { distance as distance28, layer_ref as layer_ref9 } from "circuit-json";
|
|
19004
|
-
import { z as
|
|
19056
|
+
import { z as z118 } from "zod";
|
|
19005
19057
|
var viaProps = commonLayoutProps.extend({
|
|
19006
|
-
name:
|
|
19058
|
+
name: z118.string().optional(),
|
|
19007
19059
|
fromLayer: layer_ref9.optional(),
|
|
19008
19060
|
toLayer: layer_ref9.optional(),
|
|
19009
19061
|
holeDiameter: distance28.optional(),
|
|
19010
19062
|
outerDiameter: distance28.optional(),
|
|
19011
|
-
layers:
|
|
19012
|
-
connectsTo:
|
|
19013
|
-
netIsAssignable:
|
|
19014
|
-
tented:
|
|
19015
|
-
|
|
19016
|
-
|
|
19063
|
+
layers: z118.array(layer_ref9).optional(),
|
|
19064
|
+
connectsTo: z118.string().or(z118.array(z118.string())).optional(),
|
|
19065
|
+
netIsAssignable: z118.boolean().optional(),
|
|
19066
|
+
tented: z118.union([
|
|
19067
|
+
z118.boolean(),
|
|
19068
|
+
z118.enum([
|
|
19017
19069
|
"both_sides",
|
|
19018
19070
|
"top_and_bottom_tented",
|
|
19019
19071
|
"top_tented",
|
|
@@ -19032,15 +19084,15 @@ expectTypesMatch(true);
|
|
|
19032
19084
|
|
|
19033
19085
|
// lib/components/testpoint.ts
|
|
19034
19086
|
import { distance as distance29 } from "circuit-json";
|
|
19035
|
-
import { z as
|
|
19087
|
+
import { z as z119 } from "zod";
|
|
19036
19088
|
var testpointPins = ["pin1"];
|
|
19037
|
-
var testpointConnectionsProp =
|
|
19089
|
+
var testpointConnectionsProp = z119.object({
|
|
19038
19090
|
pin1: connectionTarget
|
|
19039
19091
|
}).strict();
|
|
19040
19092
|
var testpointProps = commonComponentProps.extend({
|
|
19041
19093
|
connections: testpointConnectionsProp.optional(),
|
|
19042
|
-
footprintVariant:
|
|
19043
|
-
padShape:
|
|
19094
|
+
footprintVariant: z119.enum(["pad", "through_hole"]).optional(),
|
|
19095
|
+
padShape: z119.enum(["rect", "circle"]).optional().default("circle"),
|
|
19044
19096
|
padDiameter: distance29.optional(),
|
|
19045
19097
|
holeDiameter: distance29.optional(),
|
|
19046
19098
|
width: distance29.optional(),
|
|
@@ -19052,42 +19104,42 @@ var testpointProps = commonComponentProps.extend({
|
|
|
19052
19104
|
expectTypesMatch(true);
|
|
19053
19105
|
|
|
19054
19106
|
// lib/components/breakoutpoint.ts
|
|
19055
|
-
import { z as
|
|
19107
|
+
import { z as z120 } from "zod";
|
|
19056
19108
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
19057
|
-
connection:
|
|
19109
|
+
connection: z120.string()
|
|
19058
19110
|
});
|
|
19059
19111
|
expectTypesMatch(true);
|
|
19060
19112
|
|
|
19061
19113
|
// lib/components/pcb-keepout.ts
|
|
19062
19114
|
import { distance as distance30, layer_ref as layer_ref10 } from "circuit-json";
|
|
19063
|
-
import { z as
|
|
19064
|
-
var pcbKeepoutProps =
|
|
19115
|
+
import { z as z121 } from "zod";
|
|
19116
|
+
var pcbKeepoutProps = z121.union([
|
|
19065
19117
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19066
|
-
shape:
|
|
19118
|
+
shape: z121.literal("circle"),
|
|
19067
19119
|
radius: distance30,
|
|
19068
|
-
layers:
|
|
19120
|
+
layers: z121.array(layer_ref10).optional(),
|
|
19069
19121
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19070
|
-
warningOnly:
|
|
19122
|
+
warningOnly: z121.boolean().optional(),
|
|
19071
19123
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19072
|
-
allowTraces:
|
|
19124
|
+
allowTraces: z121.boolean().optional(),
|
|
19073
19125
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19074
|
-
allowPlacements:
|
|
19075
|
-
excludeRefs:
|
|
19126
|
+
allowPlacements: z121.boolean().optional(),
|
|
19127
|
+
excludeRefs: z121.array(z121.string()).optional().describe(
|
|
19076
19128
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19077
19129
|
)
|
|
19078
19130
|
}),
|
|
19079
19131
|
pcbLayoutProps.extend({
|
|
19080
|
-
shape:
|
|
19132
|
+
shape: z121.literal("rect"),
|
|
19081
19133
|
width: distance30,
|
|
19082
19134
|
height: distance30,
|
|
19083
|
-
layers:
|
|
19135
|
+
layers: z121.array(layer_ref10).optional(),
|
|
19084
19136
|
/** Report keepout violations as warnings when true. Omit for normal enforcement. */
|
|
19085
|
-
warningOnly:
|
|
19137
|
+
warningOnly: z121.boolean().optional(),
|
|
19086
19138
|
/** Allow trace crossings without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19087
|
-
allowTraces:
|
|
19139
|
+
allowTraces: z121.boolean().optional(),
|
|
19088
19140
|
/** Allow components and their pads/plated holes without keepout diagnostics. False or omitted retains enforcement; copper pours remain excluded. */
|
|
19089
|
-
allowPlacements:
|
|
19090
|
-
excludeRefs:
|
|
19141
|
+
allowPlacements: z121.boolean().optional(),
|
|
19142
|
+
excludeRefs: z121.array(z121.string()).optional().describe(
|
|
19091
19143
|
'Component selectors excluded from the keepout, such as ".ANT1"'
|
|
19092
19144
|
)
|
|
19093
19145
|
})
|
|
@@ -19095,20 +19147,20 @@ var pcbKeepoutProps = z119.union([
|
|
|
19095
19147
|
|
|
19096
19148
|
// lib/components/courtyard-rect.ts
|
|
19097
19149
|
import { distance as distance31 } from "circuit-json";
|
|
19098
|
-
import { z as
|
|
19150
|
+
import { z as z122 } from "zod";
|
|
19099
19151
|
var courtyardRectProps = pcbLayoutProps.extend({
|
|
19100
19152
|
width: distance31,
|
|
19101
19153
|
height: distance31,
|
|
19102
19154
|
strokeWidth: distance31.optional(),
|
|
19103
|
-
isFilled:
|
|
19104
|
-
hasStroke:
|
|
19105
|
-
isStrokeDashed:
|
|
19106
|
-
color:
|
|
19155
|
+
isFilled: z122.boolean().optional(),
|
|
19156
|
+
hasStroke: z122.boolean().optional(),
|
|
19157
|
+
isStrokeDashed: z122.boolean().optional(),
|
|
19158
|
+
color: z122.string().optional()
|
|
19107
19159
|
});
|
|
19108
19160
|
|
|
19109
19161
|
// lib/components/courtyard-outline.ts
|
|
19110
19162
|
import { length as length7 } from "circuit-json";
|
|
19111
|
-
import { z as
|
|
19163
|
+
import { z as z123 } from "zod";
|
|
19112
19164
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
19113
19165
|
pcbLeftEdgeX: true,
|
|
19114
19166
|
pcbRightEdgeX: true,
|
|
@@ -19120,11 +19172,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
19120
19172
|
pcbOffsetY: true,
|
|
19121
19173
|
pcbRotation: true
|
|
19122
19174
|
}).extend({
|
|
19123
|
-
outline:
|
|
19175
|
+
outline: z123.array(point),
|
|
19124
19176
|
strokeWidth: length7.optional(),
|
|
19125
|
-
isClosed:
|
|
19126
|
-
isStrokeDashed:
|
|
19127
|
-
color:
|
|
19177
|
+
isClosed: z123.boolean().optional(),
|
|
19178
|
+
isStrokeDashed: z123.boolean().optional(),
|
|
19179
|
+
color: z123.string().optional()
|
|
19128
19180
|
});
|
|
19129
19181
|
|
|
19130
19182
|
// lib/components/courtyard-circle.ts
|
|
@@ -19144,16 +19196,16 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19144
19196
|
});
|
|
19145
19197
|
|
|
19146
19198
|
// lib/components/copper-pour.ts
|
|
19147
|
-
import { z as
|
|
19199
|
+
import { z as z126 } from "zod";
|
|
19148
19200
|
import { layer_ref as layer_ref11 } from "circuit-json";
|
|
19149
|
-
var copperPourProps =
|
|
19150
|
-
name:
|
|
19201
|
+
var copperPourProps = z126.object({
|
|
19202
|
+
name: z126.string().optional(),
|
|
19151
19203
|
layer: layer_ref11,
|
|
19152
|
-
connectsTo:
|
|
19153
|
-
crosshatch:
|
|
19154
|
-
crosshatchPitch: distance.pipe(
|
|
19155
|
-
crosshatchWidth: distance.pipe(
|
|
19156
|
-
unbroken:
|
|
19204
|
+
connectsTo: z126.string(),
|
|
19205
|
+
crosshatch: z126.boolean().optional(),
|
|
19206
|
+
crosshatchPitch: distance.pipe(z126.number().finite().positive()).optional(),
|
|
19207
|
+
crosshatchWidth: distance.pipe(z126.number().finite().positive()).optional(),
|
|
19208
|
+
unbroken: z126.boolean().optional().describe(
|
|
19157
19209
|
"Reserves the pour region during autorouting so unrelated traces do not split it. Vias may still cross the region using antipads."
|
|
19158
19210
|
),
|
|
19159
19211
|
padMargin: distance.optional(),
|
|
@@ -19161,13 +19213,13 @@ var copperPourProps = z124.object({
|
|
|
19161
19213
|
clearance: distance.optional(),
|
|
19162
19214
|
boardEdgeMargin: distance.optional(),
|
|
19163
19215
|
cutoutMargin: distance.optional(),
|
|
19164
|
-
useThermalReliefs:
|
|
19165
|
-
outline:
|
|
19166
|
-
coveredWithSolderMask:
|
|
19216
|
+
useThermalReliefs: z126.boolean().optional(),
|
|
19217
|
+
outline: z126.array(point).optional(),
|
|
19218
|
+
coveredWithSolderMask: z126.boolean().optional().default(true)
|
|
19167
19219
|
}).superRefine((props, ctx) => {
|
|
19168
19220
|
if (props.crosshatch && (props.crosshatchWidth ?? 0.25) >= (props.crosshatchPitch ?? 1)) {
|
|
19169
19221
|
ctx.addIssue({
|
|
19170
|
-
code:
|
|
19222
|
+
code: z126.ZodIssueCode.custom,
|
|
19171
19223
|
path: ["crosshatchWidth"],
|
|
19172
19224
|
message: "crosshatchWidth must be less than crosshatchPitch"
|
|
19173
19225
|
});
|
|
@@ -19177,16 +19229,16 @@ expectTypesMatch(true);
|
|
|
19177
19229
|
|
|
19178
19230
|
// lib/components/cadassembly.ts
|
|
19179
19231
|
import { layer_ref as layer_ref12 } from "circuit-json";
|
|
19180
|
-
import { z as
|
|
19181
|
-
var cadassemblyProps =
|
|
19232
|
+
import { z as z127 } from "zod";
|
|
19233
|
+
var cadassemblyProps = z127.object({
|
|
19182
19234
|
originalLayer: layer_ref12.default("top").optional(),
|
|
19183
|
-
children:
|
|
19235
|
+
children: z127.any().optional()
|
|
19184
19236
|
});
|
|
19185
19237
|
expectTypesMatch(true);
|
|
19186
19238
|
|
|
19187
19239
|
// lib/components/cadmodel.ts
|
|
19188
|
-
import { z as
|
|
19189
|
-
var pcbPosition =
|
|
19240
|
+
import { z as z128 } from "zod";
|
|
19241
|
+
var pcbPosition = z128.object({
|
|
19190
19242
|
pcbX: pcbCoordinate.optional(),
|
|
19191
19243
|
pcbY: pcbCoordinate.optional(),
|
|
19192
19244
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -19203,7 +19255,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
19203
19255
|
});
|
|
19204
19256
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
19205
19257
|
expectTypesMatch(true);
|
|
19206
|
-
var cadmodelProps =
|
|
19258
|
+
var cadmodelProps = z128.union([z128.null(), url, cadModelObject]);
|
|
19207
19259
|
|
|
19208
19260
|
// lib/components/power-source.ts
|
|
19209
19261
|
import { voltage as voltage5 } from "circuit-json";
|
|
@@ -19213,9 +19265,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
19213
19265
|
|
|
19214
19266
|
// lib/components/voltagesource.ts
|
|
19215
19267
|
import { frequency as frequency5, ms as ms4, rotation as rotation6, voltage as voltage6 } from "circuit-json";
|
|
19216
|
-
import { z as
|
|
19268
|
+
import { z as z129 } from "zod";
|
|
19217
19269
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19218
|
-
var percentage =
|
|
19270
|
+
var percentage = z129.union([z129.string(), z129.number()]).transform((val) => {
|
|
19219
19271
|
if (typeof val === "string") {
|
|
19220
19272
|
if (val.endsWith("%")) {
|
|
19221
19273
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19224,13 +19276,13 @@ var percentage = z127.union([z127.string(), z127.number()]).transform((val) => {
|
|
|
19224
19276
|
}
|
|
19225
19277
|
return val;
|
|
19226
19278
|
}).pipe(
|
|
19227
|
-
|
|
19279
|
+
z129.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19228
19280
|
);
|
|
19229
19281
|
var voltageSourceProps = commonComponentProps.extend({
|
|
19230
19282
|
voltage: voltage6.optional(),
|
|
19231
19283
|
frequency: frequency5.optional(),
|
|
19232
19284
|
peakToPeakVoltage: voltage6.optional(),
|
|
19233
|
-
waveShape:
|
|
19285
|
+
waveShape: z129.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19234
19286
|
phase: rotation6.optional(),
|
|
19235
19287
|
dutyCycle: percentage.optional(),
|
|
19236
19288
|
pulseDelay: ms4.optional(),
|
|
@@ -19247,9 +19299,9 @@ expectTypesMatch(true);
|
|
|
19247
19299
|
|
|
19248
19300
|
// lib/components/currentsource.ts
|
|
19249
19301
|
import { frequency as frequency6, rotation as rotation7, current as current3 } from "circuit-json";
|
|
19250
|
-
import { z as
|
|
19302
|
+
import { z as z130 } from "zod";
|
|
19251
19303
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19252
|
-
var percentage2 =
|
|
19304
|
+
var percentage2 = z130.union([z130.string(), z130.number()]).transform((val) => {
|
|
19253
19305
|
if (typeof val === "string") {
|
|
19254
19306
|
if (val.endsWith("%")) {
|
|
19255
19307
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -19258,13 +19310,13 @@ var percentage2 = z128.union([z128.string(), z128.number()]).transform((val) =>
|
|
|
19258
19310
|
}
|
|
19259
19311
|
return val;
|
|
19260
19312
|
}).pipe(
|
|
19261
|
-
|
|
19313
|
+
z130.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
19262
19314
|
);
|
|
19263
19315
|
var currentSourceProps = commonComponentProps.extend({
|
|
19264
19316
|
current: current3.optional(),
|
|
19265
19317
|
frequency: frequency6.optional(),
|
|
19266
19318
|
peakToPeakCurrent: current3.optional(),
|
|
19267
|
-
waveShape:
|
|
19319
|
+
waveShape: z130.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
19268
19320
|
phase: rotation7.optional(),
|
|
19269
19321
|
dutyCycle: percentage2.optional(),
|
|
19270
19322
|
acMagnitude: current3.optional(),
|
|
@@ -19275,21 +19327,21 @@ var currentSourcePins = lrPolarPins;
|
|
|
19275
19327
|
expectTypesMatch(true);
|
|
19276
19328
|
|
|
19277
19329
|
// lib/components/voltageprobe.ts
|
|
19278
|
-
import { z as
|
|
19330
|
+
import { z as z131 } from "zod";
|
|
19279
19331
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
19280
|
-
name:
|
|
19281
|
-
connectsTo:
|
|
19282
|
-
referenceTo:
|
|
19283
|
-
color:
|
|
19284
|
-
graphDisplayName:
|
|
19285
|
-
graphCenter:
|
|
19286
|
-
graphVerticalOffset:
|
|
19287
|
-
graphVoltagePerDiv:
|
|
19332
|
+
name: z131.string().optional(),
|
|
19333
|
+
connectsTo: z131.string(),
|
|
19334
|
+
referenceTo: z131.string().optional(),
|
|
19335
|
+
color: z131.string().optional(),
|
|
19336
|
+
graphDisplayName: z131.string().optional(),
|
|
19337
|
+
graphCenter: z131.number().optional(),
|
|
19338
|
+
graphVerticalOffset: z131.number().or(z131.string()).optional(),
|
|
19339
|
+
graphVoltagePerDiv: z131.number().or(z131.string()).optional()
|
|
19288
19340
|
});
|
|
19289
19341
|
expectTypesMatch(true);
|
|
19290
19342
|
|
|
19291
19343
|
// lib/components/ammeter.ts
|
|
19292
|
-
import { z as
|
|
19344
|
+
import { z as z132 } from "zod";
|
|
19293
19345
|
var ammeterPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
19294
19346
|
var hasAmmeterConnectionPair = (connections) => {
|
|
19295
19347
|
return connections.pos !== void 0 && connections.neg !== void 0 || connections.pin1 !== void 0 && connections.pin2 !== void 0;
|
|
@@ -19299,64 +19351,64 @@ var ammeterProps = commonComponentProps.extend({
|
|
|
19299
19351
|
hasAmmeterConnectionPair,
|
|
19300
19352
|
"Ammeter connections must include either pos/neg or pin1/pin2"
|
|
19301
19353
|
),
|
|
19302
|
-
color:
|
|
19303
|
-
graphDisplayName:
|
|
19304
|
-
graphCenter:
|
|
19305
|
-
graphVerticalOffset:
|
|
19306
|
-
graphCurrentPerDiv:
|
|
19354
|
+
color: z132.string().optional(),
|
|
19355
|
+
graphDisplayName: z132.string().optional(),
|
|
19356
|
+
graphCenter: z132.number().optional(),
|
|
19357
|
+
graphVerticalOffset: z132.number().or(z132.string()).optional(),
|
|
19358
|
+
graphCurrentPerDiv: z132.number().or(z132.string()).optional()
|
|
19307
19359
|
});
|
|
19308
19360
|
var ammeterPins = ammeterPinLabels;
|
|
19309
19361
|
expectTypesMatch(true);
|
|
19310
19362
|
|
|
19311
19363
|
// lib/components/schematic-arc.ts
|
|
19312
19364
|
import { distance as distance34, point as point5, rotation as rotation8 } from "circuit-json";
|
|
19313
|
-
import { z as
|
|
19314
|
-
var schematicArcProps =
|
|
19365
|
+
import { z as z133 } from "zod";
|
|
19366
|
+
var schematicArcProps = z133.object({
|
|
19315
19367
|
center: point5,
|
|
19316
19368
|
radius: distance34,
|
|
19317
19369
|
startAngleDegrees: rotation8,
|
|
19318
19370
|
endAngleDegrees: rotation8,
|
|
19319
|
-
direction:
|
|
19371
|
+
direction: z133.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
19320
19372
|
strokeWidth: distance34.optional(),
|
|
19321
|
-
color:
|
|
19322
|
-
isDashed:
|
|
19373
|
+
color: z133.string().optional(),
|
|
19374
|
+
isDashed: z133.boolean().optional().default(false)
|
|
19323
19375
|
});
|
|
19324
19376
|
expectTypesMatch(true);
|
|
19325
19377
|
|
|
19326
19378
|
// lib/components/toolingrail.ts
|
|
19327
|
-
import { z as
|
|
19328
|
-
var toolingrailProps =
|
|
19329
|
-
children:
|
|
19379
|
+
import { z as z134 } from "zod";
|
|
19380
|
+
var toolingrailProps = z134.object({
|
|
19381
|
+
children: z134.any().optional()
|
|
19330
19382
|
});
|
|
19331
19383
|
expectTypesMatch(true);
|
|
19332
19384
|
|
|
19333
19385
|
// lib/components/schematic-box.ts
|
|
19334
19386
|
import { distance as distance35 } from "circuit-json";
|
|
19335
|
-
import { z as
|
|
19336
|
-
var schematicBoxProps =
|
|
19337
|
-
name:
|
|
19338
|
-
chipRef:
|
|
19387
|
+
import { z as z135 } from "zod";
|
|
19388
|
+
var schematicBoxProps = z135.object({
|
|
19389
|
+
name: z135.string().optional(),
|
|
19390
|
+
chipRef: z135.string().optional(),
|
|
19339
19391
|
pinLabels: pinLabelsProp.optional(),
|
|
19340
19392
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
19341
19393
|
schPinStyle: schematicPinStyle.optional(),
|
|
19342
19394
|
schX: distance35.optional(),
|
|
19343
19395
|
schY: distance35.optional(),
|
|
19344
|
-
schSectionName:
|
|
19345
|
-
schSheetName:
|
|
19396
|
+
schSectionName: z135.string().optional(),
|
|
19397
|
+
schSheetName: z135.string().optional(),
|
|
19346
19398
|
width: distance35.optional(),
|
|
19347
19399
|
height: distance35.optional(),
|
|
19348
|
-
overlay:
|
|
19400
|
+
overlay: z135.array(z135.string()).optional(),
|
|
19349
19401
|
padding: distance35.optional(),
|
|
19350
19402
|
paddingLeft: distance35.optional(),
|
|
19351
19403
|
paddingRight: distance35.optional(),
|
|
19352
19404
|
paddingTop: distance35.optional(),
|
|
19353
19405
|
paddingBottom: distance35.optional(),
|
|
19354
|
-
title:
|
|
19406
|
+
title: z135.string().optional(),
|
|
19355
19407
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
19356
|
-
titleColor:
|
|
19408
|
+
titleColor: z135.string().optional(),
|
|
19357
19409
|
titleFontSize: distance35.optional(),
|
|
19358
|
-
titleInside:
|
|
19359
|
-
strokeStyle:
|
|
19410
|
+
titleInside: z135.boolean().default(false),
|
|
19411
|
+
strokeStyle: z135.enum(["solid", "dashed"]).default("solid")
|
|
19360
19412
|
}).refine(
|
|
19361
19413
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
19362
19414
|
{
|
|
@@ -19372,21 +19424,21 @@ expectTypesMatch(true);
|
|
|
19372
19424
|
|
|
19373
19425
|
// lib/components/schematic-symbol.ts
|
|
19374
19426
|
import { rotation as rotation9 } from "circuit-json";
|
|
19375
|
-
import { z as
|
|
19376
|
-
var schematicSymbolConnections =
|
|
19427
|
+
import { z as z136 } from "zod";
|
|
19428
|
+
var schematicSymbolConnections = z136.custom().pipe(z136.record(z136.string(), connectionTarget)).refine((value) => Object.keys(value).length > 0, {
|
|
19377
19429
|
message: "connections must map at least one schematic symbol port"
|
|
19378
19430
|
});
|
|
19379
|
-
var schematicSymbolProps =
|
|
19380
|
-
name:
|
|
19381
|
-
displayName:
|
|
19382
|
-
chipRef:
|
|
19383
|
-
symbolName:
|
|
19431
|
+
var schematicSymbolProps = z136.object({
|
|
19432
|
+
name: z136.string().min(1),
|
|
19433
|
+
displayName: z136.string().optional(),
|
|
19434
|
+
chipRef: z136.string().min(1).optional(),
|
|
19435
|
+
symbolName: z136.string().min(1),
|
|
19384
19436
|
connections: schematicSymbolConnections.optional(),
|
|
19385
19437
|
schX: distance.optional(),
|
|
19386
19438
|
schY: distance.optional(),
|
|
19387
19439
|
schRotation: rotation9.optional(),
|
|
19388
|
-
schSectionName:
|
|
19389
|
-
schSheetName:
|
|
19440
|
+
schSectionName: z136.string().optional(),
|
|
19441
|
+
schSheetName: z136.string().optional()
|
|
19390
19442
|
});
|
|
19391
19443
|
expectTypesMatch(
|
|
19392
19444
|
true
|
|
@@ -19394,15 +19446,15 @@ expectTypesMatch(
|
|
|
19394
19446
|
|
|
19395
19447
|
// lib/components/schematic-circle.ts
|
|
19396
19448
|
import { distance as distance36, point as point6 } from "circuit-json";
|
|
19397
|
-
import { z as
|
|
19398
|
-
var schematicCircleProps =
|
|
19449
|
+
import { z as z137 } from "zod";
|
|
19450
|
+
var schematicCircleProps = z137.object({
|
|
19399
19451
|
center: point6,
|
|
19400
19452
|
radius: distance36,
|
|
19401
19453
|
strokeWidth: distance36.optional(),
|
|
19402
|
-
color:
|
|
19403
|
-
isFilled:
|
|
19404
|
-
fillColor:
|
|
19405
|
-
isDashed:
|
|
19454
|
+
color: z137.string().optional(),
|
|
19455
|
+
isFilled: z137.boolean().optional().default(false),
|
|
19456
|
+
fillColor: z137.string().optional(),
|
|
19457
|
+
isDashed: z137.boolean().optional().default(false)
|
|
19406
19458
|
});
|
|
19407
19459
|
expectTypesMatch(
|
|
19408
19460
|
true
|
|
@@ -19410,32 +19462,32 @@ expectTypesMatch(
|
|
|
19410
19462
|
|
|
19411
19463
|
// lib/components/schematic-rect.ts
|
|
19412
19464
|
import { distance as distance37, rotation as rotation10 } from "circuit-json";
|
|
19413
|
-
import { z as
|
|
19414
|
-
var schematicRectProps =
|
|
19465
|
+
import { z as z138 } from "zod";
|
|
19466
|
+
var schematicRectProps = z138.object({
|
|
19415
19467
|
schX: distance37.optional(),
|
|
19416
19468
|
schY: distance37.optional(),
|
|
19417
19469
|
width: distance37,
|
|
19418
19470
|
height: distance37,
|
|
19419
19471
|
rotation: rotation10.default(0),
|
|
19420
19472
|
strokeWidth: distance37.optional(),
|
|
19421
|
-
color:
|
|
19422
|
-
isFilled:
|
|
19423
|
-
fillColor:
|
|
19424
|
-
isDashed:
|
|
19473
|
+
color: z138.string().optional(),
|
|
19474
|
+
isFilled: z138.boolean().optional().default(false),
|
|
19475
|
+
fillColor: z138.string().optional(),
|
|
19476
|
+
isDashed: z138.boolean().optional().default(false)
|
|
19425
19477
|
});
|
|
19426
19478
|
expectTypesMatch(true);
|
|
19427
19479
|
|
|
19428
19480
|
// lib/components/schematic-line.ts
|
|
19429
19481
|
import { distance as distance38 } from "circuit-json";
|
|
19430
|
-
import { z as
|
|
19431
|
-
var schematicLineProps =
|
|
19482
|
+
import { z as z139 } from "zod";
|
|
19483
|
+
var schematicLineProps = z139.object({
|
|
19432
19484
|
x1: distance38,
|
|
19433
19485
|
y1: distance38,
|
|
19434
19486
|
x2: distance38,
|
|
19435
19487
|
y2: distance38,
|
|
19436
19488
|
strokeWidth: distance38.optional(),
|
|
19437
|
-
color:
|
|
19438
|
-
isDashed:
|
|
19489
|
+
color: z139.string().optional(),
|
|
19490
|
+
isDashed: z139.boolean().optional().default(false),
|
|
19439
19491
|
dashLength: distance38.optional(),
|
|
19440
19492
|
dashGap: distance38.optional()
|
|
19441
19493
|
});
|
|
@@ -19443,11 +19495,11 @@ expectTypesMatch(true);
|
|
|
19443
19495
|
|
|
19444
19496
|
// lib/components/schematic-text.ts
|
|
19445
19497
|
import { distance as distance39, rotation as rotation11 } from "circuit-json";
|
|
19446
|
-
import { z as
|
|
19498
|
+
import { z as z141 } from "zod";
|
|
19447
19499
|
|
|
19448
19500
|
// lib/common/fivePointAnchor.ts
|
|
19449
|
-
import { z as
|
|
19450
|
-
var fivePointAnchor =
|
|
19501
|
+
import { z as z140 } from "zod";
|
|
19502
|
+
var fivePointAnchor = z140.enum([
|
|
19451
19503
|
"center",
|
|
19452
19504
|
"left",
|
|
19453
19505
|
"right",
|
|
@@ -19456,39 +19508,39 @@ var fivePointAnchor = z138.enum([
|
|
|
19456
19508
|
]);
|
|
19457
19509
|
|
|
19458
19510
|
// lib/components/schematic-text.ts
|
|
19459
|
-
var schematicTextProps =
|
|
19511
|
+
var schematicTextProps = z141.object({
|
|
19460
19512
|
schX: distance39.optional(),
|
|
19461
19513
|
schY: distance39.optional(),
|
|
19462
|
-
text:
|
|
19463
|
-
fontSize:
|
|
19464
|
-
anchor:
|
|
19465
|
-
color:
|
|
19514
|
+
text: z141.string(),
|
|
19515
|
+
fontSize: z141.number().default(1),
|
|
19516
|
+
anchor: z141.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
19517
|
+
color: z141.string().default("#000000"),
|
|
19466
19518
|
schRotation: rotation11.default(0)
|
|
19467
19519
|
});
|
|
19468
19520
|
expectTypesMatch(true);
|
|
19469
19521
|
|
|
19470
19522
|
// lib/components/schematic-path.ts
|
|
19471
19523
|
import { distance as distance40, point as point7 } from "circuit-json";
|
|
19472
|
-
import { z as
|
|
19473
|
-
var schematicPathProps =
|
|
19474
|
-
points:
|
|
19475
|
-
svgPath:
|
|
19524
|
+
import { z as z142 } from "zod";
|
|
19525
|
+
var schematicPathProps = z142.object({
|
|
19526
|
+
points: z142.array(point7).optional(),
|
|
19527
|
+
svgPath: z142.string().optional(),
|
|
19476
19528
|
strokeWidth: distance40.optional(),
|
|
19477
|
-
strokeColor:
|
|
19529
|
+
strokeColor: z142.string().optional(),
|
|
19478
19530
|
dashLength: distance40.optional(),
|
|
19479
19531
|
dashGap: distance40.optional(),
|
|
19480
|
-
isFilled:
|
|
19481
|
-
fillColor:
|
|
19532
|
+
isFilled: z142.boolean().optional().default(false),
|
|
19533
|
+
fillColor: z142.string().optional()
|
|
19482
19534
|
});
|
|
19483
19535
|
expectTypesMatch(true);
|
|
19484
19536
|
|
|
19485
19537
|
// lib/components/schematic-table.ts
|
|
19486
19538
|
import { distance as distance41 } from "circuit-json";
|
|
19487
|
-
import { z as
|
|
19488
|
-
var schematicTableProps =
|
|
19539
|
+
import { z as z143 } from "zod";
|
|
19540
|
+
var schematicTableProps = z143.object({
|
|
19489
19541
|
schX: distance41.optional(),
|
|
19490
19542
|
schY: distance41.optional(),
|
|
19491
|
-
children:
|
|
19543
|
+
children: z143.any().optional(),
|
|
19492
19544
|
cellPadding: distance41.optional(),
|
|
19493
19545
|
borderWidth: distance41.optional(),
|
|
19494
19546
|
anchor: ninePointAnchor.optional(),
|
|
@@ -19498,34 +19550,34 @@ expectTypesMatch(true);
|
|
|
19498
19550
|
|
|
19499
19551
|
// lib/components/schematic-row.ts
|
|
19500
19552
|
import { distance as distance42 } from "circuit-json";
|
|
19501
|
-
import { z as
|
|
19502
|
-
var schematicRowProps =
|
|
19503
|
-
children:
|
|
19553
|
+
import { z as z144 } from "zod";
|
|
19554
|
+
var schematicRowProps = z144.object({
|
|
19555
|
+
children: z144.any().optional(),
|
|
19504
19556
|
height: distance42.optional()
|
|
19505
19557
|
});
|
|
19506
19558
|
expectTypesMatch(true);
|
|
19507
19559
|
|
|
19508
19560
|
// lib/components/schematic-cell.ts
|
|
19509
19561
|
import { distance as distance43 } from "circuit-json";
|
|
19510
|
-
import { z as
|
|
19511
|
-
var schematicCellProps =
|
|
19512
|
-
children:
|
|
19513
|
-
horizontalAlign:
|
|
19514
|
-
verticalAlign:
|
|
19562
|
+
import { z as z145 } from "zod";
|
|
19563
|
+
var schematicCellProps = z145.object({
|
|
19564
|
+
children: z145.string().optional(),
|
|
19565
|
+
horizontalAlign: z145.enum(["left", "center", "right"]).optional(),
|
|
19566
|
+
verticalAlign: z145.enum(["top", "middle", "bottom"]).optional(),
|
|
19515
19567
|
fontSize: distance43.optional(),
|
|
19516
|
-
rowSpan:
|
|
19517
|
-
colSpan:
|
|
19568
|
+
rowSpan: z145.number().optional(),
|
|
19569
|
+
colSpan: z145.number().optional(),
|
|
19518
19570
|
width: distance43.optional(),
|
|
19519
|
-
text:
|
|
19571
|
+
text: z145.string().optional()
|
|
19520
19572
|
});
|
|
19521
19573
|
expectTypesMatch(true);
|
|
19522
19574
|
|
|
19523
19575
|
// lib/components/schematic-section.ts
|
|
19524
19576
|
import { distance as distance44 } from "circuit-json";
|
|
19525
|
-
import { z as
|
|
19526
|
-
var schematicSectionProps =
|
|
19527
|
-
displayName:
|
|
19528
|
-
name:
|
|
19577
|
+
import { z as z146 } from "zod";
|
|
19578
|
+
var schematicSectionProps = z146.object({
|
|
19579
|
+
displayName: z146.string().optional(),
|
|
19580
|
+
name: z146.string(),
|
|
19529
19581
|
sectionTitleFontSize: distance44.optional()
|
|
19530
19582
|
});
|
|
19531
19583
|
expectTypesMatch(
|
|
@@ -19533,30 +19585,30 @@ expectTypesMatch(
|
|
|
19533
19585
|
);
|
|
19534
19586
|
|
|
19535
19587
|
// lib/components/schematic-sheet.ts
|
|
19536
|
-
import { z as
|
|
19588
|
+
import { z as z147 } from "zod";
|
|
19537
19589
|
import { distance as distance45 } from "circuit-json";
|
|
19538
|
-
var schematicSheetProps =
|
|
19539
|
-
name:
|
|
19540
|
-
displayName:
|
|
19541
|
-
sheetIndex:
|
|
19542
|
-
sheetSize:
|
|
19543
|
-
sheetWidth: distance45.pipe(
|
|
19544
|
-
sheetHeight: distance45.pipe(
|
|
19545
|
-
children:
|
|
19590
|
+
var schematicSheetProps = z147.object({
|
|
19591
|
+
name: z147.string().optional(),
|
|
19592
|
+
displayName: z147.string().optional(),
|
|
19593
|
+
sheetIndex: z147.number().optional(),
|
|
19594
|
+
sheetSize: z147.enum(["A4", "ANSI_B"]).default("A4"),
|
|
19595
|
+
sheetWidth: distance45.pipe(z147.number().positive()).optional(),
|
|
19596
|
+
sheetHeight: distance45.pipe(z147.number().positive()).optional(),
|
|
19597
|
+
children: z147.any().optional()
|
|
19546
19598
|
});
|
|
19547
19599
|
expectTypesMatch(true);
|
|
19548
19600
|
|
|
19549
19601
|
// lib/components/schematic-graphic.ts
|
|
19550
|
-
import { z as
|
|
19602
|
+
import { z as z148 } from "zod";
|
|
19551
19603
|
var nonemptyUrl = url.refine((value) => value.trim().length > 0, {
|
|
19552
19604
|
message: "imageUrl cannot be empty"
|
|
19553
19605
|
});
|
|
19554
19606
|
var positiveDistance5 = (fieldName) => distance.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19555
19607
|
message: `${fieldName} must be a positive finite distance`
|
|
19556
19608
|
});
|
|
19557
|
-
var schematicGraphicProps =
|
|
19609
|
+
var schematicGraphicProps = z148.object({
|
|
19558
19610
|
imageUrl: nonemptyUrl.optional(),
|
|
19559
|
-
svgContent:
|
|
19611
|
+
svgContent: z148.string().refine((value) => value.trim().length > 0, {
|
|
19560
19612
|
message: "svgContent cannot be empty"
|
|
19561
19613
|
}).optional(),
|
|
19562
19614
|
width: positiveDistance5("width").optional(),
|
|
@@ -19564,7 +19616,7 @@ var schematicGraphicProps = z146.object({
|
|
|
19564
19616
|
}).superRefine(({ imageUrl, svgContent }, ctx) => {
|
|
19565
19617
|
if (imageUrl === void 0 && svgContent === void 0) {
|
|
19566
19618
|
ctx.addIssue({
|
|
19567
|
-
code:
|
|
19619
|
+
code: z148.ZodIssueCode.custom,
|
|
19568
19620
|
message: "At least one of imageUrl or svgContent is required"
|
|
19569
19621
|
});
|
|
19570
19622
|
}
|
|
@@ -19575,40 +19627,40 @@ expectTypesMatch(
|
|
|
19575
19627
|
|
|
19576
19628
|
// lib/components/copper-text.ts
|
|
19577
19629
|
import { layer_ref as layer_ref13, length as length8 } from "circuit-json";
|
|
19578
|
-
import { z as
|
|
19630
|
+
import { z as z149 } from "zod";
|
|
19579
19631
|
var copperTextProps = pcbLayoutProps.extend({
|
|
19580
|
-
text:
|
|
19632
|
+
text: z149.string(),
|
|
19581
19633
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19582
|
-
font:
|
|
19634
|
+
font: z149.enum(["tscircuit2024"]).optional(),
|
|
19583
19635
|
fontSize: length8.optional(),
|
|
19584
|
-
layers:
|
|
19585
|
-
knockout:
|
|
19586
|
-
mirrored:
|
|
19636
|
+
layers: z149.array(layer_ref13).optional(),
|
|
19637
|
+
knockout: z149.boolean().optional(),
|
|
19638
|
+
mirrored: z149.boolean().optional()
|
|
19587
19639
|
});
|
|
19588
19640
|
|
|
19589
19641
|
// lib/components/silkscreen-text.ts
|
|
19590
19642
|
import { layer_ref as layer_ref14, length as length9 } from "circuit-json";
|
|
19591
|
-
import { z as
|
|
19643
|
+
import { z as z150 } from "zod";
|
|
19592
19644
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
19593
|
-
text:
|
|
19645
|
+
text: z150.string(),
|
|
19594
19646
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
19595
|
-
font:
|
|
19647
|
+
font: z150.enum(["tscircuit2024"]).optional(),
|
|
19596
19648
|
fontSize: length9.optional(),
|
|
19597
19649
|
/**
|
|
19598
19650
|
* If true, text will knock out underlying silkscreen
|
|
19599
19651
|
*/
|
|
19600
|
-
isKnockout:
|
|
19652
|
+
isKnockout: z150.boolean().optional(),
|
|
19601
19653
|
knockoutPadding: length9.optional(),
|
|
19602
19654
|
knockoutPaddingLeft: length9.optional(),
|
|
19603
19655
|
knockoutPaddingRight: length9.optional(),
|
|
19604
19656
|
knockoutPaddingTop: length9.optional(),
|
|
19605
19657
|
knockoutPaddingBottom: length9.optional(),
|
|
19606
|
-
layers:
|
|
19658
|
+
layers: z150.array(layer_ref14).optional()
|
|
19607
19659
|
});
|
|
19608
19660
|
|
|
19609
19661
|
// lib/components/silkscreen-path.ts
|
|
19610
19662
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
19611
|
-
import { z as
|
|
19663
|
+
import { z as z151 } from "zod";
|
|
19612
19664
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
19613
19665
|
pcbLeftEdgeX: true,
|
|
19614
19666
|
pcbRightEdgeX: true,
|
|
@@ -19620,7 +19672,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
19620
19672
|
pcbOffsetY: true,
|
|
19621
19673
|
pcbRotation: true
|
|
19622
19674
|
}).extend({
|
|
19623
|
-
route:
|
|
19675
|
+
route: z151.array(route_hint_point5),
|
|
19624
19676
|
strokeWidth: length10.optional()
|
|
19625
19677
|
});
|
|
19626
19678
|
|
|
@@ -19642,10 +19694,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
19642
19694
|
|
|
19643
19695
|
// lib/components/silkscreen-rect.ts
|
|
19644
19696
|
import { distance as distance47 } from "circuit-json";
|
|
19645
|
-
import { z as
|
|
19697
|
+
import { z as z152 } from "zod";
|
|
19646
19698
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19647
|
-
filled:
|
|
19648
|
-
stroke:
|
|
19699
|
+
filled: z152.boolean().default(true).optional(),
|
|
19700
|
+
stroke: z152.enum(["dashed", "solid", "none"]).optional(),
|
|
19649
19701
|
strokeWidth: distance47.optional(),
|
|
19650
19702
|
width: distance47,
|
|
19651
19703
|
height: distance47,
|
|
@@ -19654,10 +19706,10 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
19654
19706
|
|
|
19655
19707
|
// lib/components/silkscreen-circle.ts
|
|
19656
19708
|
import { distance as distance48 } from "circuit-json";
|
|
19657
|
-
import { z as
|
|
19709
|
+
import { z as z153 } from "zod";
|
|
19658
19710
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19659
|
-
isFilled:
|
|
19660
|
-
isOutline:
|
|
19711
|
+
isFilled: z153.boolean().optional(),
|
|
19712
|
+
isOutline: z153.boolean().optional(),
|
|
19661
19713
|
strokeWidth: distance48.optional(),
|
|
19662
19714
|
radius: distance48
|
|
19663
19715
|
});
|
|
@@ -19675,69 +19727,69 @@ expectTypesMatch(true);
|
|
|
19675
19727
|
|
|
19676
19728
|
// lib/components/trace-hint.ts
|
|
19677
19729
|
import { distance as distance49, layer_ref as layer_ref15, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
19678
|
-
import { z as
|
|
19679
|
-
var routeHintPointProps =
|
|
19730
|
+
import { z as z155 } from "zod";
|
|
19731
|
+
var routeHintPointProps = z155.object({
|
|
19680
19732
|
x: distance49,
|
|
19681
19733
|
y: distance49,
|
|
19682
|
-
via:
|
|
19734
|
+
via: z155.boolean().optional(),
|
|
19683
19735
|
toLayer: layer_ref15.optional()
|
|
19684
19736
|
});
|
|
19685
|
-
var traceHintProps =
|
|
19686
|
-
for:
|
|
19737
|
+
var traceHintProps = z155.object({
|
|
19738
|
+
for: z155.string().optional().describe(
|
|
19687
19739
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
19688
19740
|
),
|
|
19689
|
-
order:
|
|
19741
|
+
order: z155.number().optional(),
|
|
19690
19742
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
19691
|
-
offsets:
|
|
19692
|
-
traceWidth:
|
|
19743
|
+
offsets: z155.array(route_hint_point6).or(z155.array(routeHintPointProps)).optional(),
|
|
19744
|
+
traceWidth: z155.number().optional()
|
|
19693
19745
|
});
|
|
19694
19746
|
|
|
19695
19747
|
// lib/components/port.ts
|
|
19696
19748
|
import { distance as distance50 } from "circuit-json";
|
|
19697
|
-
import { z as
|
|
19749
|
+
import { z as z156 } from "zod";
|
|
19698
19750
|
var portProps = commonLayoutProps.extend({
|
|
19699
|
-
name:
|
|
19700
|
-
pinNumber:
|
|
19701
|
-
schStemLength:
|
|
19702
|
-
schPinLabelFontSize:
|
|
19751
|
+
name: z156.string().optional(),
|
|
19752
|
+
pinNumber: z156.number().optional(),
|
|
19753
|
+
schStemLength: z156.number().optional(),
|
|
19754
|
+
schPinLabelFontSize: z156.enum(["default", "sm"]).or(
|
|
19703
19755
|
distance50.refine((value) => Number.isFinite(value) && value > 0, {
|
|
19704
19756
|
message: "Schematic pin-label font size must be positive and finite"
|
|
19705
19757
|
})
|
|
19706
19758
|
).optional(),
|
|
19707
|
-
aliases:
|
|
19708
|
-
layer:
|
|
19709
|
-
layers:
|
|
19710
|
-
schX:
|
|
19711
|
-
schY:
|
|
19759
|
+
aliases: z156.array(z156.string()).optional(),
|
|
19760
|
+
layer: z156.string().optional(),
|
|
19761
|
+
layers: z156.array(z156.string()).optional(),
|
|
19762
|
+
schX: z156.number().optional(),
|
|
19763
|
+
schY: z156.number().optional(),
|
|
19712
19764
|
direction: direction.optional(),
|
|
19713
|
-
connectsTo:
|
|
19765
|
+
connectsTo: z156.string().or(z156.array(z156.string())).optional(),
|
|
19714
19766
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
19715
|
-
hasInversionCircle:
|
|
19767
|
+
hasInversionCircle: z156.boolean().optional()
|
|
19716
19768
|
});
|
|
19717
19769
|
|
|
19718
19770
|
// lib/components/pcb-note-text.ts
|
|
19719
19771
|
import { length as length11 } from "circuit-json";
|
|
19720
|
-
import { z as
|
|
19772
|
+
import { z as z157 } from "zod";
|
|
19721
19773
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
19722
|
-
text:
|
|
19723
|
-
anchorAlignment:
|
|
19724
|
-
font:
|
|
19774
|
+
text: z157.string(),
|
|
19775
|
+
anchorAlignment: z157.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
19776
|
+
font: z157.enum(["tscircuit2024"]).optional(),
|
|
19725
19777
|
fontSize: length11.optional(),
|
|
19726
|
-
color:
|
|
19778
|
+
color: z157.string().optional()
|
|
19727
19779
|
});
|
|
19728
19780
|
expectTypesMatch(true);
|
|
19729
19781
|
|
|
19730
19782
|
// lib/components/pcb-note-rect.ts
|
|
19731
19783
|
import { distance as distance51 } from "circuit-json";
|
|
19732
|
-
import { z as
|
|
19784
|
+
import { z as z158 } from "zod";
|
|
19733
19785
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
19734
19786
|
width: distance51,
|
|
19735
19787
|
height: distance51,
|
|
19736
19788
|
strokeWidth: distance51.optional(),
|
|
19737
|
-
isFilled:
|
|
19738
|
-
hasStroke:
|
|
19739
|
-
isStrokeDashed:
|
|
19740
|
-
color:
|
|
19789
|
+
isFilled: z158.boolean().optional(),
|
|
19790
|
+
hasStroke: z158.boolean().optional(),
|
|
19791
|
+
isStrokeDashed: z158.boolean().optional(),
|
|
19792
|
+
color: z158.string().optional(),
|
|
19741
19793
|
cornerRadius: distance51.optional()
|
|
19742
19794
|
});
|
|
19743
19795
|
expectTypesMatch(true);
|
|
@@ -19747,7 +19799,7 @@ import {
|
|
|
19747
19799
|
length as length12,
|
|
19748
19800
|
route_hint_point as route_hint_point7
|
|
19749
19801
|
} from "circuit-json";
|
|
19750
|
-
import { z as
|
|
19802
|
+
import { z as z159 } from "zod";
|
|
19751
19803
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
19752
19804
|
pcbLeftEdgeX: true,
|
|
19753
19805
|
pcbRightEdgeX: true,
|
|
@@ -19759,15 +19811,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
19759
19811
|
pcbOffsetY: true,
|
|
19760
19812
|
pcbRotation: true
|
|
19761
19813
|
}).extend({
|
|
19762
|
-
route:
|
|
19814
|
+
route: z159.array(route_hint_point7),
|
|
19763
19815
|
strokeWidth: length12.optional(),
|
|
19764
|
-
color:
|
|
19816
|
+
color: z159.string().optional()
|
|
19765
19817
|
});
|
|
19766
19818
|
expectTypesMatch(true);
|
|
19767
19819
|
|
|
19768
19820
|
// lib/components/pcb-note-line.ts
|
|
19769
19821
|
import { distance as distance52 } from "circuit-json";
|
|
19770
|
-
import { z as
|
|
19822
|
+
import { z as z160 } from "zod";
|
|
19771
19823
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
19772
19824
|
pcbLeftEdgeX: true,
|
|
19773
19825
|
pcbRightEdgeX: true,
|
|
@@ -19784,15 +19836,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
19784
19836
|
x2: distance52,
|
|
19785
19837
|
y2: distance52,
|
|
19786
19838
|
strokeWidth: distance52.optional(),
|
|
19787
|
-
color:
|
|
19788
|
-
isDashed:
|
|
19839
|
+
color: z160.string().optional(),
|
|
19840
|
+
isDashed: z160.boolean().optional()
|
|
19789
19841
|
});
|
|
19790
19842
|
expectTypesMatch(true);
|
|
19791
19843
|
|
|
19792
19844
|
// lib/components/pcb-note-dimension.ts
|
|
19793
19845
|
import { distance as distance53, length as length13 } from "circuit-json";
|
|
19794
|
-
import { z as
|
|
19795
|
-
var dimensionTarget2 =
|
|
19846
|
+
import { z as z161 } from "zod";
|
|
19847
|
+
var dimensionTarget2 = z161.union([z161.string(), point]);
|
|
19796
19848
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
19797
19849
|
pcbLeftEdgeX: true,
|
|
19798
19850
|
pcbRightEdgeX: true,
|
|
@@ -19806,114 +19858,114 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
19806
19858
|
}).extend({
|
|
19807
19859
|
from: dimensionTarget2,
|
|
19808
19860
|
to: dimensionTarget2,
|
|
19809
|
-
text:
|
|
19861
|
+
text: z161.string().optional(),
|
|
19810
19862
|
offset: distance53.optional(),
|
|
19811
|
-
offsetDirection:
|
|
19812
|
-
font:
|
|
19863
|
+
offsetDirection: z161.object({ x: z161.number().finite(), y: z161.number().finite() }).optional(),
|
|
19864
|
+
font: z161.enum(["tscircuit2024"]).optional(),
|
|
19813
19865
|
fontSize: length13.optional(),
|
|
19814
|
-
color:
|
|
19866
|
+
color: z161.string().optional(),
|
|
19815
19867
|
arrowSize: distance53.optional(),
|
|
19816
|
-
units:
|
|
19817
|
-
outerEdgeToEdge:
|
|
19818
|
-
centerToCenter:
|
|
19819
|
-
innerEdgeToEdge:
|
|
19868
|
+
units: z161.enum(["in", "mm"]).optional(),
|
|
19869
|
+
outerEdgeToEdge: z161.literal(true).optional(),
|
|
19870
|
+
centerToCenter: z161.literal(true).optional(),
|
|
19871
|
+
innerEdgeToEdge: z161.literal(true).optional()
|
|
19820
19872
|
});
|
|
19821
19873
|
expectTypesMatch(
|
|
19822
19874
|
true
|
|
19823
19875
|
);
|
|
19824
19876
|
|
|
19825
19877
|
// lib/platformConfig.ts
|
|
19826
|
-
import { z as
|
|
19827
|
-
var unvalidatedCircuitJson =
|
|
19828
|
-
var footprintLibraryResult =
|
|
19829
|
-
footprintCircuitJson:
|
|
19878
|
+
import { z as z162 } from "zod";
|
|
19879
|
+
var unvalidatedCircuitJson = z162.array(z162.any()).describe("Circuit JSON");
|
|
19880
|
+
var footprintLibraryResult = z162.object({
|
|
19881
|
+
footprintCircuitJson: z162.array(z162.any()),
|
|
19830
19882
|
cadModel: cadModelProp.optional()
|
|
19831
19883
|
});
|
|
19832
|
-
var pathToCircuitJsonFn =
|
|
19833
|
-
|
|
19834
|
-
|
|
19835
|
-
|
|
19836
|
-
).returns(
|
|
19884
|
+
var pathToCircuitJsonFn = z162.function().args(z162.string()).returns(z162.promise(footprintLibraryResult)).or(
|
|
19885
|
+
z162.function().args(
|
|
19886
|
+
z162.string(),
|
|
19887
|
+
z162.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
19888
|
+
).returns(z162.promise(footprintLibraryResult))
|
|
19837
19889
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
19838
|
-
var footprintFileParserEntry =
|
|
19839
|
-
loadFromUrl:
|
|
19890
|
+
var footprintFileParserEntry = z162.object({
|
|
19891
|
+
loadFromUrl: z162.function().args(z162.string()).returns(z162.promise(footprintLibraryResult)).describe(
|
|
19840
19892
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
19841
19893
|
)
|
|
19842
19894
|
});
|
|
19843
|
-
var spiceEngineSimulationResult =
|
|
19844
|
-
engineVersionString:
|
|
19895
|
+
var spiceEngineSimulationResult = z162.object({
|
|
19896
|
+
engineVersionString: z162.string().optional(),
|
|
19845
19897
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
19846
19898
|
});
|
|
19847
|
-
var spiceEngineZod =
|
|
19848
|
-
simulate:
|
|
19899
|
+
var spiceEngineZod = z162.object({
|
|
19900
|
+
simulate: z162.function().args(z162.string()).returns(z162.promise(spiceEngineSimulationResult)).describe(
|
|
19849
19901
|
"A function that takes a SPICE string and returns a simulation result"
|
|
19850
19902
|
)
|
|
19851
19903
|
});
|
|
19852
|
-
var defaultSpiceEngine =
|
|
19904
|
+
var defaultSpiceEngine = z162.custom(
|
|
19853
19905
|
(value) => typeof value === "string"
|
|
19854
19906
|
);
|
|
19855
|
-
var autorouterInstance =
|
|
19856
|
-
run:
|
|
19857
|
-
getOutputSimpleRouteJson:
|
|
19907
|
+
var autorouterInstance = z162.object({
|
|
19908
|
+
run: z162.function().args().returns(z162.promise(z162.unknown())).describe("Run the autorouter"),
|
|
19909
|
+
getOutputSimpleRouteJson: z162.function().args().returns(z162.promise(z162.any())).describe("Get the resulting SimpleRouteJson")
|
|
19858
19910
|
});
|
|
19859
|
-
var autorouterDefinition =
|
|
19860
|
-
createAutorouter:
|
|
19911
|
+
var autorouterDefinition = z162.object({
|
|
19912
|
+
createAutorouter: z162.function().args(z162.any(), z162.any().optional()).returns(z162.union([autorouterInstance, z162.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
19861
19913
|
});
|
|
19862
|
-
var platformFetch =
|
|
19863
|
-
var localCacheEngine =
|
|
19914
|
+
var platformFetch = z162.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
19915
|
+
var localCacheEngine = z162.custom(
|
|
19864
19916
|
(value) => typeof value === "object" && value !== null && "getItem" in value && typeof value.getItem === "function" && "setItem" in value && typeof value.setItem === "function"
|
|
19865
19917
|
);
|
|
19866
|
-
var fabricatorEngine =
|
|
19918
|
+
var fabricatorEngine = z162.custom(
|
|
19867
19919
|
(value) => typeof value === "object" && value !== null && "runDrcChecks" in value && typeof value.runDrcChecks === "function"
|
|
19868
19920
|
);
|
|
19869
|
-
var platformConfig =
|
|
19921
|
+
var platformConfig = z162.object({
|
|
19870
19922
|
partsEngine: partsEngine.optional(),
|
|
19871
19923
|
fabricatorEngine: fabricatorEngine.optional(),
|
|
19872
19924
|
autorouter: autorouterProp.optional(),
|
|
19873
|
-
autorouterMap:
|
|
19874
|
-
allowLegacyAutorouters:
|
|
19925
|
+
autorouterMap: z162.record(z162.string(), autorouterDefinition).optional(),
|
|
19926
|
+
allowLegacyAutorouters: z162.boolean().optional(),
|
|
19875
19927
|
registryApiUrl: url.optional(),
|
|
19876
19928
|
cloudAutorouterUrl: url.optional(),
|
|
19877
|
-
projectName:
|
|
19929
|
+
projectName: z162.string().optional(),
|
|
19878
19930
|
projectBaseUrl: url.optional(),
|
|
19879
|
-
version:
|
|
19931
|
+
version: z162.string().optional(),
|
|
19880
19932
|
url: url.optional(),
|
|
19881
|
-
printBoardInformationToSilkscreen:
|
|
19882
|
-
includeBoardFiles:
|
|
19933
|
+
printBoardInformationToSilkscreen: z162.boolean().optional(),
|
|
19934
|
+
includeBoardFiles: z162.array(z162.string()).describe(
|
|
19883
19935
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
19884
19936
|
).optional(),
|
|
19885
|
-
snapshotsDir:
|
|
19937
|
+
snapshotsDir: z162.string().describe(
|
|
19886
19938
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
19887
19939
|
).optional(),
|
|
19888
19940
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
19889
|
-
unitPreference:
|
|
19941
|
+
unitPreference: z162.enum(["mm", "in", "mil"]).optional(),
|
|
19890
19942
|
localCacheEngine: localCacheEngine.optional(),
|
|
19891
|
-
useCloudAutorouter:
|
|
19892
|
-
enablePartOrientationAnalysis:
|
|
19893
|
-
pcbPackSolverTimeoutMs:
|
|
19894
|
-
pcbDisabled:
|
|
19895
|
-
routingDisabled:
|
|
19896
|
-
schematicDisabled:
|
|
19897
|
-
partsEngineDisabled:
|
|
19898
|
-
analogSimulationDisabled:
|
|
19899
|
-
drcChecksDisabled:
|
|
19900
|
-
netlistDrcChecksDisabled:
|
|
19901
|
-
routingDrcChecksDisabled:
|
|
19902
|
-
placementDrcChecksDisabled:
|
|
19903
|
-
pinSpecificationDrcChecksDisabled:
|
|
19904
|
-
spiceEngineMap:
|
|
19905
|
-
footprintLibraryMap:
|
|
19906
|
-
|
|
19907
|
-
|
|
19943
|
+
useCloudAutorouter: z162.boolean().optional(),
|
|
19944
|
+
enablePartOrientationAnalysis: z162.boolean().optional(),
|
|
19945
|
+
pcbPackSolverTimeoutMs: z162.number().finite().positive().optional(),
|
|
19946
|
+
pcbDisabled: z162.boolean().optional(),
|
|
19947
|
+
routingDisabled: z162.boolean().optional(),
|
|
19948
|
+
schematicDisabled: z162.boolean().optional(),
|
|
19949
|
+
partsEngineDisabled: z162.boolean().optional(),
|
|
19950
|
+
analogSimulationDisabled: z162.boolean().optional(),
|
|
19951
|
+
drcChecksDisabled: z162.boolean().optional(),
|
|
19952
|
+
netlistDrcChecksDisabled: z162.boolean().optional(),
|
|
19953
|
+
routingDrcChecksDisabled: z162.boolean().optional(),
|
|
19954
|
+
placementDrcChecksDisabled: z162.boolean().optional(),
|
|
19955
|
+
pinSpecificationDrcChecksDisabled: z162.boolean().optional(),
|
|
19956
|
+
spiceEngineMap: z162.record(z162.string(), spiceEngineZod).optional(),
|
|
19957
|
+
footprintLibraryMap: z162.record(
|
|
19958
|
+
z162.string(),
|
|
19959
|
+
z162.union([
|
|
19908
19960
|
pathToCircuitJsonFn,
|
|
19909
|
-
|
|
19910
|
-
|
|
19911
|
-
|
|
19961
|
+
z162.record(
|
|
19962
|
+
z162.string(),
|
|
19963
|
+
z162.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
19912
19964
|
)
|
|
19913
19965
|
])
|
|
19914
19966
|
).optional(),
|
|
19915
|
-
footprintFileParserMap:
|
|
19916
|
-
resolveProjectStaticFileImportUrl:
|
|
19967
|
+
footprintFileParserMap: z162.record(z162.string(), footprintFileParserEntry).optional(),
|
|
19968
|
+
resolveProjectStaticFileImportUrl: z162.function().args(z162.string()).returns(z162.promise(z162.string())).describe(
|
|
19917
19969
|
"A function that returns a string URL for static files for the project"
|
|
19918
19970
|
).optional(),
|
|
19919
19971
|
platformFetch: platformFetch.optional()
|
|
@@ -19958,9 +20010,11 @@ export {
|
|
|
19958
20010
|
antennaProps,
|
|
19959
20011
|
antennaShape,
|
|
19960
20012
|
antennaShapes,
|
|
20013
|
+
assemblyCableProps,
|
|
19961
20014
|
assemblyCadAssemblyProps,
|
|
19962
20015
|
assemblyDeviceProps,
|
|
19963
20016
|
assemblyMotorProps,
|
|
20017
|
+
assemblyPrintedPartProps,
|
|
19964
20018
|
assemblyProps,
|
|
19965
20019
|
assemblyScreenProps,
|
|
19966
20020
|
assemblySubassemblyProps,
|