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