@tscircuit/props 0.0.491 → 0.0.492
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 +276 -107
- package/dist/index.js +847 -863
- package/dist/index.js.map +1 -1
- package/lib/common/layout.ts +1 -123
- package/lib/common/pinAttributeMap.ts +77 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -30,7 +30,7 @@ import {
|
|
|
30
30
|
rotation as rotation2,
|
|
31
31
|
supplier_name
|
|
32
32
|
} from "circuit-json";
|
|
33
|
-
import { z as
|
|
33
|
+
import { z as z16 } from "zod";
|
|
34
34
|
|
|
35
35
|
// lib/common/cadModel.ts
|
|
36
36
|
import { z as z6 } from "zod";
|
|
@@ -284,21 +284,63 @@ var pcbSx = z12.record(
|
|
|
284
284
|
);
|
|
285
285
|
expectTypesMatch(true);
|
|
286
286
|
|
|
287
|
+
// lib/common/pinAttributeMap.ts
|
|
288
|
+
import { z as z13 } from "zod";
|
|
289
|
+
var pinCapability = z13.enum([
|
|
290
|
+
"i2c_sda",
|
|
291
|
+
"i2c_scl",
|
|
292
|
+
"spi_cs",
|
|
293
|
+
"spi_sck",
|
|
294
|
+
"spi_mosi",
|
|
295
|
+
"spi_miso",
|
|
296
|
+
"uart_tx",
|
|
297
|
+
"uart_rx"
|
|
298
|
+
]);
|
|
299
|
+
var pinAttributeMap = z13.object({
|
|
300
|
+
capabilities: z13.array(pinCapability).optional(),
|
|
301
|
+
activeCapabilities: z13.array(pinCapability).optional(),
|
|
302
|
+
activeCapability: pinCapability.optional(),
|
|
303
|
+
providesPower: z13.boolean().optional(),
|
|
304
|
+
requiresPower: z13.boolean().optional(),
|
|
305
|
+
providesGround: z13.boolean().optional(),
|
|
306
|
+
requiresGround: z13.boolean().optional(),
|
|
307
|
+
providesVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
308
|
+
requiresVoltage: z13.union([z13.string(), z13.number()]).optional(),
|
|
309
|
+
doNotConnect: z13.boolean().optional(),
|
|
310
|
+
includeInBoardPinout: z13.boolean().optional(),
|
|
311
|
+
highlightColor: z13.string().optional(),
|
|
312
|
+
mustBeConnected: z13.boolean().optional(),
|
|
313
|
+
canUseInternalPullup: z13.boolean().optional(),
|
|
314
|
+
isUsingInternalPullup: z13.boolean().optional(),
|
|
315
|
+
needsExternalPullup: z13.boolean().optional(),
|
|
316
|
+
canUseInternalPulldown: z13.boolean().optional(),
|
|
317
|
+
isUsingInternalPulldown: z13.boolean().optional(),
|
|
318
|
+
needsExternalPulldown: z13.boolean().optional(),
|
|
319
|
+
canUseOpenDrain: z13.boolean().optional(),
|
|
320
|
+
isUsingOpenDrain: z13.boolean().optional(),
|
|
321
|
+
canUsePushPull: z13.boolean().optional(),
|
|
322
|
+
isUsingPushPull: z13.boolean().optional(),
|
|
323
|
+
shouldHaveDecouplingCapacitor: z13.boolean().optional(),
|
|
324
|
+
recommendedDecouplingCapacitorCapacitance: z13.union([z13.string(), z13.number()]).optional(),
|
|
325
|
+
isGpio: z13.boolean().optional()
|
|
326
|
+
});
|
|
327
|
+
expectTypesMatch(true);
|
|
328
|
+
|
|
287
329
|
// lib/common/schStyle.ts
|
|
288
330
|
import { distance as distance7 } from "circuit-json";
|
|
289
|
-
import { z as
|
|
290
|
-
var schStyle =
|
|
291
|
-
defaultPassiveSize:
|
|
292
|
-
defaultCapacitorOrientation:
|
|
331
|
+
import { z as z14 } from "zod";
|
|
332
|
+
var schStyle = z14.object({
|
|
333
|
+
defaultPassiveSize: z14.union([z14.enum(["xs", "sm", "md"]), distance7]).optional(),
|
|
334
|
+
defaultCapacitorOrientation: z14.enum(["vertical", "none"]).optional()
|
|
293
335
|
});
|
|
294
336
|
expectTypesMatch(true);
|
|
295
337
|
|
|
296
338
|
// lib/common/symbolProp.ts
|
|
297
|
-
import { z as
|
|
298
|
-
var symbolProp =
|
|
339
|
+
import { z as z15 } from "zod";
|
|
340
|
+
var symbolProp = z15.custom((v) => true);
|
|
299
341
|
|
|
300
342
|
// lib/common/layout.ts
|
|
301
|
-
var pcbLayoutProps =
|
|
343
|
+
var pcbLayoutProps = z16.object({
|
|
302
344
|
pcbX: pcbCoordinate.optional(),
|
|
303
345
|
pcbY: pcbCoordinate.optional(),
|
|
304
346
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -308,14 +350,14 @@ var pcbLayoutProps = z15.object({
|
|
|
308
350
|
pcbOffsetX: distance8.optional(),
|
|
309
351
|
pcbOffsetY: distance8.optional(),
|
|
310
352
|
pcbRotation: rotation2.optional(),
|
|
311
|
-
pcbPositionAnchor:
|
|
312
|
-
pcbPositionMode:
|
|
353
|
+
pcbPositionAnchor: z16.string().optional(),
|
|
354
|
+
pcbPositionMode: z16.enum([
|
|
313
355
|
"relative_to_group_anchor",
|
|
314
356
|
"auto",
|
|
315
357
|
"relative_to_board_anchor",
|
|
316
358
|
"relative_to_component_anchor"
|
|
317
359
|
]).optional(),
|
|
318
|
-
shouldBeOnEdgeOfBoard:
|
|
360
|
+
shouldBeOnEdgeOfBoard: z16.boolean().optional(),
|
|
319
361
|
layer: layer_ref.optional(),
|
|
320
362
|
pcbMarginTop: distance8.optional(),
|
|
321
363
|
pcbMarginRight: distance8.optional(),
|
|
@@ -325,11 +367,11 @@ var pcbLayoutProps = z15.object({
|
|
|
325
367
|
pcbMarginY: distance8.optional(),
|
|
326
368
|
pcbStyle: pcbStyle.optional(),
|
|
327
369
|
pcbSx: pcbSx.optional(),
|
|
328
|
-
pcbRelative:
|
|
329
|
-
relative:
|
|
370
|
+
pcbRelative: z16.boolean().optional(),
|
|
371
|
+
relative: z16.boolean().optional()
|
|
330
372
|
});
|
|
331
373
|
expectTypesMatch(true);
|
|
332
|
-
var commonLayoutProps =
|
|
374
|
+
var commonLayoutProps = z16.object({
|
|
333
375
|
pcbX: pcbCoordinate.optional(),
|
|
334
376
|
pcbY: pcbCoordinate.optional(),
|
|
335
377
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -339,14 +381,14 @@ var commonLayoutProps = z15.object({
|
|
|
339
381
|
pcbOffsetX: distance8.optional(),
|
|
340
382
|
pcbOffsetY: distance8.optional(),
|
|
341
383
|
pcbRotation: rotation2.optional(),
|
|
342
|
-
pcbPositionAnchor:
|
|
343
|
-
pcbPositionMode:
|
|
384
|
+
pcbPositionAnchor: z16.string().optional(),
|
|
385
|
+
pcbPositionMode: z16.enum([
|
|
344
386
|
"relative_to_group_anchor",
|
|
345
387
|
"auto",
|
|
346
388
|
"relative_to_board_anchor",
|
|
347
389
|
"relative_to_component_anchor"
|
|
348
390
|
]).optional(),
|
|
349
|
-
shouldBeOnEdgeOfBoard:
|
|
391
|
+
shouldBeOnEdgeOfBoard: z16.boolean().optional(),
|
|
350
392
|
pcbMarginTop: distance8.optional(),
|
|
351
393
|
pcbMarginRight: distance8.optional(),
|
|
352
394
|
pcbMarginBottom: distance8.optional(),
|
|
@@ -368,97 +410,38 @@ var commonLayoutProps = z15.object({
|
|
|
368
410
|
footprint: footprintProp.optional(),
|
|
369
411
|
symbol: symbolProp.optional(),
|
|
370
412
|
schStyle: schStyle.optional(),
|
|
371
|
-
relative:
|
|
372
|
-
schRelative:
|
|
373
|
-
pcbRelative:
|
|
374
|
-
});
|
|
375
|
-
expectTypesMatch(true);
|
|
376
|
-
var supplierProps =
|
|
377
|
-
supplierPartNumbers:
|
|
378
|
-
});
|
|
379
|
-
expectTypesMatch(true);
|
|
380
|
-
var pinAttributeMap = z15.object({
|
|
381
|
-
capabilities: z15.array(
|
|
382
|
-
z15.enum([
|
|
383
|
-
"i2c_sda",
|
|
384
|
-
"i2c_scl",
|
|
385
|
-
"spi_cs",
|
|
386
|
-
"spi_sck",
|
|
387
|
-
"spi_mosi",
|
|
388
|
-
"spi_miso",
|
|
389
|
-
"uart_tx",
|
|
390
|
-
"uart_rx"
|
|
391
|
-
])
|
|
392
|
-
).optional(),
|
|
393
|
-
activeCapabilities: z15.array(
|
|
394
|
-
z15.enum([
|
|
395
|
-
"i2c_sda",
|
|
396
|
-
"i2c_scl",
|
|
397
|
-
"spi_cs",
|
|
398
|
-
"spi_sck",
|
|
399
|
-
"spi_mosi",
|
|
400
|
-
"spi_miso",
|
|
401
|
-
"uart_tx",
|
|
402
|
-
"uart_rx"
|
|
403
|
-
])
|
|
404
|
-
).optional(),
|
|
405
|
-
activeCapability: z15.enum([
|
|
406
|
-
"i2c_sda",
|
|
407
|
-
"i2c_scl",
|
|
408
|
-
"spi_cs",
|
|
409
|
-
"spi_sck",
|
|
410
|
-
"spi_mosi",
|
|
411
|
-
"spi_miso",
|
|
412
|
-
"uart_tx",
|
|
413
|
-
"uart_rx"
|
|
414
|
-
]).optional(),
|
|
415
|
-
providesPower: z15.boolean().optional(),
|
|
416
|
-
requiresPower: z15.boolean().optional(),
|
|
417
|
-
providesGround: z15.boolean().optional(),
|
|
418
|
-
requiresGround: z15.boolean().optional(),
|
|
419
|
-
providesVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
420
|
-
requiresVoltage: z15.union([z15.string(), z15.number()]).optional(),
|
|
421
|
-
doNotConnect: z15.boolean().optional(),
|
|
422
|
-
includeInBoardPinout: z15.boolean().optional(),
|
|
423
|
-
highlightColor: z15.string().optional(),
|
|
424
|
-
mustBeConnected: z15.boolean().optional(),
|
|
425
|
-
canUseInternalPullup: z15.boolean().optional(),
|
|
426
|
-
isUsingInternalPullup: z15.boolean().optional(),
|
|
427
|
-
needsExternalPullup: z15.boolean().optional(),
|
|
428
|
-
canUseInternalPulldown: z15.boolean().optional(),
|
|
429
|
-
isUsingInternalPulldown: z15.boolean().optional(),
|
|
430
|
-
needsExternalPulldown: z15.boolean().optional(),
|
|
431
|
-
canUseOpenDrain: z15.boolean().optional(),
|
|
432
|
-
isUsingOpenDrain: z15.boolean().optional(),
|
|
433
|
-
canUsePushPull: z15.boolean().optional(),
|
|
434
|
-
isUsingPushPull: z15.boolean().optional(),
|
|
435
|
-
shouldHaveDecouplingCapacitor: z15.boolean().optional(),
|
|
436
|
-
recommendedDecouplingCapacitorCapacitance: z15.union([z15.string(), z15.number()]).optional()
|
|
413
|
+
relative: z16.boolean().optional(),
|
|
414
|
+
schRelative: z16.boolean().optional(),
|
|
415
|
+
pcbRelative: z16.boolean().optional()
|
|
416
|
+
});
|
|
417
|
+
expectTypesMatch(true);
|
|
418
|
+
var supplierProps = z16.object({
|
|
419
|
+
supplierPartNumbers: z16.record(supplier_name, z16.array(z16.string())).optional()
|
|
437
420
|
});
|
|
438
421
|
expectTypesMatch(true);
|
|
439
422
|
var commonComponentProps = commonLayoutProps.merge(supplierProps).extend({
|
|
440
|
-
key:
|
|
441
|
-
name:
|
|
442
|
-
displayName:
|
|
423
|
+
key: z16.any().optional(),
|
|
424
|
+
name: z16.string(),
|
|
425
|
+
displayName: z16.string().optional(),
|
|
443
426
|
datasheetUrl: url.optional(),
|
|
444
427
|
cadModel: cadModelProp.optional(),
|
|
445
428
|
kicadFootprintMetadata: kicadFootprintMetadata.optional(),
|
|
446
429
|
kicadSymbolMetadata: kicadSymbolMetadata.optional(),
|
|
447
|
-
children:
|
|
448
|
-
symbolName:
|
|
449
|
-
doNotPlace:
|
|
450
|
-
allowOffBoard:
|
|
430
|
+
children: z16.any().optional(),
|
|
431
|
+
symbolName: z16.string().optional(),
|
|
432
|
+
doNotPlace: z16.boolean().optional(),
|
|
433
|
+
allowOffBoard: z16.boolean().optional().describe(
|
|
451
434
|
"Allows the PCB component to hang off the board (e.g. for USB ports or displays)"
|
|
452
435
|
),
|
|
453
|
-
obstructsWithinBounds:
|
|
436
|
+
obstructsWithinBounds: z16.boolean().optional().describe(
|
|
454
437
|
"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"
|
|
455
438
|
),
|
|
456
|
-
showAsTranslucentModel:
|
|
439
|
+
showAsTranslucentModel: z16.boolean().optional().describe(
|
|
457
440
|
"Whether to show this component's CAD model as translucent in the 3D viewer."
|
|
458
441
|
),
|
|
459
|
-
pinAttributes:
|
|
460
|
-
mfn:
|
|
461
|
-
manufacturerPartNumber:
|
|
442
|
+
pinAttributes: z16.record(z16.string(), pinAttributeMap).optional(),
|
|
443
|
+
mfn: z16.string().describe("Manufacturer Part Number").optional(),
|
|
444
|
+
manufacturerPartNumber: z16.string().optional()
|
|
462
445
|
});
|
|
463
446
|
expectTypesMatch(true);
|
|
464
447
|
var componentProps = commonComponentProps;
|
|
@@ -473,7 +456,7 @@ var lrPolarPins = [
|
|
|
473
456
|
"cathode",
|
|
474
457
|
"neg"
|
|
475
458
|
];
|
|
476
|
-
var distanceOrMultiplier = distance8.or(
|
|
459
|
+
var distanceOrMultiplier = distance8.or(z16.enum(["2x", "3x", "4x"]));
|
|
477
460
|
|
|
478
461
|
// lib/generated/footprinter-autocomplete.ts
|
|
479
462
|
var footprinterStringExamples = [
|
|
@@ -502,8 +485,8 @@ var footprinterStringExamples = [
|
|
|
502
485
|
];
|
|
503
486
|
|
|
504
487
|
// lib/common/schematicOrientation.ts
|
|
505
|
-
import { z as
|
|
506
|
-
var schematicOrientation =
|
|
488
|
+
import { z as z17 } from "zod";
|
|
489
|
+
var schematicOrientation = z17.enum([
|
|
507
490
|
"vertical",
|
|
508
491
|
"horizontal",
|
|
509
492
|
"pos_top",
|
|
@@ -522,32 +505,32 @@ expectTypesMatch(
|
|
|
522
505
|
);
|
|
523
506
|
|
|
524
507
|
// lib/common/schematicPinDefinitions.ts
|
|
525
|
-
import { z as
|
|
526
|
-
var explicitPinSideDefinition =
|
|
527
|
-
pins:
|
|
528
|
-
direction:
|
|
529
|
-
|
|
530
|
-
|
|
531
|
-
|
|
532
|
-
|
|
508
|
+
import { z as z18 } from "zod";
|
|
509
|
+
var explicitPinSideDefinition = z18.object({
|
|
510
|
+
pins: z18.array(z18.union([z18.number(), z18.string()])),
|
|
511
|
+
direction: z18.union([
|
|
512
|
+
z18.literal("top-to-bottom"),
|
|
513
|
+
z18.literal("left-to-right"),
|
|
514
|
+
z18.literal("bottom-to-top"),
|
|
515
|
+
z18.literal("right-to-left")
|
|
533
516
|
])
|
|
534
517
|
});
|
|
535
|
-
var pinSideDefinitionInput =
|
|
536
|
-
var pinSideDefinitionWithDefaultDirection = (direction2) =>
|
|
518
|
+
var pinSideDefinitionInput = z18.array(z18.union([z18.number(), z18.string()]));
|
|
519
|
+
var pinSideDefinitionWithDefaultDirection = (direction2) => z18.union([explicitPinSideDefinition, pinSideDefinitionInput]).transform(
|
|
537
520
|
(value) => Array.isArray(value) ? {
|
|
538
521
|
pins: value,
|
|
539
522
|
direction: direction2
|
|
540
523
|
} : value
|
|
541
524
|
);
|
|
542
|
-
var schematicPortArrangement =
|
|
543
|
-
leftSize:
|
|
544
|
-
topSize:
|
|
545
|
-
rightSize:
|
|
546
|
-
bottomSize:
|
|
547
|
-
leftPinCount:
|
|
548
|
-
rightPinCount:
|
|
549
|
-
topPinCount:
|
|
550
|
-
bottomPinCount:
|
|
525
|
+
var schematicPortArrangement = z18.object({
|
|
526
|
+
leftSize: z18.number().optional().describe("@deprecated, use leftPinCount"),
|
|
527
|
+
topSize: z18.number().optional().describe("@deprecated, use topPinCount"),
|
|
528
|
+
rightSize: z18.number().optional().describe("@deprecated, use rightPinCount"),
|
|
529
|
+
bottomSize: z18.number().optional().describe("@deprecated, use bottomPinCount"),
|
|
530
|
+
leftPinCount: z18.number().optional(),
|
|
531
|
+
rightPinCount: z18.number().optional(),
|
|
532
|
+
topPinCount: z18.number().optional(),
|
|
533
|
+
bottomPinCount: z18.number().optional(),
|
|
551
534
|
leftSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
552
535
|
rightSide: pinSideDefinitionWithDefaultDirection("top-to-bottom").optional(),
|
|
553
536
|
topSide: pinSideDefinitionWithDefaultDirection("left-to-right").optional(),
|
|
@@ -558,9 +541,9 @@ expectTypesMatch(true);
|
|
|
558
541
|
|
|
559
542
|
// lib/common/schematicPinStyle.ts
|
|
560
543
|
import { distance as distance9 } from "circuit-json";
|
|
561
|
-
import { z as
|
|
562
|
-
var schematicPinStyle =
|
|
563
|
-
|
|
544
|
+
import { z as z19 } from "zod";
|
|
545
|
+
var schematicPinStyle = z19.record(
|
|
546
|
+
z19.object({
|
|
564
547
|
marginLeft: distance9.optional(),
|
|
565
548
|
marginRight: distance9.optional(),
|
|
566
549
|
marginTop: distance9.optional(),
|
|
@@ -574,17 +557,17 @@ var schematicPinStyle = z18.record(
|
|
|
574
557
|
expectTypesMatch(true);
|
|
575
558
|
|
|
576
559
|
// lib/common/schematicPinLabel.ts
|
|
577
|
-
import { z as
|
|
578
|
-
var schematicPinLabel =
|
|
560
|
+
import { z as z20 } from "zod";
|
|
561
|
+
var schematicPinLabel = z20.string().regex(/^[A-Za-z0-9_]+$/);
|
|
579
562
|
|
|
580
563
|
// lib/common/schematicSize.ts
|
|
581
564
|
import { distance as distance10 } from "circuit-json";
|
|
582
|
-
import { z as
|
|
583
|
-
var schematicSymbolSize = distance10.or(
|
|
565
|
+
import { z as z21 } from "zod";
|
|
566
|
+
var schematicSymbolSize = distance10.or(z21.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
584
567
|
|
|
585
568
|
// lib/common/kicadPinMetadata.ts
|
|
586
|
-
import { z as
|
|
587
|
-
var kicadPinElectricalType =
|
|
569
|
+
import { z as z22 } from "zod";
|
|
570
|
+
var kicadPinElectricalType = z22.enum([
|
|
588
571
|
"input",
|
|
589
572
|
"output",
|
|
590
573
|
"bidirectional",
|
|
@@ -598,7 +581,7 @@ var kicadPinElectricalType = z21.enum([
|
|
|
598
581
|
"open_emitter",
|
|
599
582
|
"no_connect"
|
|
600
583
|
]);
|
|
601
|
-
var kicadPinGraphicStyle =
|
|
584
|
+
var kicadPinGraphicStyle = z22.enum([
|
|
602
585
|
"line",
|
|
603
586
|
"inverted",
|
|
604
587
|
"clock",
|
|
@@ -609,7 +592,7 @@ var kicadPinGraphicStyle = z21.enum([
|
|
|
609
592
|
"falling_edge_clock",
|
|
610
593
|
"nonlogic"
|
|
611
594
|
]);
|
|
612
|
-
var kicadPinMetadata =
|
|
595
|
+
var kicadPinMetadata = z22.object({
|
|
613
596
|
electricalType: kicadPinElectricalType.optional(),
|
|
614
597
|
graphicStyle: kicadPinGraphicStyle.optional(),
|
|
615
598
|
pinLength: distance.optional(),
|
|
@@ -619,8 +602,8 @@ var kicadPinMetadata = z21.object({
|
|
|
619
602
|
expectTypesMatch(true);
|
|
620
603
|
|
|
621
604
|
// lib/common/ninePointAnchor.ts
|
|
622
|
-
import { z as
|
|
623
|
-
var ninePointAnchor =
|
|
605
|
+
import { z as z23 } from "zod";
|
|
606
|
+
var ninePointAnchor = z23.enum([
|
|
624
607
|
"top_left",
|
|
625
608
|
"top_center",
|
|
626
609
|
"top_right",
|
|
@@ -633,44 +616,44 @@ var ninePointAnchor = z22.enum([
|
|
|
633
616
|
]);
|
|
634
617
|
|
|
635
618
|
// lib/components/board.ts
|
|
636
|
-
import { z as
|
|
619
|
+
import { z as z37 } from "zod";
|
|
637
620
|
|
|
638
621
|
// lib/components/group.ts
|
|
639
622
|
import { length as length3, distance as distance11 } from "circuit-json";
|
|
640
|
-
import { z as
|
|
623
|
+
import { z as z36 } from "zod";
|
|
641
624
|
|
|
642
625
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
643
|
-
import { z as
|
|
644
|
-
var base_manual_edit_event =
|
|
645
|
-
edit_event_id:
|
|
646
|
-
in_progress:
|
|
647
|
-
created_at:
|
|
626
|
+
import { z as z24 } from "zod";
|
|
627
|
+
var base_manual_edit_event = z24.object({
|
|
628
|
+
edit_event_id: z24.string(),
|
|
629
|
+
in_progress: z24.boolean().optional(),
|
|
630
|
+
created_at: z24.number()
|
|
648
631
|
});
|
|
649
632
|
expectTypesMatch(
|
|
650
633
|
true
|
|
651
634
|
);
|
|
652
635
|
|
|
653
636
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
654
|
-
import { z as
|
|
637
|
+
import { z as z25 } from "zod";
|
|
655
638
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
656
|
-
pcb_edit_event_type:
|
|
657
|
-
edit_event_type:
|
|
658
|
-
pcb_component_id:
|
|
659
|
-
original_center:
|
|
660
|
-
new_center:
|
|
639
|
+
pcb_edit_event_type: z25.literal("edit_component_location").describe("deprecated"),
|
|
640
|
+
edit_event_type: z25.literal("edit_pcb_component_location"),
|
|
641
|
+
pcb_component_id: z25.string(),
|
|
642
|
+
original_center: z25.object({ x: z25.number(), y: z25.number() }),
|
|
643
|
+
new_center: z25.object({ x: z25.number(), y: z25.number() })
|
|
661
644
|
});
|
|
662
645
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
663
646
|
expectTypesMatch(true);
|
|
664
647
|
|
|
665
648
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
666
|
-
import { z as
|
|
649
|
+
import { z as z26 } from "zod";
|
|
667
650
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
668
|
-
pcb_edit_event_type:
|
|
669
|
-
edit_event_type:
|
|
670
|
-
pcb_port_id:
|
|
671
|
-
pcb_trace_hint_id:
|
|
672
|
-
route:
|
|
673
|
-
|
|
651
|
+
pcb_edit_event_type: z26.literal("edit_trace_hint").describe("deprecated"),
|
|
652
|
+
edit_event_type: z26.literal("edit_pcb_trace_hint").optional(),
|
|
653
|
+
pcb_port_id: z26.string(),
|
|
654
|
+
pcb_trace_hint_id: z26.string().optional(),
|
|
655
|
+
route: z26.array(
|
|
656
|
+
z26.object({ x: z26.number(), y: z26.number(), via: z26.boolean().optional() })
|
|
674
657
|
)
|
|
675
658
|
});
|
|
676
659
|
expectTypesMatch(
|
|
@@ -678,38 +661,38 @@ expectTypesMatch(
|
|
|
678
661
|
);
|
|
679
662
|
|
|
680
663
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
681
|
-
import { z as
|
|
664
|
+
import { z as z27 } from "zod";
|
|
682
665
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
683
|
-
edit_event_type:
|
|
684
|
-
schematic_component_id:
|
|
685
|
-
original_center:
|
|
686
|
-
new_center:
|
|
666
|
+
edit_event_type: z27.literal("edit_schematic_component_location"),
|
|
667
|
+
schematic_component_id: z27.string(),
|
|
668
|
+
original_center: z27.object({ x: z27.number(), y: z27.number() }),
|
|
669
|
+
new_center: z27.object({ x: z27.number(), y: z27.number() })
|
|
687
670
|
});
|
|
688
671
|
expectTypesMatch(true);
|
|
689
672
|
|
|
690
673
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
691
|
-
import { z as
|
|
674
|
+
import { z as z28 } from "zod";
|
|
692
675
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
693
|
-
edit_event_type:
|
|
694
|
-
pcb_group_id:
|
|
695
|
-
original_center:
|
|
696
|
-
new_center:
|
|
676
|
+
edit_event_type: z28.literal("edit_pcb_group_location"),
|
|
677
|
+
pcb_group_id: z28.string(),
|
|
678
|
+
original_center: z28.object({ x: z28.number(), y: z28.number() }),
|
|
679
|
+
new_center: z28.object({ x: z28.number(), y: z28.number() })
|
|
697
680
|
});
|
|
698
681
|
expectTypesMatch(true);
|
|
699
682
|
|
|
700
683
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
701
|
-
import { z as
|
|
684
|
+
import { z as z29 } from "zod";
|
|
702
685
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
703
|
-
edit_event_type:
|
|
704
|
-
schematic_group_id:
|
|
705
|
-
original_center:
|
|
706
|
-
new_center:
|
|
686
|
+
edit_event_type: z29.literal("edit_schematic_group_location"),
|
|
687
|
+
schematic_group_id: z29.string(),
|
|
688
|
+
original_center: z29.object({ x: z29.number(), y: z29.number() }),
|
|
689
|
+
new_center: z29.object({ x: z29.number(), y: z29.number() })
|
|
707
690
|
});
|
|
708
691
|
expectTypesMatch(true);
|
|
709
692
|
|
|
710
693
|
// lib/manual-edits/manual_edit_event.ts
|
|
711
|
-
import { z as
|
|
712
|
-
var manual_edit_event =
|
|
694
|
+
import { z as z30 } from "zod";
|
|
695
|
+
var manual_edit_event = z30.union([
|
|
713
696
|
edit_pcb_component_location_event,
|
|
714
697
|
edit_trace_hint_event,
|
|
715
698
|
edit_schematic_component_location_event
|
|
@@ -717,33 +700,33 @@ var manual_edit_event = z29.union([
|
|
|
717
700
|
expectTypesMatch(true);
|
|
718
701
|
|
|
719
702
|
// lib/manual-edits/manual_edits_file.ts
|
|
720
|
-
import { z as
|
|
703
|
+
import { z as z34 } from "zod";
|
|
721
704
|
|
|
722
705
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
723
|
-
import { z as
|
|
706
|
+
import { z as z31 } from "zod";
|
|
724
707
|
import { point as point2 } from "circuit-json";
|
|
725
|
-
var manual_pcb_placement =
|
|
726
|
-
selector:
|
|
727
|
-
relative_to:
|
|
708
|
+
var manual_pcb_placement = z31.object({
|
|
709
|
+
selector: z31.string(),
|
|
710
|
+
relative_to: z31.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
728
711
|
center: point2
|
|
729
712
|
});
|
|
730
713
|
expectTypesMatch(true);
|
|
731
714
|
|
|
732
715
|
// lib/manual-edits/manual_trace_hint.ts
|
|
733
|
-
import { z as
|
|
716
|
+
import { z as z32 } from "zod";
|
|
734
717
|
import { route_hint_point } from "circuit-json";
|
|
735
|
-
var manual_trace_hint =
|
|
736
|
-
pcb_port_selector:
|
|
737
|
-
offsets:
|
|
718
|
+
var manual_trace_hint = z32.object({
|
|
719
|
+
pcb_port_selector: z32.string(),
|
|
720
|
+
offsets: z32.array(route_hint_point)
|
|
738
721
|
});
|
|
739
722
|
expectTypesMatch(true);
|
|
740
723
|
|
|
741
724
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
742
|
-
import { z as
|
|
725
|
+
import { z as z33 } from "zod";
|
|
743
726
|
import { point as point4 } from "circuit-json";
|
|
744
|
-
var manual_schematic_placement =
|
|
745
|
-
selector:
|
|
746
|
-
relative_to:
|
|
727
|
+
var manual_schematic_placement = z33.object({
|
|
728
|
+
selector: z33.string(),
|
|
729
|
+
relative_to: z33.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
747
730
|
center: point4
|
|
748
731
|
});
|
|
749
732
|
expectTypesMatch(
|
|
@@ -751,37 +734,37 @@ expectTypesMatch(
|
|
|
751
734
|
);
|
|
752
735
|
|
|
753
736
|
// lib/manual-edits/manual_edits_file.ts
|
|
754
|
-
var manual_edits_file =
|
|
755
|
-
pcb_placements:
|
|
756
|
-
manual_trace_hints:
|
|
757
|
-
schematic_placements:
|
|
737
|
+
var manual_edits_file = z34.object({
|
|
738
|
+
pcb_placements: z34.array(manual_pcb_placement).optional(),
|
|
739
|
+
manual_trace_hints: z34.array(manual_trace_hint).optional(),
|
|
740
|
+
schematic_placements: z34.array(manual_schematic_placement).optional()
|
|
758
741
|
});
|
|
759
742
|
expectTypesMatch(true);
|
|
760
743
|
|
|
761
744
|
// lib/common/connectionsProp.ts
|
|
762
|
-
import { z as
|
|
763
|
-
var connectionTarget =
|
|
745
|
+
import { z as z35 } from "zod";
|
|
746
|
+
var connectionTarget = z35.string().or(z35.array(z35.string()).readonly()).or(z35.array(z35.string()));
|
|
764
747
|
var createConnectionsProp = (labels) => {
|
|
765
|
-
return
|
|
748
|
+
return z35.record(z35.enum(labels), connectionTarget);
|
|
766
749
|
};
|
|
767
750
|
|
|
768
751
|
// lib/components/group.ts
|
|
769
|
-
var layoutConfig =
|
|
770
|
-
layoutMode:
|
|
771
|
-
position:
|
|
772
|
-
grid:
|
|
773
|
-
gridCols:
|
|
774
|
-
gridRows:
|
|
775
|
-
gridTemplateRows:
|
|
776
|
-
gridTemplateColumns:
|
|
777
|
-
gridTemplate:
|
|
778
|
-
gridGap:
|
|
779
|
-
gridRowGap:
|
|
780
|
-
gridColumnGap:
|
|
781
|
-
flex:
|
|
782
|
-
flexDirection:
|
|
783
|
-
alignItems:
|
|
784
|
-
justifyContent:
|
|
752
|
+
var layoutConfig = z36.object({
|
|
753
|
+
layoutMode: z36.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
754
|
+
position: z36.enum(["absolute", "relative"]).optional(),
|
|
755
|
+
grid: z36.boolean().optional(),
|
|
756
|
+
gridCols: z36.number().or(z36.string()).optional(),
|
|
757
|
+
gridRows: z36.number().or(z36.string()).optional(),
|
|
758
|
+
gridTemplateRows: z36.string().optional(),
|
|
759
|
+
gridTemplateColumns: z36.string().optional(),
|
|
760
|
+
gridTemplate: z36.string().optional(),
|
|
761
|
+
gridGap: z36.number().or(z36.string()).optional(),
|
|
762
|
+
gridRowGap: z36.number().or(z36.string()).optional(),
|
|
763
|
+
gridColumnGap: z36.number().or(z36.string()).optional(),
|
|
764
|
+
flex: z36.boolean().or(z36.string()).optional(),
|
|
765
|
+
flexDirection: z36.enum(["row", "column"]).optional(),
|
|
766
|
+
alignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
767
|
+
justifyContent: z36.enum([
|
|
785
768
|
"start",
|
|
786
769
|
"center",
|
|
787
770
|
"end",
|
|
@@ -790,16 +773,16 @@ var layoutConfig = z35.object({
|
|
|
790
773
|
"space-around",
|
|
791
774
|
"space-evenly"
|
|
792
775
|
]).optional(),
|
|
793
|
-
flexRow:
|
|
794
|
-
flexColumn:
|
|
795
|
-
gap:
|
|
796
|
-
pack:
|
|
797
|
-
packOrderStrategy:
|
|
776
|
+
flexRow: z36.boolean().optional(),
|
|
777
|
+
flexColumn: z36.boolean().optional(),
|
|
778
|
+
gap: z36.number().or(z36.string()).optional(),
|
|
779
|
+
pack: z36.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
780
|
+
packOrderStrategy: z36.enum([
|
|
798
781
|
"largest_to_smallest",
|
|
799
782
|
"first_to_last",
|
|
800
783
|
"highest_to_lowest_pin_count"
|
|
801
784
|
]).optional(),
|
|
802
|
-
packPlacementStrategy:
|
|
785
|
+
packPlacementStrategy: z36.enum(["shortest_connection_along_outline"]).optional(),
|
|
803
786
|
padding: length3.optional(),
|
|
804
787
|
paddingLeft: length3.optional(),
|
|
805
788
|
paddingRight: length3.optional(),
|
|
@@ -809,29 +792,29 @@ var layoutConfig = z35.object({
|
|
|
809
792
|
paddingY: length3.optional(),
|
|
810
793
|
width: length3.optional(),
|
|
811
794
|
height: length3.optional(),
|
|
812
|
-
matchAdapt:
|
|
813
|
-
matchAdaptTemplate:
|
|
795
|
+
matchAdapt: z36.boolean().optional(),
|
|
796
|
+
matchAdaptTemplate: z36.any().optional()
|
|
814
797
|
});
|
|
815
798
|
expectTypesMatch(true);
|
|
816
|
-
var border =
|
|
799
|
+
var border = z36.object({
|
|
817
800
|
strokeWidth: length3.optional(),
|
|
818
|
-
dashed:
|
|
819
|
-
solid:
|
|
801
|
+
dashed: z36.boolean().optional(),
|
|
802
|
+
solid: z36.boolean().optional()
|
|
820
803
|
});
|
|
821
|
-
var pcbAnchorAlignmentAutocomplete =
|
|
822
|
-
var autorouterConfig =
|
|
804
|
+
var pcbAnchorAlignmentAutocomplete = z36.custom((value) => typeof value === "string");
|
|
805
|
+
var autorouterConfig = z36.object({
|
|
823
806
|
serverUrl: url.optional(),
|
|
824
|
-
inputFormat:
|
|
825
|
-
serverMode:
|
|
826
|
-
serverCacheEnabled:
|
|
827
|
-
cache:
|
|
807
|
+
inputFormat: z36.enum(["simplified", "circuit-json"]).optional(),
|
|
808
|
+
serverMode: z36.enum(["job", "solve-endpoint"]).optional(),
|
|
809
|
+
serverCacheEnabled: z36.boolean().optional(),
|
|
810
|
+
cache: z36.custom((v) => true).optional(),
|
|
828
811
|
traceClearance: length3.optional(),
|
|
829
|
-
availableJumperTypes:
|
|
830
|
-
groupMode:
|
|
831
|
-
algorithmFn:
|
|
812
|
+
availableJumperTypes: z36.array(z36.enum(["1206x4", "0603"])).optional(),
|
|
813
|
+
groupMode: z36.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
814
|
+
algorithmFn: z36.custom(
|
|
832
815
|
(v) => typeof v === "function" || v === void 0
|
|
833
816
|
).optional(),
|
|
834
|
-
preset:
|
|
817
|
+
preset: z36.enum([
|
|
835
818
|
"sequential_trace",
|
|
836
819
|
"subcircuit",
|
|
837
820
|
"auto",
|
|
@@ -846,58 +829,58 @@ var autorouterConfig = z35.object({
|
|
|
846
829
|
"auto-local",
|
|
847
830
|
"auto-cloud"
|
|
848
831
|
]).optional(),
|
|
849
|
-
local:
|
|
850
|
-
});
|
|
851
|
-
var autorouterPreset =
|
|
852
|
-
|
|
853
|
-
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
832
|
+
local: z36.boolean().optional()
|
|
833
|
+
});
|
|
834
|
+
var autorouterPreset = z36.union([
|
|
835
|
+
z36.literal("sequential_trace"),
|
|
836
|
+
z36.literal("subcircuit"),
|
|
837
|
+
z36.literal("auto"),
|
|
838
|
+
z36.literal("auto_local"),
|
|
839
|
+
z36.literal("auto_cloud"),
|
|
840
|
+
z36.literal("auto_jumper"),
|
|
841
|
+
z36.literal("tscircuit_beta"),
|
|
842
|
+
z36.literal("freerouting"),
|
|
843
|
+
z36.literal("laser_prefab"),
|
|
861
844
|
// Prefabricated PCB with laser copper ablation
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
845
|
+
z36.literal("auto-jumper"),
|
|
846
|
+
z36.literal("sequential-trace"),
|
|
847
|
+
z36.literal("auto-local"),
|
|
848
|
+
z36.literal("auto-cloud")
|
|
866
849
|
]);
|
|
867
|
-
var autorouterString =
|
|
868
|
-
var autorouterProp =
|
|
850
|
+
var autorouterString = z36.string();
|
|
851
|
+
var autorouterProp = z36.union([
|
|
869
852
|
autorouterConfig,
|
|
870
853
|
autorouterPreset,
|
|
871
854
|
autorouterString
|
|
872
855
|
]);
|
|
873
|
-
var autorouterEffortLevel =
|
|
856
|
+
var autorouterEffortLevel = z36.enum(["1x", "2x", "5x", "10x", "100x"]);
|
|
874
857
|
var baseGroupProps = commonLayoutProps.extend({
|
|
875
|
-
name:
|
|
876
|
-
children:
|
|
877
|
-
schTitle:
|
|
878
|
-
key:
|
|
879
|
-
showAsSchematicBox:
|
|
880
|
-
connections:
|
|
858
|
+
name: z36.string().optional(),
|
|
859
|
+
children: z36.any().optional(),
|
|
860
|
+
schTitle: z36.string().optional(),
|
|
861
|
+
key: z36.any().optional(),
|
|
862
|
+
showAsSchematicBox: z36.boolean().optional(),
|
|
863
|
+
connections: z36.record(z36.string(), connectionTarget.optional()).optional(),
|
|
881
864
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
882
865
|
schPinSpacing: length3.optional(),
|
|
883
866
|
schPinStyle: schematicPinStyle.optional(),
|
|
884
867
|
...layoutConfig.shape,
|
|
885
868
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
886
869
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
887
|
-
pcbGrid:
|
|
888
|
-
pcbGridCols:
|
|
889
|
-
pcbGridRows:
|
|
890
|
-
pcbGridTemplateRows:
|
|
891
|
-
pcbGridTemplateColumns:
|
|
892
|
-
pcbGridTemplate:
|
|
893
|
-
pcbGridGap:
|
|
894
|
-
pcbGridRowGap:
|
|
895
|
-
pcbGridColumnGap:
|
|
896
|
-
pcbFlex:
|
|
897
|
-
pcbFlexGap:
|
|
898
|
-
pcbFlexDirection:
|
|
899
|
-
pcbAlignItems:
|
|
900
|
-
pcbJustifyContent:
|
|
870
|
+
pcbGrid: z36.boolean().optional(),
|
|
871
|
+
pcbGridCols: z36.number().or(z36.string()).optional(),
|
|
872
|
+
pcbGridRows: z36.number().or(z36.string()).optional(),
|
|
873
|
+
pcbGridTemplateRows: z36.string().optional(),
|
|
874
|
+
pcbGridTemplateColumns: z36.string().optional(),
|
|
875
|
+
pcbGridTemplate: z36.string().optional(),
|
|
876
|
+
pcbGridGap: z36.number().or(z36.string()).optional(),
|
|
877
|
+
pcbGridRowGap: z36.number().or(z36.string()).optional(),
|
|
878
|
+
pcbGridColumnGap: z36.number().or(z36.string()).optional(),
|
|
879
|
+
pcbFlex: z36.boolean().or(z36.string()).optional(),
|
|
880
|
+
pcbFlexGap: z36.number().or(z36.string()).optional(),
|
|
881
|
+
pcbFlexDirection: z36.enum(["row", "column"]).optional(),
|
|
882
|
+
pcbAlignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
883
|
+
pcbJustifyContent: z36.enum([
|
|
901
884
|
"start",
|
|
902
885
|
"center",
|
|
903
886
|
"end",
|
|
@@ -906,25 +889,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
906
889
|
"space-around",
|
|
907
890
|
"space-evenly"
|
|
908
891
|
]).optional(),
|
|
909
|
-
pcbFlexRow:
|
|
910
|
-
pcbFlexColumn:
|
|
911
|
-
pcbGap:
|
|
912
|
-
pcbPack:
|
|
913
|
-
pcbPackGap:
|
|
914
|
-
schGrid:
|
|
915
|
-
schGridCols:
|
|
916
|
-
schGridRows:
|
|
917
|
-
schGridTemplateRows:
|
|
918
|
-
schGridTemplateColumns:
|
|
919
|
-
schGridTemplate:
|
|
920
|
-
schGridGap:
|
|
921
|
-
schGridRowGap:
|
|
922
|
-
schGridColumnGap:
|
|
923
|
-
schFlex:
|
|
924
|
-
schFlexGap:
|
|
925
|
-
schFlexDirection:
|
|
926
|
-
schAlignItems:
|
|
927
|
-
schJustifyContent:
|
|
892
|
+
pcbFlexRow: z36.boolean().optional(),
|
|
893
|
+
pcbFlexColumn: z36.boolean().optional(),
|
|
894
|
+
pcbGap: z36.number().or(z36.string()).optional(),
|
|
895
|
+
pcbPack: z36.boolean().optional(),
|
|
896
|
+
pcbPackGap: z36.number().or(z36.string()).optional(),
|
|
897
|
+
schGrid: z36.boolean().optional(),
|
|
898
|
+
schGridCols: z36.number().or(z36.string()).optional(),
|
|
899
|
+
schGridRows: z36.number().or(z36.string()).optional(),
|
|
900
|
+
schGridTemplateRows: z36.string().optional(),
|
|
901
|
+
schGridTemplateColumns: z36.string().optional(),
|
|
902
|
+
schGridTemplate: z36.string().optional(),
|
|
903
|
+
schGridGap: z36.number().or(z36.string()).optional(),
|
|
904
|
+
schGridRowGap: z36.number().or(z36.string()).optional(),
|
|
905
|
+
schGridColumnGap: z36.number().or(z36.string()).optional(),
|
|
906
|
+
schFlex: z36.boolean().or(z36.string()).optional(),
|
|
907
|
+
schFlexGap: z36.number().or(z36.string()).optional(),
|
|
908
|
+
schFlexDirection: z36.enum(["row", "column"]).optional(),
|
|
909
|
+
schAlignItems: z36.enum(["start", "center", "end", "stretch"]).optional(),
|
|
910
|
+
schJustifyContent: z36.enum([
|
|
928
911
|
"start",
|
|
929
912
|
"center",
|
|
930
913
|
"end",
|
|
@@ -933,11 +916,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
933
916
|
"space-around",
|
|
934
917
|
"space-evenly"
|
|
935
918
|
]).optional(),
|
|
936
|
-
schFlexRow:
|
|
937
|
-
schFlexColumn:
|
|
938
|
-
schGap:
|
|
939
|
-
schPack:
|
|
940
|
-
schMatchAdapt:
|
|
919
|
+
schFlexRow: z36.boolean().optional(),
|
|
920
|
+
schFlexColumn: z36.boolean().optional(),
|
|
921
|
+
schGap: z36.number().or(z36.string()).optional(),
|
|
922
|
+
schPack: z36.boolean().optional(),
|
|
923
|
+
schMatchAdapt: z36.boolean().optional(),
|
|
941
924
|
pcbWidth: length3.optional(),
|
|
942
925
|
pcbHeight: length3.optional(),
|
|
943
926
|
minTraceWidth: length3.optional(),
|
|
@@ -960,38 +943,38 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
960
943
|
pcbPaddingBottom: length3.optional(),
|
|
961
944
|
pcbAnchorAlignment: pcbAnchorAlignmentAutocomplete.optional()
|
|
962
945
|
});
|
|
963
|
-
var partsEngine =
|
|
946
|
+
var partsEngine = z36.custom((v) => "findPart" in v);
|
|
964
947
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
965
948
|
manualEdits: manual_edits_file.optional(),
|
|
966
|
-
schAutoLayoutEnabled:
|
|
967
|
-
schTraceAutoLabelEnabled:
|
|
949
|
+
schAutoLayoutEnabled: z36.boolean().optional(),
|
|
950
|
+
schTraceAutoLabelEnabled: z36.boolean().optional(),
|
|
968
951
|
schMaxTraceDistance: distance11.optional(),
|
|
969
|
-
routingDisabled:
|
|
970
|
-
bomDisabled:
|
|
952
|
+
routingDisabled: z36.boolean().optional(),
|
|
953
|
+
bomDisabled: z36.boolean().optional(),
|
|
971
954
|
defaultTraceWidth: length3.optional(),
|
|
972
955
|
minTraceWidth: length3.optional(),
|
|
973
956
|
nominalTraceWidth: length3.optional(),
|
|
974
957
|
partsEngine: partsEngine.optional(),
|
|
975
|
-
_subcircuitCachingEnabled:
|
|
976
|
-
pcbRouteCache:
|
|
958
|
+
_subcircuitCachingEnabled: z36.boolean().optional(),
|
|
959
|
+
pcbRouteCache: z36.custom((v) => true).optional(),
|
|
977
960
|
autorouter: autorouterProp.optional(),
|
|
978
961
|
autorouterEffortLevel: autorouterEffortLevel.optional(),
|
|
979
|
-
autorouterVersion:
|
|
980
|
-
square:
|
|
981
|
-
emptyArea:
|
|
982
|
-
filledArea:
|
|
962
|
+
autorouterVersion: z36.enum(["v1", "v2", "latest"]).optional(),
|
|
963
|
+
square: z36.boolean().optional(),
|
|
964
|
+
emptyArea: z36.string().optional(),
|
|
965
|
+
filledArea: z36.string().optional(),
|
|
983
966
|
width: distance11.optional(),
|
|
984
967
|
height: distance11.optional(),
|
|
985
|
-
outline:
|
|
968
|
+
outline: z36.array(point).optional(),
|
|
986
969
|
outlineOffsetX: distance11.optional(),
|
|
987
970
|
outlineOffsetY: distance11.optional(),
|
|
988
|
-
circuitJson:
|
|
971
|
+
circuitJson: z36.array(z36.any()).optional()
|
|
989
972
|
});
|
|
990
973
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
991
|
-
subcircuit:
|
|
974
|
+
subcircuit: z36.literal(true)
|
|
992
975
|
});
|
|
993
|
-
var groupProps =
|
|
994
|
-
baseGroupProps.extend({ subcircuit:
|
|
976
|
+
var groupProps = z36.discriminatedUnion("subcircuit", [
|
|
977
|
+
baseGroupProps.extend({ subcircuit: z36.literal(false).optional() }),
|
|
995
978
|
subcircuitGroupPropsWithBool
|
|
996
979
|
]);
|
|
997
980
|
expectTypesMatch(true);
|
|
@@ -1000,35 +983,35 @@ expectTypesMatch(true);
|
|
|
1000
983
|
expectTypesMatch(true);
|
|
1001
984
|
|
|
1002
985
|
// lib/components/board.ts
|
|
1003
|
-
var boardColor =
|
|
986
|
+
var boardColor = z37.custom((value) => typeof value === "string");
|
|
1004
987
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
1005
|
-
material:
|
|
1006
|
-
layers:
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1010
|
-
|
|
1011
|
-
|
|
988
|
+
material: z37.enum(["fr4", "fr1"]).default("fr4"),
|
|
989
|
+
layers: z37.union([
|
|
990
|
+
z37.literal(1),
|
|
991
|
+
z37.literal(2),
|
|
992
|
+
z37.literal(4),
|
|
993
|
+
z37.literal(6),
|
|
994
|
+
z37.literal(8)
|
|
1012
995
|
]).default(2),
|
|
1013
996
|
borderRadius: distance.optional(),
|
|
1014
997
|
thickness: distance.optional(),
|
|
1015
998
|
boardAnchorPosition: point.optional(),
|
|
1016
999
|
anchorAlignment: ninePointAnchor.optional(),
|
|
1017
1000
|
boardAnchorAlignment: ninePointAnchor.optional().describe("Prefer using anchorAlignment when possible"),
|
|
1018
|
-
title:
|
|
1001
|
+
title: z37.string().optional(),
|
|
1019
1002
|
solderMaskColor: boardColor.optional(),
|
|
1020
1003
|
topSolderMaskColor: boardColor.optional(),
|
|
1021
1004
|
bottomSolderMaskColor: boardColor.optional(),
|
|
1022
1005
|
silkscreenColor: boardColor.optional(),
|
|
1023
1006
|
topSilkscreenColor: boardColor.optional(),
|
|
1024
1007
|
bottomSilkscreenColor: boardColor.optional(),
|
|
1025
|
-
doubleSidedAssembly:
|
|
1026
|
-
schematicDisabled:
|
|
1008
|
+
doubleSidedAssembly: z37.boolean().optional().default(false),
|
|
1009
|
+
schematicDisabled: z37.boolean().optional()
|
|
1027
1010
|
});
|
|
1028
1011
|
expectTypesMatch(true);
|
|
1029
1012
|
|
|
1030
1013
|
// lib/components/panel.ts
|
|
1031
|
-
import { z as
|
|
1014
|
+
import { z as z38 } from "zod";
|
|
1032
1015
|
var panelProps = baseGroupProps.omit({
|
|
1033
1016
|
width: true,
|
|
1034
1017
|
height: true,
|
|
@@ -1037,25 +1020,25 @@ var panelProps = baseGroupProps.omit({
|
|
|
1037
1020
|
}).extend({
|
|
1038
1021
|
width: distance.optional(),
|
|
1039
1022
|
height: distance.optional(),
|
|
1040
|
-
children:
|
|
1023
|
+
children: z38.any().optional(),
|
|
1041
1024
|
anchorAlignment: ninePointAnchor.optional(),
|
|
1042
|
-
noSolderMask:
|
|
1043
|
-
panelizationMethod:
|
|
1025
|
+
noSolderMask: z38.boolean().optional(),
|
|
1026
|
+
panelizationMethod: z38.enum(["tab-routing", "none"]).optional(),
|
|
1044
1027
|
boardGap: distance.optional(),
|
|
1045
|
-
layoutMode:
|
|
1046
|
-
row:
|
|
1047
|
-
col:
|
|
1028
|
+
layoutMode: z38.enum(["grid", "pack", "none"]).optional(),
|
|
1029
|
+
row: z38.number().optional(),
|
|
1030
|
+
col: z38.number().optional(),
|
|
1048
1031
|
cellWidth: distance.optional(),
|
|
1049
1032
|
cellHeight: distance.optional(),
|
|
1050
1033
|
tabWidth: distance.optional(),
|
|
1051
1034
|
tabLength: distance.optional(),
|
|
1052
|
-
mouseBites:
|
|
1035
|
+
mouseBites: z38.boolean().optional(),
|
|
1053
1036
|
edgePadding: distance.optional(),
|
|
1054
1037
|
edgePaddingLeft: distance.optional(),
|
|
1055
1038
|
edgePaddingRight: distance.optional(),
|
|
1056
1039
|
edgePaddingTop: distance.optional(),
|
|
1057
1040
|
edgePaddingBottom: distance.optional(),
|
|
1058
|
-
_subcircuitCachingEnabled:
|
|
1041
|
+
_subcircuitCachingEnabled: z38.boolean().optional()
|
|
1059
1042
|
});
|
|
1060
1043
|
expectTypesMatch(true);
|
|
1061
1044
|
|
|
@@ -1078,33 +1061,33 @@ expectTypesMatch(true);
|
|
|
1078
1061
|
|
|
1079
1062
|
// lib/components/chip.ts
|
|
1080
1063
|
import { distance as distance13, supplier_name as supplier_name2 } from "circuit-json";
|
|
1081
|
-
import { z as
|
|
1082
|
-
var connectionTarget2 =
|
|
1083
|
-
var connectionsProp =
|
|
1084
|
-
var pinLabelsProp =
|
|
1064
|
+
import { z as z41 } from "zod";
|
|
1065
|
+
var connectionTarget2 = z41.string().or(z41.array(z41.string()).readonly()).or(z41.array(z41.string()));
|
|
1066
|
+
var connectionsProp = z41.custom().pipe(z41.record(z41.string(), connectionTarget2));
|
|
1067
|
+
var pinLabelsProp = z41.record(
|
|
1085
1068
|
schematicPinLabel,
|
|
1086
|
-
schematicPinLabel.or(
|
|
1069
|
+
schematicPinLabel.or(z41.array(schematicPinLabel).readonly()).or(z41.array(schematicPinLabel))
|
|
1087
1070
|
);
|
|
1088
1071
|
expectTypesMatch(true);
|
|
1089
|
-
var pinCompatibleVariant =
|
|
1090
|
-
manufacturerPartNumber:
|
|
1091
|
-
supplierPartNumber:
|
|
1072
|
+
var pinCompatibleVariant = z41.object({
|
|
1073
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1074
|
+
supplierPartNumber: z41.record(supplier_name2, z41.array(z41.string())).optional()
|
|
1092
1075
|
});
|
|
1093
1076
|
var chipProps = commonComponentProps.extend({
|
|
1094
|
-
manufacturerPartNumber:
|
|
1077
|
+
manufacturerPartNumber: z41.string().optional(),
|
|
1095
1078
|
pinLabels: pinLabelsProp.optional(),
|
|
1096
|
-
showPinAliases:
|
|
1097
|
-
pcbPinLabels:
|
|
1098
|
-
internallyConnectedPins:
|
|
1099
|
-
externallyConnectedPins:
|
|
1079
|
+
showPinAliases: z41.boolean().optional(),
|
|
1080
|
+
pcbPinLabels: z41.record(z41.string(), z41.string()).optional(),
|
|
1081
|
+
internallyConnectedPins: z41.array(z41.array(z41.union([z41.string(), z41.number()]))).optional(),
|
|
1082
|
+
externallyConnectedPins: z41.array(z41.array(z41.string())).optional(),
|
|
1100
1083
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
1101
1084
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1102
|
-
pinCompatibleVariants:
|
|
1085
|
+
pinCompatibleVariants: z41.array(pinCompatibleVariant).optional(),
|
|
1103
1086
|
schPinStyle: schematicPinStyle.optional(),
|
|
1104
1087
|
schPinSpacing: distance13.optional(),
|
|
1105
1088
|
schWidth: distance13.optional(),
|
|
1106
1089
|
schHeight: distance13.optional(),
|
|
1107
|
-
noSchematicRepresentation:
|
|
1090
|
+
noSchematicRepresentation: z41.boolean().optional(),
|
|
1108
1091
|
connections: connectionsProp.optional()
|
|
1109
1092
|
});
|
|
1110
1093
|
var bugProps = chipProps;
|
|
@@ -1116,88 +1099,88 @@ expectTypesMatch(true);
|
|
|
1116
1099
|
|
|
1117
1100
|
// lib/components/jumper.ts
|
|
1118
1101
|
import { distance as distance14 } from "circuit-json";
|
|
1119
|
-
import { z as
|
|
1102
|
+
import { z as z42 } from "zod";
|
|
1120
1103
|
var jumperProps = commonComponentProps.extend({
|
|
1121
|
-
manufacturerPartNumber:
|
|
1122
|
-
pinLabels:
|
|
1123
|
-
|
|
1124
|
-
schematicPinLabel.or(
|
|
1104
|
+
manufacturerPartNumber: z42.string().optional(),
|
|
1105
|
+
pinLabels: z42.record(
|
|
1106
|
+
z42.number().or(schematicPinLabel),
|
|
1107
|
+
schematicPinLabel.or(z42.array(schematicPinLabel))
|
|
1125
1108
|
).optional(),
|
|
1126
1109
|
schPinStyle: schematicPinStyle.optional(),
|
|
1127
1110
|
schPinSpacing: distance14.optional(),
|
|
1128
1111
|
schWidth: distance14.optional(),
|
|
1129
1112
|
schHeight: distance14.optional(),
|
|
1130
|
-
schDirection:
|
|
1113
|
+
schDirection: z42.enum(["left", "right"]).optional(),
|
|
1131
1114
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1132
1115
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1133
|
-
pcbPinLabels:
|
|
1134
|
-
pinCount:
|
|
1135
|
-
internallyConnectedPins:
|
|
1136
|
-
connections:
|
|
1116
|
+
pcbPinLabels: z42.record(z42.string(), z42.string()).optional(),
|
|
1117
|
+
pinCount: z42.union([z42.literal(2), z42.literal(3)]).optional(),
|
|
1118
|
+
internallyConnectedPins: z42.array(z42.array(z42.union([z42.string(), z42.number()]))).optional(),
|
|
1119
|
+
connections: z42.custom().pipe(z42.record(z42.string(), connectionTarget)).optional()
|
|
1137
1120
|
});
|
|
1138
1121
|
expectTypesMatch(true);
|
|
1139
1122
|
|
|
1140
1123
|
// lib/components/solderjumper.ts
|
|
1141
|
-
import { z as
|
|
1124
|
+
import { z as z43 } from "zod";
|
|
1142
1125
|
var solderjumperProps = jumperProps.extend({
|
|
1143
|
-
bridgedPins:
|
|
1144
|
-
bridged:
|
|
1126
|
+
bridgedPins: z43.array(z43.array(z43.string())).optional(),
|
|
1127
|
+
bridged: z43.boolean().optional()
|
|
1145
1128
|
});
|
|
1146
1129
|
expectTypesMatch(true);
|
|
1147
1130
|
|
|
1148
1131
|
// lib/components/connector.ts
|
|
1149
1132
|
import { distance as distance15 } from "circuit-json";
|
|
1150
|
-
import { z as
|
|
1133
|
+
import { z as z44 } from "zod";
|
|
1151
1134
|
var connectorProps = commonComponentProps.extend({
|
|
1152
|
-
manufacturerPartNumber:
|
|
1153
|
-
pinLabels:
|
|
1154
|
-
|
|
1155
|
-
schematicPinLabel.or(
|
|
1135
|
+
manufacturerPartNumber: z44.string().optional(),
|
|
1136
|
+
pinLabels: z44.record(
|
|
1137
|
+
z44.number().or(schematicPinLabel),
|
|
1138
|
+
schematicPinLabel.or(z44.array(schematicPinLabel))
|
|
1156
1139
|
).optional(),
|
|
1157
1140
|
schPinStyle: schematicPinStyle.optional(),
|
|
1158
1141
|
schPinSpacing: distance15.optional(),
|
|
1159
1142
|
schWidth: distance15.optional(),
|
|
1160
1143
|
schHeight: distance15.optional(),
|
|
1161
|
-
schDirection:
|
|
1144
|
+
schDirection: z44.enum(["left", "right"]).optional(),
|
|
1162
1145
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
1163
|
-
internallyConnectedPins:
|
|
1164
|
-
standard:
|
|
1146
|
+
internallyConnectedPins: z44.array(z44.array(z44.union([z44.string(), z44.number()]))).optional(),
|
|
1147
|
+
standard: z44.enum(["usb_c", "m2"]).optional()
|
|
1165
1148
|
});
|
|
1166
1149
|
expectTypesMatch(true);
|
|
1167
1150
|
|
|
1168
1151
|
// lib/components/interconnect.ts
|
|
1169
|
-
import { z as
|
|
1152
|
+
import { z as z45 } from "zod";
|
|
1170
1153
|
var interconnectProps = commonComponentProps.extend({
|
|
1171
|
-
standard:
|
|
1172
|
-
pinLabels:
|
|
1173
|
-
|
|
1174
|
-
schematicPinLabel.or(
|
|
1154
|
+
standard: z45.enum(["TSC0001_36P_XALT_2025_11", "0805", "0603", "1206"]).optional(),
|
|
1155
|
+
pinLabels: z45.record(
|
|
1156
|
+
z45.number().or(schematicPinLabel),
|
|
1157
|
+
schematicPinLabel.or(z45.array(schematicPinLabel))
|
|
1175
1158
|
).optional(),
|
|
1176
|
-
internallyConnectedPins:
|
|
1159
|
+
internallyConnectedPins: z45.array(z45.array(z45.union([z45.string(), z45.number()]))).optional()
|
|
1177
1160
|
});
|
|
1178
1161
|
expectTypesMatch(true);
|
|
1179
1162
|
|
|
1180
1163
|
// lib/components/fuse.ts
|
|
1181
|
-
import { z as
|
|
1164
|
+
import { z as z46 } from "zod";
|
|
1182
1165
|
var fusePinLabels = ["pin1", "pin2"];
|
|
1183
1166
|
var fuseProps = commonComponentProps.extend({
|
|
1184
|
-
currentRating:
|
|
1185
|
-
voltageRating:
|
|
1186
|
-
schShowRatings:
|
|
1167
|
+
currentRating: z46.union([z46.number(), z46.string()]),
|
|
1168
|
+
voltageRating: z46.union([z46.number(), z46.string()]).optional(),
|
|
1169
|
+
schShowRatings: z46.boolean().optional(),
|
|
1187
1170
|
schOrientation: schematicOrientation.optional(),
|
|
1188
|
-
connections:
|
|
1189
|
-
|
|
1190
|
-
|
|
1191
|
-
|
|
1192
|
-
|
|
1193
|
-
|
|
1171
|
+
connections: z46.record(
|
|
1172
|
+
z46.string(),
|
|
1173
|
+
z46.union([
|
|
1174
|
+
z46.string(),
|
|
1175
|
+
z46.array(z46.string()).readonly(),
|
|
1176
|
+
z46.array(z46.string())
|
|
1194
1177
|
])
|
|
1195
1178
|
).optional()
|
|
1196
1179
|
});
|
|
1197
1180
|
|
|
1198
1181
|
// lib/components/platedhole.ts
|
|
1199
1182
|
import { distance as distance16 } from "circuit-json";
|
|
1200
|
-
import { z as
|
|
1183
|
+
import { z as z47 } from "zod";
|
|
1201
1184
|
var DEFAULT_PIN_HEADER_HOLE_DIAMETER = "0.04in";
|
|
1202
1185
|
var DEFAULT_PIN_HEADER_OUTER_DIAMETER = "0.1in";
|
|
1203
1186
|
var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
@@ -1229,26 +1212,26 @@ var inferPlatedHoleShapeAndDefaults = (rawProps) => {
|
|
|
1229
1212
|
props.outerDiameter = DEFAULT_PIN_HEADER_OUTER_DIAMETER;
|
|
1230
1213
|
return props;
|
|
1231
1214
|
};
|
|
1232
|
-
var distanceHiddenUndefined =
|
|
1215
|
+
var distanceHiddenUndefined = z47.custom().transform((a) => {
|
|
1233
1216
|
if (a === void 0) return void 0;
|
|
1234
1217
|
return distance16.parse(a);
|
|
1235
1218
|
});
|
|
1236
|
-
var platedHolePropsByShape =
|
|
1219
|
+
var platedHolePropsByShape = z47.discriminatedUnion("shape", [
|
|
1237
1220
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1238
|
-
name:
|
|
1239
|
-
connectsTo:
|
|
1240
|
-
shape:
|
|
1221
|
+
name: z47.string().optional(),
|
|
1222
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1223
|
+
shape: z47.literal("circle"),
|
|
1241
1224
|
holeDiameter: distance16,
|
|
1242
1225
|
outerDiameter: distance16,
|
|
1243
1226
|
padDiameter: distance16.optional().describe("Diameter of the copper pad"),
|
|
1244
1227
|
portHints: portHints.optional(),
|
|
1245
1228
|
solderMaskMargin: distance16.optional(),
|
|
1246
|
-
coveredWithSolderMask:
|
|
1229
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1247
1230
|
}),
|
|
1248
1231
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1249
|
-
name:
|
|
1250
|
-
connectsTo:
|
|
1251
|
-
shape:
|
|
1232
|
+
name: z47.string().optional(),
|
|
1233
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1234
|
+
shape: z47.literal("oval"),
|
|
1252
1235
|
outerWidth: distance16,
|
|
1253
1236
|
outerHeight: distance16,
|
|
1254
1237
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1257,13 +1240,13 @@ var platedHolePropsByShape = z46.discriminatedUnion("shape", [
|
|
|
1257
1240
|
innerHeight: distance16.optional().describe("DEPRECATED use holeHeight"),
|
|
1258
1241
|
portHints: portHints.optional(),
|
|
1259
1242
|
solderMaskMargin: distance16.optional(),
|
|
1260
|
-
coveredWithSolderMask:
|
|
1243
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1261
1244
|
}),
|
|
1262
1245
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1263
|
-
name:
|
|
1264
|
-
connectsTo:
|
|
1265
|
-
shape:
|
|
1266
|
-
rectPad:
|
|
1246
|
+
name: z47.string().optional(),
|
|
1247
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1248
|
+
shape: z47.literal("pill"),
|
|
1249
|
+
rectPad: z47.boolean().optional(),
|
|
1267
1250
|
outerWidth: distance16,
|
|
1268
1251
|
outerHeight: distance16,
|
|
1269
1252
|
holeWidth: distanceHiddenUndefined,
|
|
@@ -1274,30 +1257,30 @@ var platedHolePropsByShape = z46.discriminatedUnion("shape", [
|
|
|
1274
1257
|
holeOffsetX: distance16.optional(),
|
|
1275
1258
|
holeOffsetY: distance16.optional(),
|
|
1276
1259
|
solderMaskMargin: distance16.optional(),
|
|
1277
|
-
coveredWithSolderMask:
|
|
1260
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1278
1261
|
}),
|
|
1279
1262
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1280
|
-
name:
|
|
1281
|
-
connectsTo:
|
|
1282
|
-
shape:
|
|
1263
|
+
name: z47.string().optional(),
|
|
1264
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1265
|
+
shape: z47.literal("circular_hole_with_rect_pad"),
|
|
1283
1266
|
holeDiameter: distance16,
|
|
1284
1267
|
rectPadWidth: distance16,
|
|
1285
1268
|
rectPadHeight: distance16,
|
|
1286
1269
|
rectBorderRadius: distance16.optional(),
|
|
1287
|
-
holeShape:
|
|
1288
|
-
padShape:
|
|
1270
|
+
holeShape: z47.literal("circle").optional(),
|
|
1271
|
+
padShape: z47.literal("rect").optional(),
|
|
1289
1272
|
portHints: portHints.optional(),
|
|
1290
1273
|
holeOffsetX: distance16.optional(),
|
|
1291
1274
|
holeOffsetY: distance16.optional(),
|
|
1292
1275
|
solderMaskMargin: distance16.optional(),
|
|
1293
|
-
coveredWithSolderMask:
|
|
1276
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1294
1277
|
}),
|
|
1295
1278
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
1296
|
-
name:
|
|
1297
|
-
connectsTo:
|
|
1298
|
-
shape:
|
|
1299
|
-
holeShape:
|
|
1300
|
-
padShape:
|
|
1279
|
+
name: z47.string().optional(),
|
|
1280
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1281
|
+
shape: z47.literal("pill_hole_with_rect_pad"),
|
|
1282
|
+
holeShape: z47.literal("pill").optional(),
|
|
1283
|
+
padShape: z47.literal("rect").optional(),
|
|
1301
1284
|
holeWidth: distance16,
|
|
1302
1285
|
holeHeight: distance16,
|
|
1303
1286
|
rectPadWidth: distance16,
|
|
@@ -1306,22 +1289,22 @@ var platedHolePropsByShape = z46.discriminatedUnion("shape", [
|
|
|
1306
1289
|
holeOffsetX: distance16.optional(),
|
|
1307
1290
|
holeOffsetY: distance16.optional(),
|
|
1308
1291
|
solderMaskMargin: distance16.optional(),
|
|
1309
|
-
coveredWithSolderMask:
|
|
1292
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1310
1293
|
}),
|
|
1311
1294
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1312
|
-
name:
|
|
1313
|
-
connectsTo:
|
|
1314
|
-
shape:
|
|
1315
|
-
holeShape:
|
|
1295
|
+
name: z47.string().optional(),
|
|
1296
|
+
connectsTo: z47.string().or(z47.array(z47.string())).optional(),
|
|
1297
|
+
shape: z47.literal("hole_with_polygon_pad"),
|
|
1298
|
+
holeShape: z47.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
1316
1299
|
holeDiameter: distance16.optional(),
|
|
1317
1300
|
holeWidth: distance16.optional(),
|
|
1318
1301
|
holeHeight: distance16.optional(),
|
|
1319
|
-
padOutline:
|
|
1302
|
+
padOutline: z47.array(point),
|
|
1320
1303
|
holeOffsetX: distance16,
|
|
1321
1304
|
holeOffsetY: distance16,
|
|
1322
1305
|
portHints: portHints.optional(),
|
|
1323
1306
|
solderMaskMargin: distance16.optional(),
|
|
1324
|
-
coveredWithSolderMask:
|
|
1307
|
+
coveredWithSolderMask: z47.boolean().optional()
|
|
1325
1308
|
})
|
|
1326
1309
|
]).transform((a) => {
|
|
1327
1310
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -1332,7 +1315,7 @@ var platedHolePropsByShape = z46.discriminatedUnion("shape", [
|
|
|
1332
1315
|
}
|
|
1333
1316
|
return a;
|
|
1334
1317
|
});
|
|
1335
|
-
var platedHoleProps =
|
|
1318
|
+
var platedHoleProps = z47.preprocess(
|
|
1336
1319
|
inferPlatedHoleShapeAndDefaults,
|
|
1337
1320
|
platedHolePropsByShape
|
|
1338
1321
|
);
|
|
@@ -1340,11 +1323,11 @@ expectTypesMatch(true);
|
|
|
1340
1323
|
|
|
1341
1324
|
// lib/components/resistor.ts
|
|
1342
1325
|
import { resistance } from "circuit-json";
|
|
1343
|
-
import { z as
|
|
1326
|
+
import { z as z48 } from "zod";
|
|
1344
1327
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1345
1328
|
var resistorProps = commonComponentProps.extend({
|
|
1346
1329
|
resistance,
|
|
1347
|
-
tolerance:
|
|
1330
|
+
tolerance: z48.union([z48.string(), z48.number()]).transform((val) => {
|
|
1348
1331
|
if (typeof val === "string") {
|
|
1349
1332
|
if (val.endsWith("%")) {
|
|
1350
1333
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1353,12 +1336,12 @@ var resistorProps = commonComponentProps.extend({
|
|
|
1353
1336
|
}
|
|
1354
1337
|
return val;
|
|
1355
1338
|
}).pipe(
|
|
1356
|
-
|
|
1339
|
+
z48.number().min(0, "Tolerance must be non-negative").max(1, "Tolerance cannot be greater than 100%")
|
|
1357
1340
|
).optional(),
|
|
1358
|
-
pullupFor:
|
|
1359
|
-
pullupTo:
|
|
1360
|
-
pulldownFor:
|
|
1361
|
-
pulldownTo:
|
|
1341
|
+
pullupFor: z48.string().optional(),
|
|
1342
|
+
pullupTo: z48.string().optional(),
|
|
1343
|
+
pulldownFor: z48.string().optional(),
|
|
1344
|
+
pulldownTo: z48.string().optional(),
|
|
1362
1345
|
schOrientation: schematicOrientation.optional(),
|
|
1363
1346
|
schSize: schematicSymbolSize.optional(),
|
|
1364
1347
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
@@ -1368,25 +1351,25 @@ expectTypesMatch(true);
|
|
|
1368
1351
|
|
|
1369
1352
|
// lib/components/potentiometer.ts
|
|
1370
1353
|
import { resistance as resistance2 } from "circuit-json";
|
|
1371
|
-
import { z as
|
|
1354
|
+
import { z as z49 } from "zod";
|
|
1372
1355
|
var potentiometerPinLabels = ["pin1", "pin2", "pin3"];
|
|
1373
1356
|
var potentiometerProps = commonComponentProps.extend({
|
|
1374
1357
|
maxResistance: resistance2,
|
|
1375
|
-
pinVariant:
|
|
1358
|
+
pinVariant: z49.enum(["two_pin", "three_pin"]).optional(),
|
|
1376
1359
|
connections: createConnectionsProp(potentiometerPinLabels).optional()
|
|
1377
1360
|
});
|
|
1378
1361
|
expectTypesMatch(true);
|
|
1379
1362
|
|
|
1380
1363
|
// lib/components/crystal.ts
|
|
1381
1364
|
import { frequency, capacitance } from "circuit-json";
|
|
1382
|
-
import { z as
|
|
1365
|
+
import { z as z50 } from "zod";
|
|
1383
1366
|
var crystalPins = lrPins;
|
|
1384
1367
|
var crystalProps = commonComponentProps.extend({
|
|
1385
1368
|
frequency,
|
|
1386
1369
|
loadCapacitance: capacitance,
|
|
1387
|
-
manufacturerPartNumber:
|
|
1388
|
-
mpn:
|
|
1389
|
-
pinVariant:
|
|
1370
|
+
manufacturerPartNumber: z50.string().optional(),
|
|
1371
|
+
mpn: z50.string().optional(),
|
|
1372
|
+
pinVariant: z50.enum(["two_pin", "four_pin"]).optional(),
|
|
1390
1373
|
schOrientation: schematicOrientation.optional(),
|
|
1391
1374
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1392
1375
|
});
|
|
@@ -1394,34 +1377,34 @@ expectTypesMatch(true);
|
|
|
1394
1377
|
|
|
1395
1378
|
// lib/components/resonator.ts
|
|
1396
1379
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1397
|
-
import { z as
|
|
1380
|
+
import { z as z51 } from "zod";
|
|
1398
1381
|
var resonatorProps = commonComponentProps.extend({
|
|
1399
1382
|
frequency: frequency2,
|
|
1400
1383
|
loadCapacitance: capacitance2,
|
|
1401
|
-
pinVariant:
|
|
1384
|
+
pinVariant: z51.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1402
1385
|
});
|
|
1403
1386
|
expectTypesMatch(true);
|
|
1404
1387
|
|
|
1405
1388
|
// lib/components/stampboard.ts
|
|
1406
1389
|
import { distance as distance17 } from "circuit-json";
|
|
1407
|
-
import { z as
|
|
1390
|
+
import { z as z52 } from "zod";
|
|
1408
1391
|
var stampboardProps = boardProps.extend({
|
|
1409
|
-
leftPinCount:
|
|
1410
|
-
rightPinCount:
|
|
1411
|
-
topPinCount:
|
|
1412
|
-
bottomPinCount:
|
|
1413
|
-
leftPins:
|
|
1414
|
-
rightPins:
|
|
1415
|
-
topPins:
|
|
1416
|
-
bottomPins:
|
|
1392
|
+
leftPinCount: z52.number().optional(),
|
|
1393
|
+
rightPinCount: z52.number().optional(),
|
|
1394
|
+
topPinCount: z52.number().optional(),
|
|
1395
|
+
bottomPinCount: z52.number().optional(),
|
|
1396
|
+
leftPins: z52.array(z52.string()).optional(),
|
|
1397
|
+
rightPins: z52.array(z52.string()).optional(),
|
|
1398
|
+
topPins: z52.array(z52.string()).optional(),
|
|
1399
|
+
bottomPins: z52.array(z52.string()).optional(),
|
|
1417
1400
|
pinPitch: distance17.optional(),
|
|
1418
|
-
innerHoles:
|
|
1401
|
+
innerHoles: z52.boolean().optional()
|
|
1419
1402
|
});
|
|
1420
1403
|
expectTypesMatch(true);
|
|
1421
1404
|
|
|
1422
1405
|
// lib/components/capacitor.ts
|
|
1423
1406
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1424
|
-
import { z as
|
|
1407
|
+
import { z as z53 } from "zod";
|
|
1425
1408
|
var capacitorPinLabels = [
|
|
1426
1409
|
"pin1",
|
|
1427
1410
|
"pin2",
|
|
@@ -1433,13 +1416,13 @@ var capacitorPinLabels = [
|
|
|
1433
1416
|
var capacitorProps = commonComponentProps.extend({
|
|
1434
1417
|
capacitance: capacitance3,
|
|
1435
1418
|
maxVoltageRating: voltage.optional(),
|
|
1436
|
-
schShowRatings:
|
|
1437
|
-
polarized:
|
|
1438
|
-
decouplingFor:
|
|
1439
|
-
decouplingTo:
|
|
1440
|
-
bypassFor:
|
|
1441
|
-
bypassTo:
|
|
1442
|
-
maxDecouplingTraceLength:
|
|
1419
|
+
schShowRatings: z53.boolean().optional().default(false),
|
|
1420
|
+
polarized: z53.boolean().optional().default(false),
|
|
1421
|
+
decouplingFor: z53.string().optional(),
|
|
1422
|
+
decouplingTo: z53.string().optional(),
|
|
1423
|
+
bypassFor: z53.string().optional(),
|
|
1424
|
+
bypassTo: z53.string().optional(),
|
|
1425
|
+
maxDecouplingTraceLength: z53.number().optional(),
|
|
1443
1426
|
schOrientation: schematicOrientation.optional(),
|
|
1444
1427
|
schSize: schematicSymbolSize.optional(),
|
|
1445
1428
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
@@ -1448,13 +1431,13 @@ var capacitorPins = lrPolarPins;
|
|
|
1448
1431
|
expectTypesMatch(true);
|
|
1449
1432
|
|
|
1450
1433
|
// lib/components/net.ts
|
|
1451
|
-
import { z as
|
|
1452
|
-
var netProps =
|
|
1453
|
-
name:
|
|
1454
|
-
connectsTo:
|
|
1455
|
-
highlightColor:
|
|
1456
|
-
isPowerNet:
|
|
1457
|
-
isGroundNet:
|
|
1434
|
+
import { z as z54 } from "zod";
|
|
1435
|
+
var netProps = z54.object({
|
|
1436
|
+
name: z54.string(),
|
|
1437
|
+
connectsTo: z54.string().or(z54.array(z54.string())).optional(),
|
|
1438
|
+
highlightColor: z54.string().optional(),
|
|
1439
|
+
isPowerNet: z54.boolean().optional(),
|
|
1440
|
+
isGroundNet: z54.boolean().optional()
|
|
1458
1441
|
});
|
|
1459
1442
|
expectTypesMatch(true);
|
|
1460
1443
|
|
|
@@ -1467,55 +1450,55 @@ var fiducialProps = commonComponentProps.extend({
|
|
|
1467
1450
|
expectTypesMatch(true);
|
|
1468
1451
|
|
|
1469
1452
|
// lib/components/constrainedlayout.ts
|
|
1470
|
-
import { z as
|
|
1471
|
-
var constrainedLayoutProps =
|
|
1472
|
-
name:
|
|
1473
|
-
pcbOnly:
|
|
1474
|
-
schOnly:
|
|
1453
|
+
import { z as z56 } from "zod";
|
|
1454
|
+
var constrainedLayoutProps = z56.object({
|
|
1455
|
+
name: z56.string().optional(),
|
|
1456
|
+
pcbOnly: z56.boolean().optional(),
|
|
1457
|
+
schOnly: z56.boolean().optional()
|
|
1475
1458
|
});
|
|
1476
1459
|
expectTypesMatch(true);
|
|
1477
1460
|
|
|
1478
1461
|
// lib/components/constraint.ts
|
|
1479
|
-
import { z as
|
|
1480
|
-
var pcbXDistConstraintProps =
|
|
1481
|
-
pcb:
|
|
1462
|
+
import { z as z57 } from "zod";
|
|
1463
|
+
var pcbXDistConstraintProps = z57.object({
|
|
1464
|
+
pcb: z57.literal(true).optional(),
|
|
1482
1465
|
xDist: distance,
|
|
1483
|
-
left:
|
|
1484
|
-
right:
|
|
1485
|
-
edgeToEdge:
|
|
1486
|
-
centerToCenter:
|
|
1466
|
+
left: z57.string(),
|
|
1467
|
+
right: z57.string(),
|
|
1468
|
+
edgeToEdge: z57.literal(true).optional(),
|
|
1469
|
+
centerToCenter: z57.literal(true).optional()
|
|
1487
1470
|
});
|
|
1488
1471
|
expectTypesMatch(
|
|
1489
1472
|
true
|
|
1490
1473
|
);
|
|
1491
|
-
var pcbYDistConstraintProps =
|
|
1492
|
-
pcb:
|
|
1474
|
+
var pcbYDistConstraintProps = z57.object({
|
|
1475
|
+
pcb: z57.literal(true).optional(),
|
|
1493
1476
|
yDist: distance,
|
|
1494
|
-
top:
|
|
1495
|
-
bottom:
|
|
1496
|
-
edgeToEdge:
|
|
1497
|
-
centerToCenter:
|
|
1477
|
+
top: z57.string(),
|
|
1478
|
+
bottom: z57.string(),
|
|
1479
|
+
edgeToEdge: z57.literal(true).optional(),
|
|
1480
|
+
centerToCenter: z57.literal(true).optional()
|
|
1498
1481
|
});
|
|
1499
1482
|
expectTypesMatch(
|
|
1500
1483
|
true
|
|
1501
1484
|
);
|
|
1502
|
-
var pcbSameYConstraintProps =
|
|
1503
|
-
pcb:
|
|
1504
|
-
sameY:
|
|
1505
|
-
for:
|
|
1485
|
+
var pcbSameYConstraintProps = z57.object({
|
|
1486
|
+
pcb: z57.literal(true).optional(),
|
|
1487
|
+
sameY: z57.literal(true).optional(),
|
|
1488
|
+
for: z57.array(z57.string())
|
|
1506
1489
|
});
|
|
1507
1490
|
expectTypesMatch(
|
|
1508
1491
|
true
|
|
1509
1492
|
);
|
|
1510
|
-
var pcbSameXConstraintProps =
|
|
1511
|
-
pcb:
|
|
1512
|
-
sameX:
|
|
1513
|
-
for:
|
|
1493
|
+
var pcbSameXConstraintProps = z57.object({
|
|
1494
|
+
pcb: z57.literal(true).optional(),
|
|
1495
|
+
sameX: z57.literal(true).optional(),
|
|
1496
|
+
for: z57.array(z57.string())
|
|
1514
1497
|
});
|
|
1515
1498
|
expectTypesMatch(
|
|
1516
1499
|
true
|
|
1517
1500
|
);
|
|
1518
|
-
var constraintProps =
|
|
1501
|
+
var constraintProps = z57.union([
|
|
1519
1502
|
pcbXDistConstraintProps,
|
|
1520
1503
|
pcbYDistConstraintProps,
|
|
1521
1504
|
pcbSameYConstraintProps,
|
|
@@ -1524,13 +1507,13 @@ var constraintProps = z56.union([
|
|
|
1524
1507
|
expectTypesMatch(true);
|
|
1525
1508
|
|
|
1526
1509
|
// lib/components/cutout.ts
|
|
1527
|
-
import { z as
|
|
1510
|
+
import { z as z58 } from "zod";
|
|
1528
1511
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1529
1512
|
layer: true,
|
|
1530
1513
|
pcbRotation: true
|
|
1531
1514
|
}).extend({
|
|
1532
|
-
name:
|
|
1533
|
-
shape:
|
|
1515
|
+
name: z58.string().optional(),
|
|
1516
|
+
shape: z58.literal("rect"),
|
|
1534
1517
|
width: distance,
|
|
1535
1518
|
height: distance
|
|
1536
1519
|
});
|
|
@@ -1539,8 +1522,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1539
1522
|
layer: true,
|
|
1540
1523
|
pcbRotation: true
|
|
1541
1524
|
}).extend({
|
|
1542
|
-
name:
|
|
1543
|
-
shape:
|
|
1525
|
+
name: z58.string().optional(),
|
|
1526
|
+
shape: z58.literal("circle"),
|
|
1544
1527
|
radius: distance
|
|
1545
1528
|
});
|
|
1546
1529
|
expectTypesMatch(true);
|
|
@@ -1548,28 +1531,28 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1548
1531
|
layer: true,
|
|
1549
1532
|
pcbRotation: true
|
|
1550
1533
|
}).extend({
|
|
1551
|
-
name:
|
|
1552
|
-
shape:
|
|
1553
|
-
points:
|
|
1534
|
+
name: z58.string().optional(),
|
|
1535
|
+
shape: z58.literal("polygon"),
|
|
1536
|
+
points: z58.array(point)
|
|
1554
1537
|
});
|
|
1555
1538
|
expectTypesMatch(true);
|
|
1556
|
-
var cutoutProps =
|
|
1539
|
+
var cutoutProps = z58.discriminatedUnion("shape", [
|
|
1557
1540
|
rectCutoutProps,
|
|
1558
1541
|
circleCutoutProps,
|
|
1559
1542
|
polygonCutoutProps
|
|
1560
1543
|
]);
|
|
1561
1544
|
|
|
1562
1545
|
// lib/components/smtpad.ts
|
|
1563
|
-
import { z as
|
|
1546
|
+
import { z as z59 } from "zod";
|
|
1564
1547
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1565
|
-
name:
|
|
1566
|
-
shape:
|
|
1548
|
+
name: z59.string().optional(),
|
|
1549
|
+
shape: z59.literal("rect"),
|
|
1567
1550
|
width: distance,
|
|
1568
1551
|
height: distance,
|
|
1569
1552
|
rectBorderRadius: distance.optional(),
|
|
1570
1553
|
cornerRadius: distance.optional(),
|
|
1571
1554
|
portHints: portHints.optional(),
|
|
1572
|
-
coveredWithSolderMask:
|
|
1555
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1573
1556
|
solderMaskMargin: distance.optional(),
|
|
1574
1557
|
solderMaskMarginLeft: distance.optional(),
|
|
1575
1558
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1578,14 +1561,14 @@ var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1578
1561
|
});
|
|
1579
1562
|
expectTypesMatch(true);
|
|
1580
1563
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1581
|
-
name:
|
|
1582
|
-
shape:
|
|
1564
|
+
name: z59.string().optional(),
|
|
1565
|
+
shape: z59.literal("rotated_rect"),
|
|
1583
1566
|
width: distance,
|
|
1584
1567
|
height: distance,
|
|
1585
|
-
ccwRotation:
|
|
1568
|
+
ccwRotation: z59.number(),
|
|
1586
1569
|
cornerRadius: distance.optional(),
|
|
1587
1570
|
portHints: portHints.optional(),
|
|
1588
|
-
coveredWithSolderMask:
|
|
1571
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1589
1572
|
solderMaskMargin: distance.optional(),
|
|
1590
1573
|
solderMaskMarginLeft: distance.optional(),
|
|
1591
1574
|
solderMaskMarginRight: distance.optional(),
|
|
@@ -1594,35 +1577,35 @@ var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
1594
1577
|
});
|
|
1595
1578
|
expectTypesMatch(true);
|
|
1596
1579
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1597
|
-
name:
|
|
1598
|
-
shape:
|
|
1580
|
+
name: z59.string().optional(),
|
|
1581
|
+
shape: z59.literal("circle"),
|
|
1599
1582
|
radius: distance,
|
|
1600
1583
|
portHints: portHints.optional(),
|
|
1601
|
-
coveredWithSolderMask:
|
|
1584
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1602
1585
|
solderMaskMargin: distance.optional()
|
|
1603
1586
|
});
|
|
1604
1587
|
expectTypesMatch(true);
|
|
1605
1588
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1606
|
-
name:
|
|
1607
|
-
shape:
|
|
1589
|
+
name: z59.string().optional(),
|
|
1590
|
+
shape: z59.literal("pill"),
|
|
1608
1591
|
width: distance,
|
|
1609
1592
|
height: distance,
|
|
1610
1593
|
radius: distance,
|
|
1611
1594
|
portHints: portHints.optional(),
|
|
1612
|
-
coveredWithSolderMask:
|
|
1595
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1613
1596
|
solderMaskMargin: distance.optional()
|
|
1614
1597
|
});
|
|
1615
1598
|
expectTypesMatch(true);
|
|
1616
1599
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1617
|
-
name:
|
|
1618
|
-
shape:
|
|
1619
|
-
points:
|
|
1600
|
+
name: z59.string().optional(),
|
|
1601
|
+
shape: z59.literal("polygon"),
|
|
1602
|
+
points: z59.array(point),
|
|
1620
1603
|
portHints: portHints.optional(),
|
|
1621
|
-
coveredWithSolderMask:
|
|
1604
|
+
coveredWithSolderMask: z59.boolean().optional(),
|
|
1622
1605
|
solderMaskMargin: distance.optional()
|
|
1623
1606
|
});
|
|
1624
1607
|
expectTypesMatch(true);
|
|
1625
|
-
var smtPadProps =
|
|
1608
|
+
var smtPadProps = z59.discriminatedUnion("shape", [
|
|
1626
1609
|
circleSmtPadProps,
|
|
1627
1610
|
rectSmtPadProps,
|
|
1628
1611
|
rotatedRectSmtPadProps,
|
|
@@ -1632,55 +1615,55 @@ var smtPadProps = z58.discriminatedUnion("shape", [
|
|
|
1632
1615
|
expectTypesMatch(true);
|
|
1633
1616
|
|
|
1634
1617
|
// lib/components/solderpaste.ts
|
|
1635
|
-
import { z as
|
|
1618
|
+
import { z as z60 } from "zod";
|
|
1636
1619
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1637
|
-
shape:
|
|
1620
|
+
shape: z60.literal("rect"),
|
|
1638
1621
|
width: distance,
|
|
1639
1622
|
height: distance
|
|
1640
1623
|
});
|
|
1641
1624
|
expectTypesMatch(true);
|
|
1642
1625
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1643
|
-
shape:
|
|
1626
|
+
shape: z60.literal("circle"),
|
|
1644
1627
|
radius: distance
|
|
1645
1628
|
});
|
|
1646
1629
|
expectTypesMatch(true);
|
|
1647
|
-
var solderPasteProps =
|
|
1630
|
+
var solderPasteProps = z60.union([
|
|
1648
1631
|
circleSolderPasteProps,
|
|
1649
1632
|
rectSolderPasteProps
|
|
1650
1633
|
]);
|
|
1651
1634
|
expectTypesMatch(true);
|
|
1652
1635
|
|
|
1653
1636
|
// lib/components/hole.ts
|
|
1654
|
-
import { z as
|
|
1637
|
+
import { z as z61 } from "zod";
|
|
1655
1638
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1656
|
-
name:
|
|
1657
|
-
shape:
|
|
1639
|
+
name: z61.string().optional(),
|
|
1640
|
+
shape: z61.literal("circle").optional(),
|
|
1658
1641
|
diameter: distance.optional(),
|
|
1659
1642
|
radius: distance.optional(),
|
|
1660
1643
|
solderMaskMargin: distance.optional(),
|
|
1661
|
-
coveredWithSolderMask:
|
|
1644
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1662
1645
|
}).transform((d) => ({
|
|
1663
1646
|
...d,
|
|
1664
1647
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1665
1648
|
radius: d.radius ?? d.diameter / 2
|
|
1666
1649
|
}));
|
|
1667
1650
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1668
|
-
name:
|
|
1669
|
-
shape:
|
|
1651
|
+
name: z61.string().optional(),
|
|
1652
|
+
shape: z61.literal("pill"),
|
|
1670
1653
|
width: distance,
|
|
1671
1654
|
height: distance,
|
|
1672
1655
|
solderMaskMargin: distance.optional(),
|
|
1673
|
-
coveredWithSolderMask:
|
|
1656
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1674
1657
|
});
|
|
1675
1658
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1676
|
-
name:
|
|
1677
|
-
shape:
|
|
1659
|
+
name: z61.string().optional(),
|
|
1660
|
+
shape: z61.literal("rect"),
|
|
1678
1661
|
width: distance,
|
|
1679
1662
|
height: distance,
|
|
1680
1663
|
solderMaskMargin: distance.optional(),
|
|
1681
|
-
coveredWithSolderMask:
|
|
1664
|
+
coveredWithSolderMask: z61.boolean().optional()
|
|
1682
1665
|
});
|
|
1683
|
-
var holeProps =
|
|
1666
|
+
var holeProps = z61.union([
|
|
1684
1667
|
circleHoleProps,
|
|
1685
1668
|
pillHoleProps,
|
|
1686
1669
|
rectHoleProps
|
|
@@ -1689,54 +1672,54 @@ expectTypesMatch(true);
|
|
|
1689
1672
|
|
|
1690
1673
|
// lib/components/trace.ts
|
|
1691
1674
|
import { distance as distance18, layer_ref as layer_ref4, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1692
|
-
import { z as
|
|
1693
|
-
var portRef =
|
|
1694
|
-
|
|
1695
|
-
|
|
1675
|
+
import { z as z62 } from "zod";
|
|
1676
|
+
var portRef = z62.union([
|
|
1677
|
+
z62.string(),
|
|
1678
|
+
z62.custom(
|
|
1696
1679
|
(v) => Boolean(v.getPortSelector)
|
|
1697
1680
|
)
|
|
1698
1681
|
]);
|
|
1699
1682
|
var pcbPathPoint = point.extend({
|
|
1700
|
-
via:
|
|
1683
|
+
via: z62.boolean().optional(),
|
|
1701
1684
|
fromLayer: layer_ref4.optional(),
|
|
1702
1685
|
toLayer: layer_ref4.optional()
|
|
1703
1686
|
}).superRefine((value, ctx) => {
|
|
1704
1687
|
if (value.via) {
|
|
1705
1688
|
if (!value.toLayer) {
|
|
1706
1689
|
ctx.addIssue({
|
|
1707
|
-
code:
|
|
1690
|
+
code: z62.ZodIssueCode.custom,
|
|
1708
1691
|
message: "toLayer is required when via is true",
|
|
1709
1692
|
path: ["toLayer"]
|
|
1710
1693
|
});
|
|
1711
1694
|
}
|
|
1712
1695
|
} else if (value.fromLayer || value.toLayer) {
|
|
1713
1696
|
ctx.addIssue({
|
|
1714
|
-
code:
|
|
1697
|
+
code: z62.ZodIssueCode.custom,
|
|
1715
1698
|
message: "fromLayer/toLayer are only allowed when via is true",
|
|
1716
1699
|
path: ["via"]
|
|
1717
1700
|
});
|
|
1718
1701
|
}
|
|
1719
1702
|
});
|
|
1720
|
-
var pcbPath =
|
|
1721
|
-
var baseTraceProps =
|
|
1722
|
-
key:
|
|
1703
|
+
var pcbPath = z62.array(z62.union([pcbPathPoint, z62.string()]));
|
|
1704
|
+
var baseTraceProps = z62.object({
|
|
1705
|
+
key: z62.string().optional(),
|
|
1723
1706
|
thickness: distance18.optional(),
|
|
1724
1707
|
width: distance18.optional().describe("Alias for trace thickness"),
|
|
1725
|
-
schematicRouteHints:
|
|
1726
|
-
pcbRouteHints:
|
|
1727
|
-
pcbPathRelativeTo:
|
|
1708
|
+
schematicRouteHints: z62.array(point).optional(),
|
|
1709
|
+
pcbRouteHints: z62.array(route_hint_point2).optional(),
|
|
1710
|
+
pcbPathRelativeTo: z62.string().optional(),
|
|
1728
1711
|
pcbPath: pcbPath.optional(),
|
|
1729
|
-
pcbPaths:
|
|
1730
|
-
pcbStraightLine:
|
|
1731
|
-
schDisplayLabel:
|
|
1732
|
-
schStroke:
|
|
1733
|
-
highlightColor:
|
|
1712
|
+
pcbPaths: z62.array(pcbPath).optional(),
|
|
1713
|
+
pcbStraightLine: z62.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1714
|
+
schDisplayLabel: z62.string().optional(),
|
|
1715
|
+
schStroke: z62.string().optional(),
|
|
1716
|
+
highlightColor: z62.string().optional(),
|
|
1734
1717
|
maxLength: distance18.optional(),
|
|
1735
|
-
connectsTo:
|
|
1718
|
+
connectsTo: z62.string().or(z62.array(z62.string())).optional()
|
|
1736
1719
|
});
|
|
1737
|
-
var traceProps =
|
|
1720
|
+
var traceProps = z62.union([
|
|
1738
1721
|
baseTraceProps.extend({
|
|
1739
|
-
path:
|
|
1722
|
+
path: z62.array(portRef)
|
|
1740
1723
|
}),
|
|
1741
1724
|
baseTraceProps.extend({
|
|
1742
1725
|
from: portRef,
|
|
@@ -1746,29 +1729,29 @@ var traceProps = z61.union([
|
|
|
1746
1729
|
|
|
1747
1730
|
// lib/components/footprint.ts
|
|
1748
1731
|
import { layer_ref as layer_ref5 } from "circuit-json";
|
|
1749
|
-
import { z as
|
|
1750
|
-
var footprintProps =
|
|
1751
|
-
children:
|
|
1732
|
+
import { z as z63 } from "zod";
|
|
1733
|
+
var footprintProps = z63.object({
|
|
1734
|
+
children: z63.any().optional(),
|
|
1752
1735
|
originalLayer: layer_ref5.default("top").optional(),
|
|
1753
|
-
circuitJson:
|
|
1736
|
+
circuitJson: z63.array(z63.any()).optional(),
|
|
1754
1737
|
src: footprintProp.describe("Can be a footprint or kicad string").optional()
|
|
1755
1738
|
});
|
|
1756
1739
|
expectTypesMatch(true);
|
|
1757
1740
|
|
|
1758
1741
|
// lib/components/symbol.ts
|
|
1759
|
-
import { z as
|
|
1760
|
-
var symbolProps =
|
|
1761
|
-
originalFacingDirection:
|
|
1742
|
+
import { z as z64 } from "zod";
|
|
1743
|
+
var symbolProps = z64.object({
|
|
1744
|
+
originalFacingDirection: z64.enum(["up", "down", "left", "right"]).default("right").optional(),
|
|
1762
1745
|
width: distance.optional(),
|
|
1763
1746
|
height: distance.optional(),
|
|
1764
|
-
name:
|
|
1747
|
+
name: z64.string().optional()
|
|
1765
1748
|
});
|
|
1766
1749
|
expectTypesMatch(true);
|
|
1767
1750
|
|
|
1768
1751
|
// lib/components/battery.ts
|
|
1769
1752
|
import { voltage as voltage2 } from "circuit-json";
|
|
1770
|
-
import { z as
|
|
1771
|
-
var capacity =
|
|
1753
|
+
import { z as z65 } from "zod";
|
|
1754
|
+
var capacity = z65.number().or(z65.string().endsWith("mAh")).transform((v) => {
|
|
1772
1755
|
if (typeof v === "string") {
|
|
1773
1756
|
const valString = v.replace("mAh", "");
|
|
1774
1757
|
const num = Number.parseFloat(valString);
|
|
@@ -1782,14 +1765,14 @@ var capacity = z64.number().or(z64.string().endsWith("mAh")).transform((v) => {
|
|
|
1782
1765
|
var batteryProps = commonComponentProps.extend({
|
|
1783
1766
|
capacity: capacity.optional(),
|
|
1784
1767
|
voltage: voltage2.optional(),
|
|
1785
|
-
standard:
|
|
1768
|
+
standard: z65.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1786
1769
|
schOrientation: schematicOrientation.optional()
|
|
1787
1770
|
});
|
|
1788
1771
|
var batteryPins = lrPolarPins;
|
|
1789
1772
|
expectTypesMatch(true);
|
|
1790
1773
|
|
|
1791
1774
|
// lib/components/mountedboard.ts
|
|
1792
|
-
import { z as
|
|
1775
|
+
import { z as z66 } from "zod";
|
|
1793
1776
|
var mountedboardProps = subcircuitGroupProps.extend({
|
|
1794
1777
|
manufacturerPartNumber: chipProps.shape.manufacturerPartNumber,
|
|
1795
1778
|
pinLabels: chipProps.shape.pinLabels,
|
|
@@ -1801,7 +1784,7 @@ var mountedboardProps = subcircuitGroupProps.extend({
|
|
|
1801
1784
|
internallyConnectedPins: chipProps.shape.internallyConnectedPins,
|
|
1802
1785
|
externallyConnectedPins: chipProps.shape.externallyConnectedPins,
|
|
1803
1786
|
boardToBoardDistance: distance.optional(),
|
|
1804
|
-
mountOrientation:
|
|
1787
|
+
mountOrientation: z66.enum(["faceDown", "faceUp"]).optional()
|
|
1805
1788
|
});
|
|
1806
1789
|
expectTypesMatch(true);
|
|
1807
1790
|
|
|
@@ -1809,29 +1792,29 @@ expectTypesMatch(true);
|
|
|
1809
1792
|
import { distance as distance19 } from "circuit-json";
|
|
1810
1793
|
|
|
1811
1794
|
// lib/common/pcbOrientation.ts
|
|
1812
|
-
import { z as
|
|
1813
|
-
var pcbOrientation =
|
|
1795
|
+
import { z as z67 } from "zod";
|
|
1796
|
+
var pcbOrientation = z67.enum(["vertical", "horizontal"]).describe(
|
|
1814
1797
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1815
1798
|
);
|
|
1816
1799
|
expectTypesMatch(true);
|
|
1817
1800
|
|
|
1818
1801
|
// lib/components/pin-header.ts
|
|
1819
|
-
import { z as
|
|
1802
|
+
import { z as z68 } from "zod";
|
|
1820
1803
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1821
|
-
pinCount:
|
|
1804
|
+
pinCount: z68.number(),
|
|
1822
1805
|
pitch: distance19.optional(),
|
|
1823
|
-
schFacingDirection:
|
|
1824
|
-
gender:
|
|
1825
|
-
showSilkscreenPinLabels:
|
|
1826
|
-
pcbPinLabels:
|
|
1827
|
-
doubleRow:
|
|
1828
|
-
rightAngle:
|
|
1806
|
+
schFacingDirection: z68.enum(["up", "down", "left", "right"]).optional(),
|
|
1807
|
+
gender: z68.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1808
|
+
showSilkscreenPinLabels: z68.boolean().optional(),
|
|
1809
|
+
pcbPinLabels: z68.record(z68.string(), z68.string()).optional(),
|
|
1810
|
+
doubleRow: z68.boolean().optional(),
|
|
1811
|
+
rightAngle: z68.boolean().optional(),
|
|
1829
1812
|
pcbOrientation: pcbOrientation.optional(),
|
|
1830
1813
|
holeDiameter: distance19.optional(),
|
|
1831
1814
|
platedDiameter: distance19.optional(),
|
|
1832
|
-
pinLabels:
|
|
1833
|
-
connections:
|
|
1834
|
-
facingDirection:
|
|
1815
|
+
pinLabels: z68.record(z68.string(), schematicPinLabel).or(z68.array(schematicPinLabel)).optional(),
|
|
1816
|
+
connections: z68.custom().pipe(z68.record(z68.string(), connectionTarget)).optional(),
|
|
1817
|
+
facingDirection: z68.enum(["left", "right"]).optional(),
|
|
1835
1818
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1836
1819
|
schPinStyle: schematicPinStyle.optional(),
|
|
1837
1820
|
schPinSpacing: distance19.optional(),
|
|
@@ -1841,29 +1824,29 @@ var pinHeaderProps = commonComponentProps.extend({
|
|
|
1841
1824
|
expectTypesMatch(true);
|
|
1842
1825
|
|
|
1843
1826
|
// lib/components/netalias.ts
|
|
1844
|
-
import { z as
|
|
1827
|
+
import { z as z69 } from "zod";
|
|
1845
1828
|
import { rotation as rotation3 } from "circuit-json";
|
|
1846
|
-
var netAliasProps =
|
|
1847
|
-
net:
|
|
1848
|
-
connection:
|
|
1829
|
+
var netAliasProps = z69.object({
|
|
1830
|
+
net: z69.string().optional(),
|
|
1831
|
+
connection: z69.string().optional(),
|
|
1849
1832
|
schX: distance.optional(),
|
|
1850
1833
|
schY: distance.optional(),
|
|
1851
1834
|
schRotation: rotation3.optional(),
|
|
1852
|
-
anchorSide:
|
|
1835
|
+
anchorSide: z69.enum(["left", "top", "right", "bottom"]).optional()
|
|
1853
1836
|
});
|
|
1854
1837
|
expectTypesMatch(true);
|
|
1855
1838
|
|
|
1856
1839
|
// lib/components/netlabel.ts
|
|
1857
|
-
import { z as
|
|
1840
|
+
import { z as z70 } from "zod";
|
|
1858
1841
|
import { rotation as rotation4 } from "circuit-json";
|
|
1859
|
-
var netLabelProps =
|
|
1860
|
-
net:
|
|
1861
|
-
connection:
|
|
1862
|
-
connectsTo:
|
|
1842
|
+
var netLabelProps = z70.object({
|
|
1843
|
+
net: z70.string().optional(),
|
|
1844
|
+
connection: z70.string().optional(),
|
|
1845
|
+
connectsTo: z70.string().or(z70.array(z70.string())).optional(),
|
|
1863
1846
|
schX: distance.optional(),
|
|
1864
1847
|
schY: distance.optional(),
|
|
1865
1848
|
schRotation: rotation4.optional(),
|
|
1866
|
-
anchorSide:
|
|
1849
|
+
anchorSide: z70.enum(["left", "top", "right", "bottom"]).optional()
|
|
1867
1850
|
});
|
|
1868
1851
|
expectTypesMatch(true);
|
|
1869
1852
|
|
|
@@ -1878,12 +1861,12 @@ expectTypesMatch(true);
|
|
|
1878
1861
|
|
|
1879
1862
|
// lib/components/analogsimulation.ts
|
|
1880
1863
|
import { ms } from "circuit-json";
|
|
1881
|
-
import { z as
|
|
1882
|
-
var spiceEngine =
|
|
1864
|
+
import { z as z72 } from "zod";
|
|
1865
|
+
var spiceEngine = z72.custom(
|
|
1883
1866
|
(value) => typeof value === "string"
|
|
1884
1867
|
);
|
|
1885
|
-
var analogSimulationProps =
|
|
1886
|
-
simulationType:
|
|
1868
|
+
var analogSimulationProps = z72.object({
|
|
1869
|
+
simulationType: z72.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1887
1870
|
duration: ms.optional(),
|
|
1888
1871
|
timePerStep: ms.optional(),
|
|
1889
1872
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1893,7 +1876,7 @@ expectTypesMatch(
|
|
|
1893
1876
|
);
|
|
1894
1877
|
|
|
1895
1878
|
// lib/components/transistor.ts
|
|
1896
|
-
import { z as
|
|
1879
|
+
import { z as z73 } from "zod";
|
|
1897
1880
|
var transistorPinsLabels = [
|
|
1898
1881
|
"pin1",
|
|
1899
1882
|
"pin2",
|
|
@@ -1906,7 +1889,7 @@ var transistorPinsLabels = [
|
|
|
1906
1889
|
"drain"
|
|
1907
1890
|
];
|
|
1908
1891
|
var transistorProps = commonComponentProps.extend({
|
|
1909
|
-
type:
|
|
1892
|
+
type: z73.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1910
1893
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1911
1894
|
});
|
|
1912
1895
|
var transistorPins = [
|
|
@@ -1920,10 +1903,10 @@ var transistorPins = [
|
|
|
1920
1903
|
expectTypesMatch(true);
|
|
1921
1904
|
|
|
1922
1905
|
// lib/components/mosfet.ts
|
|
1923
|
-
import { z as
|
|
1906
|
+
import { z as z74 } from "zod";
|
|
1924
1907
|
var mosfetProps = commonComponentProps.extend({
|
|
1925
|
-
channelType:
|
|
1926
|
-
mosfetMode:
|
|
1908
|
+
channelType: z74.enum(["n", "p"]),
|
|
1909
|
+
mosfetMode: z74.enum(["enhancement", "depletion"])
|
|
1927
1910
|
});
|
|
1928
1911
|
var mosfetPins = [
|
|
1929
1912
|
"pin1",
|
|
@@ -1952,19 +1935,19 @@ expectTypesMatch(true);
|
|
|
1952
1935
|
|
|
1953
1936
|
// lib/components/inductor.ts
|
|
1954
1937
|
import { inductance } from "circuit-json";
|
|
1955
|
-
import { z as
|
|
1938
|
+
import { z as z76 } from "zod";
|
|
1956
1939
|
var inductorPins = lrPins;
|
|
1957
1940
|
var inductorProps = commonComponentProps.extend({
|
|
1958
1941
|
inductance,
|
|
1959
|
-
maxCurrentRating:
|
|
1942
|
+
maxCurrentRating: z76.union([z76.string(), z76.number()]).optional(),
|
|
1960
1943
|
schOrientation: schematicOrientation.optional(),
|
|
1961
1944
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1962
1945
|
});
|
|
1963
1946
|
expectTypesMatch(true);
|
|
1964
1947
|
|
|
1965
1948
|
// lib/components/diode.ts
|
|
1966
|
-
import { z as
|
|
1967
|
-
var diodeConnectionKeys =
|
|
1949
|
+
import { z as z77 } from "zod";
|
|
1950
|
+
var diodeConnectionKeys = z77.enum([
|
|
1968
1951
|
"anode",
|
|
1969
1952
|
"cathode",
|
|
1970
1953
|
"pin1",
|
|
@@ -1972,9 +1955,9 @@ var diodeConnectionKeys = z76.enum([
|
|
|
1972
1955
|
"pos",
|
|
1973
1956
|
"neg"
|
|
1974
1957
|
]);
|
|
1975
|
-
var connectionTarget3 =
|
|
1976
|
-
var connectionsProp2 =
|
|
1977
|
-
var diodeVariant =
|
|
1958
|
+
var connectionTarget3 = z77.string().or(z77.array(z77.string()).readonly()).or(z77.array(z77.string()));
|
|
1959
|
+
var connectionsProp2 = z77.record(diodeConnectionKeys, connectionTarget3);
|
|
1960
|
+
var diodeVariant = z77.enum([
|
|
1978
1961
|
"standard",
|
|
1979
1962
|
"schottky",
|
|
1980
1963
|
"zener",
|
|
@@ -1985,12 +1968,12 @@ var diodeVariant = z76.enum([
|
|
|
1985
1968
|
var diodeProps = commonComponentProps.extend({
|
|
1986
1969
|
connections: connectionsProp2.optional(),
|
|
1987
1970
|
variant: diodeVariant.optional().default("standard"),
|
|
1988
|
-
standard:
|
|
1989
|
-
schottky:
|
|
1990
|
-
zener:
|
|
1991
|
-
avalanche:
|
|
1992
|
-
photo:
|
|
1993
|
-
tvs:
|
|
1971
|
+
standard: z77.boolean().optional(),
|
|
1972
|
+
schottky: z77.boolean().optional(),
|
|
1973
|
+
zener: z77.boolean().optional(),
|
|
1974
|
+
avalanche: z77.boolean().optional(),
|
|
1975
|
+
photo: z77.boolean().optional(),
|
|
1976
|
+
tvs: z77.boolean().optional(),
|
|
1994
1977
|
schOrientation: schematicOrientation.optional()
|
|
1995
1978
|
}).superRefine((data, ctx) => {
|
|
1996
1979
|
const enabledFlags = [
|
|
@@ -2003,11 +1986,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
2003
1986
|
].filter(Boolean).length;
|
|
2004
1987
|
if (enabledFlags > 1) {
|
|
2005
1988
|
ctx.addIssue({
|
|
2006
|
-
code:
|
|
1989
|
+
code: z77.ZodIssueCode.custom,
|
|
2007
1990
|
message: "Exactly one diode variant must be enabled",
|
|
2008
1991
|
path: []
|
|
2009
1992
|
});
|
|
2010
|
-
return
|
|
1993
|
+
return z77.INVALID;
|
|
2011
1994
|
}
|
|
2012
1995
|
}).transform((data) => {
|
|
2013
1996
|
const result = {
|
|
@@ -2054,33 +2037,33 @@ var diodePins = lrPolarPins;
|
|
|
2054
2037
|
expectTypesMatch(true);
|
|
2055
2038
|
|
|
2056
2039
|
// lib/components/led.ts
|
|
2057
|
-
import { z as
|
|
2040
|
+
import { z as z78 } from "zod";
|
|
2058
2041
|
var ledProps = commonComponentProps.extend({
|
|
2059
|
-
color:
|
|
2060
|
-
wavelength:
|
|
2061
|
-
schDisplayValue:
|
|
2042
|
+
color: z78.string().optional(),
|
|
2043
|
+
wavelength: z78.string().optional(),
|
|
2044
|
+
schDisplayValue: z78.string().optional(),
|
|
2062
2045
|
schOrientation: schematicOrientation.optional(),
|
|
2063
2046
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
2064
|
-
laser:
|
|
2047
|
+
laser: z78.boolean().optional()
|
|
2065
2048
|
});
|
|
2066
2049
|
var ledPins = lrPolarPins;
|
|
2067
2050
|
|
|
2068
2051
|
// lib/components/switch.ts
|
|
2069
2052
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
2070
|
-
import { z as
|
|
2053
|
+
import { z as z79 } from "zod";
|
|
2071
2054
|
var switchProps = commonComponentProps.extend({
|
|
2072
|
-
type:
|
|
2073
|
-
isNormallyClosed:
|
|
2074
|
-
spst:
|
|
2075
|
-
spdt:
|
|
2076
|
-
dpst:
|
|
2077
|
-
dpdt:
|
|
2055
|
+
type: z79.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
2056
|
+
isNormallyClosed: z79.boolean().optional().default(false),
|
|
2057
|
+
spst: z79.boolean().optional(),
|
|
2058
|
+
spdt: z79.boolean().optional(),
|
|
2059
|
+
dpst: z79.boolean().optional(),
|
|
2060
|
+
dpdt: z79.boolean().optional(),
|
|
2078
2061
|
simSwitchFrequency: frequency3.optional(),
|
|
2079
2062
|
simCloseAt: ms2.optional(),
|
|
2080
2063
|
simOpenAt: ms2.optional(),
|
|
2081
|
-
simStartClosed:
|
|
2082
|
-
simStartOpen:
|
|
2083
|
-
connections:
|
|
2064
|
+
simStartClosed: z79.boolean().optional(),
|
|
2065
|
+
simStartOpen: z79.boolean().optional(),
|
|
2066
|
+
connections: z79.custom().pipe(z79.record(z79.string(), connectionTarget)).optional()
|
|
2084
2067
|
}).transform((props) => {
|
|
2085
2068
|
const updatedProps = { ...props };
|
|
2086
2069
|
if (updatedProps.dpdt) {
|
|
@@ -2112,33 +2095,33 @@ expectTypesMatch(true);
|
|
|
2112
2095
|
|
|
2113
2096
|
// lib/components/fabrication-note-text.ts
|
|
2114
2097
|
import { length as length4 } from "circuit-json";
|
|
2115
|
-
import { z as
|
|
2098
|
+
import { z as z80 } from "zod";
|
|
2116
2099
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
2117
|
-
text:
|
|
2118
|
-
anchorAlignment:
|
|
2119
|
-
font:
|
|
2100
|
+
text: z80.string(),
|
|
2101
|
+
anchorAlignment: z80.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2102
|
+
font: z80.enum(["tscircuit2024"]).optional(),
|
|
2120
2103
|
fontSize: length4.optional(),
|
|
2121
|
-
color:
|
|
2104
|
+
color: z80.string().optional()
|
|
2122
2105
|
});
|
|
2123
2106
|
expectTypesMatch(true);
|
|
2124
2107
|
|
|
2125
2108
|
// lib/components/fabrication-note-rect.ts
|
|
2126
2109
|
import { distance as distance20 } from "circuit-json";
|
|
2127
|
-
import { z as
|
|
2110
|
+
import { z as z81 } from "zod";
|
|
2128
2111
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2129
2112
|
width: distance20,
|
|
2130
2113
|
height: distance20,
|
|
2131
2114
|
strokeWidth: distance20.optional(),
|
|
2132
|
-
isFilled:
|
|
2133
|
-
hasStroke:
|
|
2134
|
-
isStrokeDashed:
|
|
2135
|
-
color:
|
|
2115
|
+
isFilled: z81.boolean().optional(),
|
|
2116
|
+
hasStroke: z81.boolean().optional(),
|
|
2117
|
+
isStrokeDashed: z81.boolean().optional(),
|
|
2118
|
+
color: z81.string().optional(),
|
|
2136
2119
|
cornerRadius: distance20.optional()
|
|
2137
2120
|
});
|
|
2138
2121
|
|
|
2139
2122
|
// lib/components/fabrication-note-path.ts
|
|
2140
2123
|
import { length as length5, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
2141
|
-
import { z as
|
|
2124
|
+
import { z as z82 } from "zod";
|
|
2142
2125
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
2143
2126
|
pcbLeftEdgeX: true,
|
|
2144
2127
|
pcbRightEdgeX: true,
|
|
@@ -2150,15 +2133,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
2150
2133
|
pcbOffsetY: true,
|
|
2151
2134
|
pcbRotation: true
|
|
2152
2135
|
}).extend({
|
|
2153
|
-
route:
|
|
2136
|
+
route: z82.array(route_hint_point3),
|
|
2154
2137
|
strokeWidth: length5.optional(),
|
|
2155
|
-
color:
|
|
2138
|
+
color: z82.string().optional()
|
|
2156
2139
|
});
|
|
2157
2140
|
|
|
2158
2141
|
// lib/components/fabrication-note-dimension.ts
|
|
2159
2142
|
import { distance as distance21, length as length6 } from "circuit-json";
|
|
2160
|
-
import { z as
|
|
2161
|
-
var dimensionTarget =
|
|
2143
|
+
import { z as z83 } from "zod";
|
|
2144
|
+
var dimensionTarget = z83.union([z83.string(), point]);
|
|
2162
2145
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
2163
2146
|
pcbLeftEdgeX: true,
|
|
2164
2147
|
pcbRightEdgeX: true,
|
|
@@ -2172,53 +2155,53 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2172
2155
|
}).extend({
|
|
2173
2156
|
from: dimensionTarget,
|
|
2174
2157
|
to: dimensionTarget,
|
|
2175
|
-
text:
|
|
2158
|
+
text: z83.string().optional(),
|
|
2176
2159
|
offset: distance21.optional(),
|
|
2177
|
-
font:
|
|
2160
|
+
font: z83.enum(["tscircuit2024"]).optional(),
|
|
2178
2161
|
fontSize: length6.optional(),
|
|
2179
|
-
color:
|
|
2162
|
+
color: z83.string().optional(),
|
|
2180
2163
|
arrowSize: distance21.optional(),
|
|
2181
|
-
units:
|
|
2182
|
-
outerEdgeToEdge:
|
|
2183
|
-
centerToCenter:
|
|
2184
|
-
innerEdgeToEdge:
|
|
2164
|
+
units: z83.enum(["in", "mm"]).optional(),
|
|
2165
|
+
outerEdgeToEdge: z83.literal(true).optional(),
|
|
2166
|
+
centerToCenter: z83.literal(true).optional(),
|
|
2167
|
+
innerEdgeToEdge: z83.literal(true).optional()
|
|
2185
2168
|
});
|
|
2186
2169
|
expectTypesMatch(true);
|
|
2187
2170
|
|
|
2188
2171
|
// lib/components/pcb-trace.ts
|
|
2189
2172
|
import { distance as distance22, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
2190
|
-
import { z as
|
|
2191
|
-
var pcbTraceProps =
|
|
2192
|
-
layer:
|
|
2173
|
+
import { z as z84 } from "zod";
|
|
2174
|
+
var pcbTraceProps = z84.object({
|
|
2175
|
+
layer: z84.string().optional(),
|
|
2193
2176
|
thickness: distance22.optional(),
|
|
2194
|
-
route:
|
|
2177
|
+
route: z84.array(route_hint_point4)
|
|
2195
2178
|
});
|
|
2196
2179
|
|
|
2197
2180
|
// lib/components/via.ts
|
|
2198
2181
|
import { distance as distance23, layer_ref as layer_ref6 } from "circuit-json";
|
|
2199
|
-
import { z as
|
|
2182
|
+
import { z as z85 } from "zod";
|
|
2200
2183
|
var viaProps = commonLayoutProps.extend({
|
|
2201
|
-
name:
|
|
2184
|
+
name: z85.string().optional(),
|
|
2202
2185
|
fromLayer: layer_ref6,
|
|
2203
2186
|
toLayer: layer_ref6,
|
|
2204
2187
|
holeDiameter: distance23.optional(),
|
|
2205
2188
|
outerDiameter: distance23.optional(),
|
|
2206
|
-
connectsTo:
|
|
2207
|
-
netIsAssignable:
|
|
2189
|
+
connectsTo: z85.string().or(z85.array(z85.string())).optional(),
|
|
2190
|
+
netIsAssignable: z85.boolean().optional()
|
|
2208
2191
|
});
|
|
2209
2192
|
expectTypesMatch(true);
|
|
2210
2193
|
|
|
2211
2194
|
// lib/components/testpoint.ts
|
|
2212
2195
|
import { distance as distance24 } from "circuit-json";
|
|
2213
|
-
import { z as
|
|
2196
|
+
import { z as z86 } from "zod";
|
|
2214
2197
|
var testpointPins = ["pin1"];
|
|
2215
|
-
var testpointConnectionsProp =
|
|
2198
|
+
var testpointConnectionsProp = z86.object({
|
|
2216
2199
|
pin1: connectionTarget
|
|
2217
2200
|
}).strict();
|
|
2218
2201
|
var testpointProps = commonComponentProps.extend({
|
|
2219
2202
|
connections: testpointConnectionsProp.optional(),
|
|
2220
|
-
footprintVariant:
|
|
2221
|
-
padShape:
|
|
2203
|
+
footprintVariant: z86.enum(["pad", "through_hole"]).optional(),
|
|
2204
|
+
padShape: z86.enum(["rect", "circle"]).optional().default("circle"),
|
|
2222
2205
|
padDiameter: distance24.optional(),
|
|
2223
2206
|
holeDiameter: distance24.optional(),
|
|
2224
2207
|
width: distance24.optional(),
|
|
@@ -2230,22 +2213,22 @@ var testpointProps = commonComponentProps.extend({
|
|
|
2230
2213
|
expectTypesMatch(true);
|
|
2231
2214
|
|
|
2232
2215
|
// lib/components/breakoutpoint.ts
|
|
2233
|
-
import { z as
|
|
2216
|
+
import { z as z87 } from "zod";
|
|
2234
2217
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
2235
|
-
connection:
|
|
2218
|
+
connection: z87.string()
|
|
2236
2219
|
});
|
|
2237
2220
|
expectTypesMatch(true);
|
|
2238
2221
|
|
|
2239
2222
|
// lib/components/pcb-keepout.ts
|
|
2240
2223
|
import { distance as distance25 } from "circuit-json";
|
|
2241
|
-
import { z as
|
|
2242
|
-
var pcbKeepoutProps =
|
|
2224
|
+
import { z as z88 } from "zod";
|
|
2225
|
+
var pcbKeepoutProps = z88.union([
|
|
2243
2226
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2244
|
-
shape:
|
|
2227
|
+
shape: z88.literal("circle"),
|
|
2245
2228
|
radius: distance25
|
|
2246
2229
|
}),
|
|
2247
2230
|
pcbLayoutProps.extend({
|
|
2248
|
-
shape:
|
|
2231
|
+
shape: z88.literal("rect"),
|
|
2249
2232
|
width: distance25,
|
|
2250
2233
|
height: distance25
|
|
2251
2234
|
})
|
|
@@ -2253,20 +2236,20 @@ var pcbKeepoutProps = z87.union([
|
|
|
2253
2236
|
|
|
2254
2237
|
// lib/components/courtyard-rect.ts
|
|
2255
2238
|
import { distance as distance26 } from "circuit-json";
|
|
2256
|
-
import { z as
|
|
2239
|
+
import { z as z89 } from "zod";
|
|
2257
2240
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2258
2241
|
width: distance26,
|
|
2259
2242
|
height: distance26,
|
|
2260
2243
|
strokeWidth: distance26.optional(),
|
|
2261
|
-
isFilled:
|
|
2262
|
-
hasStroke:
|
|
2263
|
-
isStrokeDashed:
|
|
2264
|
-
color:
|
|
2244
|
+
isFilled: z89.boolean().optional(),
|
|
2245
|
+
hasStroke: z89.boolean().optional(),
|
|
2246
|
+
isStrokeDashed: z89.boolean().optional(),
|
|
2247
|
+
color: z89.string().optional()
|
|
2265
2248
|
});
|
|
2266
2249
|
|
|
2267
2250
|
// lib/components/courtyard-outline.ts
|
|
2268
2251
|
import { length as length7 } from "circuit-json";
|
|
2269
|
-
import { z as
|
|
2252
|
+
import { z as z90 } from "zod";
|
|
2270
2253
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
2271
2254
|
pcbLeftEdgeX: true,
|
|
2272
2255
|
pcbRightEdgeX: true,
|
|
@@ -2278,11 +2261,11 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
2278
2261
|
pcbOffsetY: true,
|
|
2279
2262
|
pcbRotation: true
|
|
2280
2263
|
}).extend({
|
|
2281
|
-
outline:
|
|
2264
|
+
outline: z90.array(point),
|
|
2282
2265
|
strokeWidth: length7.optional(),
|
|
2283
|
-
isClosed:
|
|
2284
|
-
isStrokeDashed:
|
|
2285
|
-
color:
|
|
2266
|
+
isClosed: z90.boolean().optional(),
|
|
2267
|
+
isStrokeDashed: z90.boolean().optional(),
|
|
2268
|
+
color: z90.string().optional()
|
|
2286
2269
|
});
|
|
2287
2270
|
|
|
2288
2271
|
// lib/components/courtyard-circle.ts
|
|
@@ -2302,34 +2285,34 @@ var courtyardPillProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2302
2285
|
});
|
|
2303
2286
|
|
|
2304
2287
|
// lib/components/copper-pour.ts
|
|
2305
|
-
import { z as
|
|
2288
|
+
import { z as z93 } from "zod";
|
|
2306
2289
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
2307
|
-
var copperPourProps =
|
|
2308
|
-
name:
|
|
2290
|
+
var copperPourProps = z93.object({
|
|
2291
|
+
name: z93.string().optional(),
|
|
2309
2292
|
layer: layer_ref7,
|
|
2310
|
-
connectsTo:
|
|
2293
|
+
connectsTo: z93.string(),
|
|
2311
2294
|
padMargin: distance.optional(),
|
|
2312
2295
|
traceMargin: distance.optional(),
|
|
2313
2296
|
clearance: distance.optional(),
|
|
2314
2297
|
boardEdgeMargin: distance.optional(),
|
|
2315
2298
|
cutoutMargin: distance.optional(),
|
|
2316
|
-
outline:
|
|
2317
|
-
coveredWithSolderMask:
|
|
2299
|
+
outline: z93.array(point).optional(),
|
|
2300
|
+
coveredWithSolderMask: z93.boolean().optional().default(true)
|
|
2318
2301
|
});
|
|
2319
2302
|
expectTypesMatch(true);
|
|
2320
2303
|
|
|
2321
2304
|
// lib/components/cadassembly.ts
|
|
2322
2305
|
import { layer_ref as layer_ref8 } from "circuit-json";
|
|
2323
|
-
import { z as
|
|
2324
|
-
var cadassemblyProps =
|
|
2306
|
+
import { z as z94 } from "zod";
|
|
2307
|
+
var cadassemblyProps = z94.object({
|
|
2325
2308
|
originalLayer: layer_ref8.default("top").optional(),
|
|
2326
|
-
children:
|
|
2309
|
+
children: z94.any().optional()
|
|
2327
2310
|
});
|
|
2328
2311
|
expectTypesMatch(true);
|
|
2329
2312
|
|
|
2330
2313
|
// lib/components/cadmodel.ts
|
|
2331
|
-
import { z as
|
|
2332
|
-
var pcbPosition =
|
|
2314
|
+
import { z as z95 } from "zod";
|
|
2315
|
+
var pcbPosition = z95.object({
|
|
2333
2316
|
pcbX: pcbCoordinate.optional(),
|
|
2334
2317
|
pcbY: pcbCoordinate.optional(),
|
|
2335
2318
|
pcbLeftEdgeX: pcbCoordinate.optional(),
|
|
@@ -2346,7 +2329,7 @@ var cadModelBaseWithUrl = cadModelBase.extend({
|
|
|
2346
2329
|
});
|
|
2347
2330
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
2348
2331
|
expectTypesMatch(true);
|
|
2349
|
-
var cadmodelProps =
|
|
2332
|
+
var cadmodelProps = z95.union([z95.null(), url, cadModelObject]);
|
|
2350
2333
|
|
|
2351
2334
|
// lib/components/power-source.ts
|
|
2352
2335
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -2356,9 +2339,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
2356
2339
|
|
|
2357
2340
|
// lib/components/voltagesource.ts
|
|
2358
2341
|
import { frequency as frequency4, rotation as rotation5, voltage as voltage4 } from "circuit-json";
|
|
2359
|
-
import { z as
|
|
2342
|
+
import { z as z96 } from "zod";
|
|
2360
2343
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2361
|
-
var percentage =
|
|
2344
|
+
var percentage = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
2362
2345
|
if (typeof val === "string") {
|
|
2363
2346
|
if (val.endsWith("%")) {
|
|
2364
2347
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2367,13 +2350,13 @@ var percentage = z95.union([z95.string(), z95.number()]).transform((val) => {
|
|
|
2367
2350
|
}
|
|
2368
2351
|
return val;
|
|
2369
2352
|
}).pipe(
|
|
2370
|
-
|
|
2353
|
+
z96.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2371
2354
|
);
|
|
2372
2355
|
var voltageSourceProps = commonComponentProps.extend({
|
|
2373
2356
|
voltage: voltage4.optional(),
|
|
2374
2357
|
frequency: frequency4.optional(),
|
|
2375
2358
|
peakToPeakVoltage: voltage4.optional(),
|
|
2376
|
-
waveShape:
|
|
2359
|
+
waveShape: z96.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2377
2360
|
phase: rotation5.optional(),
|
|
2378
2361
|
dutyCycle: percentage.optional(),
|
|
2379
2362
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -2383,9 +2366,9 @@ expectTypesMatch(true);
|
|
|
2383
2366
|
|
|
2384
2367
|
// lib/components/currentsource.ts
|
|
2385
2368
|
import { frequency as frequency5, rotation as rotation6, current } from "circuit-json";
|
|
2386
|
-
import { z as
|
|
2369
|
+
import { z as z97 } from "zod";
|
|
2387
2370
|
var currentSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
2388
|
-
var percentage2 =
|
|
2371
|
+
var percentage2 = z97.union([z97.string(), z97.number()]).transform((val) => {
|
|
2389
2372
|
if (typeof val === "string") {
|
|
2390
2373
|
if (val.endsWith("%")) {
|
|
2391
2374
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -2394,13 +2377,13 @@ var percentage2 = z96.union([z96.string(), z96.number()]).transform((val) => {
|
|
|
2394
2377
|
}
|
|
2395
2378
|
return val;
|
|
2396
2379
|
}).pipe(
|
|
2397
|
-
|
|
2380
|
+
z97.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
2398
2381
|
);
|
|
2399
2382
|
var currentSourceProps = commonComponentProps.extend({
|
|
2400
2383
|
current: current.optional(),
|
|
2401
2384
|
frequency: frequency5.optional(),
|
|
2402
2385
|
peakToPeakCurrent: current.optional(),
|
|
2403
|
-
waveShape:
|
|
2386
|
+
waveShape: z97.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
2404
2387
|
phase: rotation6.optional(),
|
|
2405
2388
|
dutyCycle: percentage2.optional(),
|
|
2406
2389
|
connections: createConnectionsProp(currentSourcePinLabels).optional()
|
|
@@ -2409,57 +2392,57 @@ var currentSourcePins = lrPolarPins;
|
|
|
2409
2392
|
expectTypesMatch(true);
|
|
2410
2393
|
|
|
2411
2394
|
// lib/components/voltageprobe.ts
|
|
2412
|
-
import { z as
|
|
2395
|
+
import { z as z98 } from "zod";
|
|
2413
2396
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
2414
|
-
name:
|
|
2415
|
-
connectsTo:
|
|
2416
|
-
referenceTo:
|
|
2417
|
-
color:
|
|
2397
|
+
name: z98.string().optional(),
|
|
2398
|
+
connectsTo: z98.string(),
|
|
2399
|
+
referenceTo: z98.string().optional(),
|
|
2400
|
+
color: z98.string().optional()
|
|
2418
2401
|
});
|
|
2419
2402
|
expectTypesMatch(true);
|
|
2420
2403
|
|
|
2421
2404
|
// lib/components/schematic-arc.ts
|
|
2422
2405
|
import { distance as distance29, point as point5, rotation as rotation7 } from "circuit-json";
|
|
2423
|
-
import { z as
|
|
2424
|
-
var schematicArcProps =
|
|
2406
|
+
import { z as z99 } from "zod";
|
|
2407
|
+
var schematicArcProps = z99.object({
|
|
2425
2408
|
center: point5,
|
|
2426
2409
|
radius: distance29,
|
|
2427
2410
|
startAngleDegrees: rotation7,
|
|
2428
2411
|
endAngleDegrees: rotation7,
|
|
2429
|
-
direction:
|
|
2412
|
+
direction: z99.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
2430
2413
|
strokeWidth: distance29.optional(),
|
|
2431
|
-
color:
|
|
2432
|
-
isDashed:
|
|
2414
|
+
color: z99.string().optional(),
|
|
2415
|
+
isDashed: z99.boolean().optional().default(false)
|
|
2433
2416
|
});
|
|
2434
2417
|
expectTypesMatch(true);
|
|
2435
2418
|
|
|
2436
2419
|
// lib/components/toolingrail.ts
|
|
2437
|
-
import { z as
|
|
2438
|
-
var toolingrailProps =
|
|
2439
|
-
children:
|
|
2420
|
+
import { z as z100 } from "zod";
|
|
2421
|
+
var toolingrailProps = z100.object({
|
|
2422
|
+
children: z100.any().optional()
|
|
2440
2423
|
});
|
|
2441
2424
|
expectTypesMatch(true);
|
|
2442
2425
|
|
|
2443
2426
|
// lib/components/schematic-box.ts
|
|
2444
2427
|
import { distance as distance30 } from "circuit-json";
|
|
2445
|
-
import { z as
|
|
2446
|
-
var schematicBoxProps =
|
|
2428
|
+
import { z as z101 } from "zod";
|
|
2429
|
+
var schematicBoxProps = z101.object({
|
|
2447
2430
|
schX: distance30.optional(),
|
|
2448
2431
|
schY: distance30.optional(),
|
|
2449
2432
|
width: distance30.optional(),
|
|
2450
2433
|
height: distance30.optional(),
|
|
2451
|
-
overlay:
|
|
2434
|
+
overlay: z101.array(z101.string()).optional(),
|
|
2452
2435
|
padding: distance30.optional(),
|
|
2453
2436
|
paddingLeft: distance30.optional(),
|
|
2454
2437
|
paddingRight: distance30.optional(),
|
|
2455
2438
|
paddingTop: distance30.optional(),
|
|
2456
2439
|
paddingBottom: distance30.optional(),
|
|
2457
|
-
title:
|
|
2440
|
+
title: z101.string().optional(),
|
|
2458
2441
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
2459
|
-
titleColor:
|
|
2442
|
+
titleColor: z101.string().optional(),
|
|
2460
2443
|
titleFontSize: distance30.optional(),
|
|
2461
|
-
titleInside:
|
|
2462
|
-
strokeStyle:
|
|
2444
|
+
titleInside: z101.boolean().default(false),
|
|
2445
|
+
strokeStyle: z101.enum(["solid", "dashed"]).default("solid")
|
|
2463
2446
|
}).refine(
|
|
2464
2447
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
2465
2448
|
{
|
|
@@ -2475,15 +2458,15 @@ expectTypesMatch(true);
|
|
|
2475
2458
|
|
|
2476
2459
|
// lib/components/schematic-circle.ts
|
|
2477
2460
|
import { distance as distance31, point as point6 } from "circuit-json";
|
|
2478
|
-
import { z as
|
|
2479
|
-
var schematicCircleProps =
|
|
2461
|
+
import { z as z102 } from "zod";
|
|
2462
|
+
var schematicCircleProps = z102.object({
|
|
2480
2463
|
center: point6,
|
|
2481
2464
|
radius: distance31,
|
|
2482
2465
|
strokeWidth: distance31.optional(),
|
|
2483
|
-
color:
|
|
2484
|
-
isFilled:
|
|
2485
|
-
fillColor:
|
|
2486
|
-
isDashed:
|
|
2466
|
+
color: z102.string().optional(),
|
|
2467
|
+
isFilled: z102.boolean().optional().default(false),
|
|
2468
|
+
fillColor: z102.string().optional(),
|
|
2469
|
+
isDashed: z102.boolean().optional().default(false)
|
|
2487
2470
|
});
|
|
2488
2471
|
expectTypesMatch(
|
|
2489
2472
|
true
|
|
@@ -2491,43 +2474,43 @@ expectTypesMatch(
|
|
|
2491
2474
|
|
|
2492
2475
|
// lib/components/schematic-rect.ts
|
|
2493
2476
|
import { distance as distance32, rotation as rotation8 } from "circuit-json";
|
|
2494
|
-
import { z as
|
|
2495
|
-
var schematicRectProps =
|
|
2477
|
+
import { z as z103 } from "zod";
|
|
2478
|
+
var schematicRectProps = z103.object({
|
|
2496
2479
|
schX: distance32.optional(),
|
|
2497
2480
|
schY: distance32.optional(),
|
|
2498
2481
|
width: distance32,
|
|
2499
2482
|
height: distance32,
|
|
2500
2483
|
rotation: rotation8.default(0),
|
|
2501
2484
|
strokeWidth: distance32.optional(),
|
|
2502
|
-
color:
|
|
2503
|
-
isFilled:
|
|
2504
|
-
fillColor:
|
|
2505
|
-
isDashed:
|
|
2485
|
+
color: z103.string().optional(),
|
|
2486
|
+
isFilled: z103.boolean().optional().default(false),
|
|
2487
|
+
fillColor: z103.string().optional(),
|
|
2488
|
+
isDashed: z103.boolean().optional().default(false),
|
|
2506
2489
|
cornerRadius: distance32.optional()
|
|
2507
2490
|
});
|
|
2508
2491
|
expectTypesMatch(true);
|
|
2509
2492
|
|
|
2510
2493
|
// lib/components/schematic-line.ts
|
|
2511
2494
|
import { distance as distance33 } from "circuit-json";
|
|
2512
|
-
import { z as
|
|
2513
|
-
var schematicLineProps =
|
|
2495
|
+
import { z as z104 } from "zod";
|
|
2496
|
+
var schematicLineProps = z104.object({
|
|
2514
2497
|
x1: distance33,
|
|
2515
2498
|
y1: distance33,
|
|
2516
2499
|
x2: distance33,
|
|
2517
2500
|
y2: distance33,
|
|
2518
2501
|
strokeWidth: distance33.optional(),
|
|
2519
|
-
color:
|
|
2520
|
-
isDashed:
|
|
2502
|
+
color: z104.string().optional(),
|
|
2503
|
+
isDashed: z104.boolean().optional().default(false)
|
|
2521
2504
|
});
|
|
2522
2505
|
expectTypesMatch(true);
|
|
2523
2506
|
|
|
2524
2507
|
// lib/components/schematic-text.ts
|
|
2525
2508
|
import { distance as distance34, rotation as rotation9 } from "circuit-json";
|
|
2526
|
-
import { z as
|
|
2509
|
+
import { z as z106 } from "zod";
|
|
2527
2510
|
|
|
2528
2511
|
// lib/common/fivePointAnchor.ts
|
|
2529
|
-
import { z as
|
|
2530
|
-
var fivePointAnchor =
|
|
2512
|
+
import { z as z105 } from "zod";
|
|
2513
|
+
var fivePointAnchor = z105.enum([
|
|
2531
2514
|
"center",
|
|
2532
2515
|
"left",
|
|
2533
2516
|
"right",
|
|
@@ -2536,37 +2519,37 @@ var fivePointAnchor = z104.enum([
|
|
|
2536
2519
|
]);
|
|
2537
2520
|
|
|
2538
2521
|
// lib/components/schematic-text.ts
|
|
2539
|
-
var schematicTextProps =
|
|
2522
|
+
var schematicTextProps = z106.object({
|
|
2540
2523
|
schX: distance34.optional(),
|
|
2541
2524
|
schY: distance34.optional(),
|
|
2542
|
-
text:
|
|
2543
|
-
fontSize:
|
|
2544
|
-
anchor:
|
|
2545
|
-
color:
|
|
2525
|
+
text: z106.string(),
|
|
2526
|
+
fontSize: z106.number().default(1),
|
|
2527
|
+
anchor: z106.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2528
|
+
color: z106.string().default("#000000"),
|
|
2546
2529
|
schRotation: rotation9.default(0)
|
|
2547
2530
|
});
|
|
2548
2531
|
expectTypesMatch(true);
|
|
2549
2532
|
|
|
2550
2533
|
// lib/components/schematic-path.ts
|
|
2551
2534
|
import { distance as distance35, point as point8 } from "circuit-json";
|
|
2552
|
-
import { z as
|
|
2553
|
-
var schematicPathProps =
|
|
2554
|
-
points:
|
|
2555
|
-
svgPath:
|
|
2535
|
+
import { z as z107 } from "zod";
|
|
2536
|
+
var schematicPathProps = z107.object({
|
|
2537
|
+
points: z107.array(point8).optional(),
|
|
2538
|
+
svgPath: z107.string().optional(),
|
|
2556
2539
|
strokeWidth: distance35.optional(),
|
|
2557
|
-
strokeColor:
|
|
2558
|
-
isFilled:
|
|
2559
|
-
fillColor:
|
|
2540
|
+
strokeColor: z107.string().optional(),
|
|
2541
|
+
isFilled: z107.boolean().optional().default(false),
|
|
2542
|
+
fillColor: z107.string().optional()
|
|
2560
2543
|
});
|
|
2561
2544
|
expectTypesMatch(true);
|
|
2562
2545
|
|
|
2563
2546
|
// lib/components/schematic-table.ts
|
|
2564
2547
|
import { distance as distance36 } from "circuit-json";
|
|
2565
|
-
import { z as
|
|
2566
|
-
var schematicTableProps =
|
|
2548
|
+
import { z as z108 } from "zod";
|
|
2549
|
+
var schematicTableProps = z108.object({
|
|
2567
2550
|
schX: distance36.optional(),
|
|
2568
2551
|
schY: distance36.optional(),
|
|
2569
|
-
children:
|
|
2552
|
+
children: z108.any().optional(),
|
|
2570
2553
|
cellPadding: distance36.optional(),
|
|
2571
2554
|
borderWidth: distance36.optional(),
|
|
2572
2555
|
anchor: ninePointAnchor.optional(),
|
|
@@ -2576,64 +2559,64 @@ expectTypesMatch(true);
|
|
|
2576
2559
|
|
|
2577
2560
|
// lib/components/schematic-row.ts
|
|
2578
2561
|
import { distance as distance37 } from "circuit-json";
|
|
2579
|
-
import { z as
|
|
2580
|
-
var schematicRowProps =
|
|
2581
|
-
children:
|
|
2562
|
+
import { z as z109 } from "zod";
|
|
2563
|
+
var schematicRowProps = z109.object({
|
|
2564
|
+
children: z109.any().optional(),
|
|
2582
2565
|
height: distance37.optional()
|
|
2583
2566
|
});
|
|
2584
2567
|
expectTypesMatch(true);
|
|
2585
2568
|
|
|
2586
2569
|
// lib/components/schematic-cell.ts
|
|
2587
2570
|
import { distance as distance38 } from "circuit-json";
|
|
2588
|
-
import { z as
|
|
2589
|
-
var schematicCellProps =
|
|
2590
|
-
children:
|
|
2591
|
-
horizontalAlign:
|
|
2592
|
-
verticalAlign:
|
|
2571
|
+
import { z as z110 } from "zod";
|
|
2572
|
+
var schematicCellProps = z110.object({
|
|
2573
|
+
children: z110.string().optional(),
|
|
2574
|
+
horizontalAlign: z110.enum(["left", "center", "right"]).optional(),
|
|
2575
|
+
verticalAlign: z110.enum(["top", "middle", "bottom"]).optional(),
|
|
2593
2576
|
fontSize: distance38.optional(),
|
|
2594
|
-
rowSpan:
|
|
2595
|
-
colSpan:
|
|
2577
|
+
rowSpan: z110.number().optional(),
|
|
2578
|
+
colSpan: z110.number().optional(),
|
|
2596
2579
|
width: distance38.optional(),
|
|
2597
|
-
text:
|
|
2580
|
+
text: z110.string().optional()
|
|
2598
2581
|
});
|
|
2599
2582
|
expectTypesMatch(true);
|
|
2600
2583
|
|
|
2601
2584
|
// lib/components/copper-text.ts
|
|
2602
2585
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2603
|
-
import { z as
|
|
2586
|
+
import { z as z111 } from "zod";
|
|
2604
2587
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2605
|
-
text:
|
|
2588
|
+
text: z111.string(),
|
|
2606
2589
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2607
|
-
font:
|
|
2590
|
+
font: z111.enum(["tscircuit2024"]).optional(),
|
|
2608
2591
|
fontSize: length8.optional(),
|
|
2609
|
-
layers:
|
|
2610
|
-
knockout:
|
|
2611
|
-
mirrored:
|
|
2592
|
+
layers: z111.array(layer_ref9).optional(),
|
|
2593
|
+
knockout: z111.boolean().optional(),
|
|
2594
|
+
mirrored: z111.boolean().optional()
|
|
2612
2595
|
});
|
|
2613
2596
|
|
|
2614
2597
|
// lib/components/silkscreen-text.ts
|
|
2615
2598
|
import { layer_ref as layer_ref10, length as length9 } from "circuit-json";
|
|
2616
|
-
import { z as
|
|
2599
|
+
import { z as z112 } from "zod";
|
|
2617
2600
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2618
|
-
text:
|
|
2601
|
+
text: z112.string(),
|
|
2619
2602
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2620
|
-
font:
|
|
2603
|
+
font: z112.enum(["tscircuit2024"]).optional(),
|
|
2621
2604
|
fontSize: length9.optional(),
|
|
2622
2605
|
/**
|
|
2623
2606
|
* If true, text will knock out underlying silkscreen
|
|
2624
2607
|
*/
|
|
2625
|
-
isKnockout:
|
|
2608
|
+
isKnockout: z112.boolean().optional(),
|
|
2626
2609
|
knockoutPadding: length9.optional(),
|
|
2627
2610
|
knockoutPaddingLeft: length9.optional(),
|
|
2628
2611
|
knockoutPaddingRight: length9.optional(),
|
|
2629
2612
|
knockoutPaddingTop: length9.optional(),
|
|
2630
2613
|
knockoutPaddingBottom: length9.optional(),
|
|
2631
|
-
layers:
|
|
2614
|
+
layers: z112.array(layer_ref10).optional()
|
|
2632
2615
|
});
|
|
2633
2616
|
|
|
2634
2617
|
// lib/components/silkscreen-path.ts
|
|
2635
2618
|
import { length as length10, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2636
|
-
import { z as
|
|
2619
|
+
import { z as z113 } from "zod";
|
|
2637
2620
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2638
2621
|
pcbLeftEdgeX: true,
|
|
2639
2622
|
pcbRightEdgeX: true,
|
|
@@ -2645,7 +2628,7 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2645
2628
|
pcbOffsetY: true,
|
|
2646
2629
|
pcbRotation: true
|
|
2647
2630
|
}).extend({
|
|
2648
|
-
route:
|
|
2631
|
+
route: z113.array(route_hint_point5),
|
|
2649
2632
|
strokeWidth: length10.optional()
|
|
2650
2633
|
});
|
|
2651
2634
|
|
|
@@ -2667,10 +2650,10 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2667
2650
|
|
|
2668
2651
|
// lib/components/silkscreen-rect.ts
|
|
2669
2652
|
import { distance as distance40 } from "circuit-json";
|
|
2670
|
-
import { z as
|
|
2653
|
+
import { z as z114 } from "zod";
|
|
2671
2654
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2672
|
-
filled:
|
|
2673
|
-
stroke:
|
|
2655
|
+
filled: z114.boolean().default(true).optional(),
|
|
2656
|
+
stroke: z114.enum(["dashed", "solid", "none"]).optional(),
|
|
2674
2657
|
strokeWidth: distance40.optional(),
|
|
2675
2658
|
width: distance40,
|
|
2676
2659
|
height: distance40,
|
|
@@ -2679,73 +2662,73 @@ var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
|
2679
2662
|
|
|
2680
2663
|
// lib/components/silkscreen-circle.ts
|
|
2681
2664
|
import { distance as distance41 } from "circuit-json";
|
|
2682
|
-
import { z as
|
|
2665
|
+
import { z as z115 } from "zod";
|
|
2683
2666
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2684
|
-
isFilled:
|
|
2685
|
-
isOutline:
|
|
2667
|
+
isFilled: z115.boolean().optional(),
|
|
2668
|
+
isOutline: z115.boolean().optional(),
|
|
2686
2669
|
strokeWidth: distance41.optional(),
|
|
2687
2670
|
radius: distance41
|
|
2688
2671
|
});
|
|
2689
2672
|
|
|
2690
2673
|
// lib/components/trace-hint.ts
|
|
2691
2674
|
import { distance as distance42, layer_ref as layer_ref11, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2692
|
-
import { z as
|
|
2693
|
-
var routeHintPointProps =
|
|
2675
|
+
import { z as z116 } from "zod";
|
|
2676
|
+
var routeHintPointProps = z116.object({
|
|
2694
2677
|
x: distance42,
|
|
2695
2678
|
y: distance42,
|
|
2696
|
-
via:
|
|
2679
|
+
via: z116.boolean().optional(),
|
|
2697
2680
|
toLayer: layer_ref11.optional()
|
|
2698
2681
|
});
|
|
2699
|
-
var traceHintProps =
|
|
2700
|
-
for:
|
|
2682
|
+
var traceHintProps = z116.object({
|
|
2683
|
+
for: z116.string().optional().describe(
|
|
2701
2684
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2702
2685
|
),
|
|
2703
|
-
order:
|
|
2686
|
+
order: z116.number().optional(),
|
|
2704
2687
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2705
|
-
offsets:
|
|
2706
|
-
traceWidth:
|
|
2688
|
+
offsets: z116.array(route_hint_point6).or(z116.array(routeHintPointProps)).optional(),
|
|
2689
|
+
traceWidth: z116.number().optional()
|
|
2707
2690
|
});
|
|
2708
2691
|
|
|
2709
2692
|
// lib/components/port.ts
|
|
2710
|
-
import { z as
|
|
2693
|
+
import { z as z117 } from "zod";
|
|
2711
2694
|
var portProps = commonLayoutProps.extend({
|
|
2712
|
-
name:
|
|
2713
|
-
pinNumber:
|
|
2714
|
-
schStemLength:
|
|
2715
|
-
aliases:
|
|
2716
|
-
layer:
|
|
2717
|
-
layers:
|
|
2718
|
-
schX:
|
|
2719
|
-
schY:
|
|
2695
|
+
name: z117.string(),
|
|
2696
|
+
pinNumber: z117.number().optional(),
|
|
2697
|
+
schStemLength: z117.number().optional(),
|
|
2698
|
+
aliases: z117.array(z117.string()).optional(),
|
|
2699
|
+
layer: z117.string().optional(),
|
|
2700
|
+
layers: z117.array(z117.string()).optional(),
|
|
2701
|
+
schX: z117.number().optional(),
|
|
2702
|
+
schY: z117.number().optional(),
|
|
2720
2703
|
direction,
|
|
2721
|
-
connectsTo:
|
|
2704
|
+
connectsTo: z117.string().or(z117.array(z117.string())).optional(),
|
|
2722
2705
|
kicadPinMetadata: kicadPinMetadata.optional(),
|
|
2723
|
-
hasInversionCircle:
|
|
2706
|
+
hasInversionCircle: z117.boolean().optional()
|
|
2724
2707
|
});
|
|
2725
2708
|
|
|
2726
2709
|
// lib/components/pcb-note-text.ts
|
|
2727
2710
|
import { length as length11 } from "circuit-json";
|
|
2728
|
-
import { z as
|
|
2711
|
+
import { z as z118 } from "zod";
|
|
2729
2712
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2730
|
-
text:
|
|
2731
|
-
anchorAlignment:
|
|
2732
|
-
font:
|
|
2713
|
+
text: z118.string(),
|
|
2714
|
+
anchorAlignment: z118.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2715
|
+
font: z118.enum(["tscircuit2024"]).optional(),
|
|
2733
2716
|
fontSize: length11.optional(),
|
|
2734
|
-
color:
|
|
2717
|
+
color: z118.string().optional()
|
|
2735
2718
|
});
|
|
2736
2719
|
expectTypesMatch(true);
|
|
2737
2720
|
|
|
2738
2721
|
// lib/components/pcb-note-rect.ts
|
|
2739
2722
|
import { distance as distance43 } from "circuit-json";
|
|
2740
|
-
import { z as
|
|
2723
|
+
import { z as z119 } from "zod";
|
|
2741
2724
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2742
2725
|
width: distance43,
|
|
2743
2726
|
height: distance43,
|
|
2744
2727
|
strokeWidth: distance43.optional(),
|
|
2745
|
-
isFilled:
|
|
2746
|
-
hasStroke:
|
|
2747
|
-
isStrokeDashed:
|
|
2748
|
-
color:
|
|
2728
|
+
isFilled: z119.boolean().optional(),
|
|
2729
|
+
hasStroke: z119.boolean().optional(),
|
|
2730
|
+
isStrokeDashed: z119.boolean().optional(),
|
|
2731
|
+
color: z119.string().optional(),
|
|
2749
2732
|
cornerRadius: distance43.optional()
|
|
2750
2733
|
});
|
|
2751
2734
|
expectTypesMatch(true);
|
|
@@ -2755,7 +2738,7 @@ import {
|
|
|
2755
2738
|
length as length12,
|
|
2756
2739
|
route_hint_point as route_hint_point7
|
|
2757
2740
|
} from "circuit-json";
|
|
2758
|
-
import { z as
|
|
2741
|
+
import { z as z120 } from "zod";
|
|
2759
2742
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2760
2743
|
pcbLeftEdgeX: true,
|
|
2761
2744
|
pcbRightEdgeX: true,
|
|
@@ -2767,15 +2750,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2767
2750
|
pcbOffsetY: true,
|
|
2768
2751
|
pcbRotation: true
|
|
2769
2752
|
}).extend({
|
|
2770
|
-
route:
|
|
2753
|
+
route: z120.array(route_hint_point7),
|
|
2771
2754
|
strokeWidth: length12.optional(),
|
|
2772
|
-
color:
|
|
2755
|
+
color: z120.string().optional()
|
|
2773
2756
|
});
|
|
2774
2757
|
expectTypesMatch(true);
|
|
2775
2758
|
|
|
2776
2759
|
// lib/components/pcb-note-line.ts
|
|
2777
2760
|
import { distance as distance44 } from "circuit-json";
|
|
2778
|
-
import { z as
|
|
2761
|
+
import { z as z121 } from "zod";
|
|
2779
2762
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2780
2763
|
pcbLeftEdgeX: true,
|
|
2781
2764
|
pcbRightEdgeX: true,
|
|
@@ -2792,15 +2775,15 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2792
2775
|
x2: distance44,
|
|
2793
2776
|
y2: distance44,
|
|
2794
2777
|
strokeWidth: distance44.optional(),
|
|
2795
|
-
color:
|
|
2796
|
-
isDashed:
|
|
2778
|
+
color: z121.string().optional(),
|
|
2779
|
+
isDashed: z121.boolean().optional()
|
|
2797
2780
|
});
|
|
2798
2781
|
expectTypesMatch(true);
|
|
2799
2782
|
|
|
2800
2783
|
// lib/components/pcb-note-dimension.ts
|
|
2801
2784
|
import { distance as distance45, length as length13 } from "circuit-json";
|
|
2802
|
-
import { z as
|
|
2803
|
-
var dimensionTarget2 =
|
|
2785
|
+
import { z as z122 } from "zod";
|
|
2786
|
+
var dimensionTarget2 = z122.union([z122.string(), point]);
|
|
2804
2787
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2805
2788
|
pcbLeftEdgeX: true,
|
|
2806
2789
|
pcbRightEdgeX: true,
|
|
@@ -2814,100 +2797,100 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2814
2797
|
}).extend({
|
|
2815
2798
|
from: dimensionTarget2,
|
|
2816
2799
|
to: dimensionTarget2,
|
|
2817
|
-
text:
|
|
2800
|
+
text: z122.string().optional(),
|
|
2818
2801
|
offset: distance45.optional(),
|
|
2819
|
-
font:
|
|
2802
|
+
font: z122.enum(["tscircuit2024"]).optional(),
|
|
2820
2803
|
fontSize: length13.optional(),
|
|
2821
|
-
color:
|
|
2804
|
+
color: z122.string().optional(),
|
|
2822
2805
|
arrowSize: distance45.optional(),
|
|
2823
|
-
units:
|
|
2824
|
-
outerEdgeToEdge:
|
|
2825
|
-
centerToCenter:
|
|
2826
|
-
innerEdgeToEdge:
|
|
2806
|
+
units: z122.enum(["in", "mm"]).optional(),
|
|
2807
|
+
outerEdgeToEdge: z122.literal(true).optional(),
|
|
2808
|
+
centerToCenter: z122.literal(true).optional(),
|
|
2809
|
+
innerEdgeToEdge: z122.literal(true).optional()
|
|
2827
2810
|
});
|
|
2828
2811
|
expectTypesMatch(
|
|
2829
2812
|
true
|
|
2830
2813
|
);
|
|
2831
2814
|
|
|
2832
2815
|
// lib/platformConfig.ts
|
|
2833
|
-
import { z as
|
|
2834
|
-
var unvalidatedCircuitJson =
|
|
2835
|
-
var footprintLibraryResult =
|
|
2836
|
-
footprintCircuitJson:
|
|
2816
|
+
import { z as z123 } from "zod";
|
|
2817
|
+
var unvalidatedCircuitJson = z123.array(z123.any()).describe("Circuit JSON");
|
|
2818
|
+
var footprintLibraryResult = z123.object({
|
|
2819
|
+
footprintCircuitJson: z123.array(z123.any()),
|
|
2837
2820
|
cadModel: cadModelProp.optional()
|
|
2838
2821
|
});
|
|
2839
|
-
var pathToCircuitJsonFn =
|
|
2840
|
-
|
|
2841
|
-
|
|
2842
|
-
|
|
2843
|
-
).returns(
|
|
2822
|
+
var pathToCircuitJsonFn = z123.function().args(z123.string()).returns(z123.promise(footprintLibraryResult)).or(
|
|
2823
|
+
z123.function().args(
|
|
2824
|
+
z123.string(),
|
|
2825
|
+
z123.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2826
|
+
).returns(z123.promise(footprintLibraryResult))
|
|
2844
2827
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2845
|
-
var footprintFileParserEntry =
|
|
2846
|
-
loadFromUrl:
|
|
2828
|
+
var footprintFileParserEntry = z123.object({
|
|
2829
|
+
loadFromUrl: z123.function().args(z123.string()).returns(z123.promise(footprintLibraryResult)).describe(
|
|
2847
2830
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2848
2831
|
)
|
|
2849
2832
|
});
|
|
2850
|
-
var spiceEngineSimulationResult =
|
|
2851
|
-
engineVersionString:
|
|
2833
|
+
var spiceEngineSimulationResult = z123.object({
|
|
2834
|
+
engineVersionString: z123.string().optional(),
|
|
2852
2835
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2853
2836
|
});
|
|
2854
|
-
var spiceEngineZod =
|
|
2855
|
-
simulate:
|
|
2837
|
+
var spiceEngineZod = z123.object({
|
|
2838
|
+
simulate: z123.function().args(z123.string()).returns(z123.promise(spiceEngineSimulationResult)).describe(
|
|
2856
2839
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2857
2840
|
)
|
|
2858
2841
|
});
|
|
2859
|
-
var defaultSpiceEngine =
|
|
2842
|
+
var defaultSpiceEngine = z123.custom(
|
|
2860
2843
|
(value) => typeof value === "string"
|
|
2861
2844
|
);
|
|
2862
|
-
var autorouterInstance =
|
|
2863
|
-
run:
|
|
2864
|
-
getOutputSimpleRouteJson:
|
|
2845
|
+
var autorouterInstance = z123.object({
|
|
2846
|
+
run: z123.function().args().returns(z123.promise(z123.unknown())).describe("Run the autorouter"),
|
|
2847
|
+
getOutputSimpleRouteJson: z123.function().args().returns(z123.promise(z123.any())).describe("Get the resulting SimpleRouteJson")
|
|
2865
2848
|
});
|
|
2866
|
-
var autorouterDefinition =
|
|
2867
|
-
createAutorouter:
|
|
2849
|
+
var autorouterDefinition = z123.object({
|
|
2850
|
+
createAutorouter: z123.function().args(z123.any(), z123.any().optional()).returns(z123.union([autorouterInstance, z123.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2868
2851
|
});
|
|
2869
|
-
var platformFetch =
|
|
2870
|
-
var platformConfig =
|
|
2852
|
+
var platformFetch = z123.custom((value) => typeof value === "function").describe("A fetch-like function to use for platform requests");
|
|
2853
|
+
var platformConfig = z123.object({
|
|
2871
2854
|
partsEngine: partsEngine.optional(),
|
|
2872
2855
|
autorouter: autorouterProp.optional(),
|
|
2873
|
-
autorouterMap:
|
|
2856
|
+
autorouterMap: z123.record(z123.string(), autorouterDefinition).optional(),
|
|
2874
2857
|
registryApiUrl: url.optional(),
|
|
2875
2858
|
cloudAutorouterUrl: url.optional(),
|
|
2876
|
-
projectName:
|
|
2859
|
+
projectName: z123.string().optional(),
|
|
2877
2860
|
projectBaseUrl: url.optional(),
|
|
2878
|
-
version:
|
|
2861
|
+
version: z123.string().optional(),
|
|
2879
2862
|
url: url.optional(),
|
|
2880
|
-
printBoardInformationToSilkscreen:
|
|
2881
|
-
includeBoardFiles:
|
|
2863
|
+
printBoardInformationToSilkscreen: z123.boolean().optional(),
|
|
2864
|
+
includeBoardFiles: z123.array(z123.string()).describe(
|
|
2882
2865
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2883
2866
|
).optional(),
|
|
2884
|
-
snapshotsDir:
|
|
2867
|
+
snapshotsDir: z123.string().describe(
|
|
2885
2868
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2886
2869
|
).optional(),
|
|
2887
2870
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2888
|
-
unitPreference:
|
|
2889
|
-
localCacheEngine:
|
|
2890
|
-
pcbDisabled:
|
|
2891
|
-
routingDisabled:
|
|
2892
|
-
schematicDisabled:
|
|
2893
|
-
partsEngineDisabled:
|
|
2894
|
-
drcChecksDisabled:
|
|
2895
|
-
netlistDrcChecksDisabled:
|
|
2896
|
-
routingDrcChecksDisabled:
|
|
2897
|
-
placementDrcChecksDisabled:
|
|
2898
|
-
spiceEngineMap:
|
|
2899
|
-
footprintLibraryMap:
|
|
2900
|
-
|
|
2901
|
-
|
|
2871
|
+
unitPreference: z123.enum(["mm", "in", "mil"]).optional(),
|
|
2872
|
+
localCacheEngine: z123.any().optional(),
|
|
2873
|
+
pcbDisabled: z123.boolean().optional(),
|
|
2874
|
+
routingDisabled: z123.boolean().optional(),
|
|
2875
|
+
schematicDisabled: z123.boolean().optional(),
|
|
2876
|
+
partsEngineDisabled: z123.boolean().optional(),
|
|
2877
|
+
drcChecksDisabled: z123.boolean().optional(),
|
|
2878
|
+
netlistDrcChecksDisabled: z123.boolean().optional(),
|
|
2879
|
+
routingDrcChecksDisabled: z123.boolean().optional(),
|
|
2880
|
+
placementDrcChecksDisabled: z123.boolean().optional(),
|
|
2881
|
+
spiceEngineMap: z123.record(z123.string(), spiceEngineZod).optional(),
|
|
2882
|
+
footprintLibraryMap: z123.record(
|
|
2883
|
+
z123.string(),
|
|
2884
|
+
z123.union([
|
|
2902
2885
|
pathToCircuitJsonFn,
|
|
2903
|
-
|
|
2904
|
-
|
|
2905
|
-
|
|
2886
|
+
z123.record(
|
|
2887
|
+
z123.string(),
|
|
2888
|
+
z123.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2906
2889
|
)
|
|
2907
2890
|
])
|
|
2908
2891
|
).optional(),
|
|
2909
|
-
footprintFileParserMap:
|
|
2910
|
-
resolveProjectStaticFileImportUrl:
|
|
2892
|
+
footprintFileParserMap: z123.record(z123.string(), footprintFileParserEntry).optional(),
|
|
2893
|
+
resolveProjectStaticFileImportUrl: z123.function().args(z123.string()).returns(z123.promise(z123.string())).describe(
|
|
2911
2894
|
"A function that returns a string URL for static files for the project"
|
|
2912
2895
|
).optional(),
|
|
2913
2896
|
platformFetch: platformFetch.optional()
|
|
@@ -3064,6 +3047,7 @@ export {
|
|
|
3064
3047
|
pcbYDistConstraintProps,
|
|
3065
3048
|
pillSmtPadProps,
|
|
3066
3049
|
pinAttributeMap,
|
|
3050
|
+
pinCapability,
|
|
3067
3051
|
pinCompatibleVariant,
|
|
3068
3052
|
pinHeaderProps,
|
|
3069
3053
|
pinLabelsProp,
|