circuit-json 0.0.101 → 0.0.103
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.mts +46 -5
- package/dist/index.mjs +350 -338
- package/dist/index.mjs.map +1 -1
- package/package.json +1 -1
package/dist/index.mjs
CHANGED
|
@@ -267,6 +267,13 @@ var supplier_name = z6.enum([
|
|
|
267
267
|
"lcsc"
|
|
268
268
|
]);
|
|
269
269
|
|
|
270
|
+
// src/utils/expect-types-match.ts
|
|
271
|
+
var expectTypesMatch = (shouldBe) => {
|
|
272
|
+
};
|
|
273
|
+
expectTypesMatch("extra props b");
|
|
274
|
+
expectTypesMatch("missing props b");
|
|
275
|
+
expectTypesMatch(true);
|
|
276
|
+
|
|
270
277
|
// src/source/base/source_component_base.ts
|
|
271
278
|
import { z as z7 } from "zod";
|
|
272
279
|
var source_component_base = z7.object({
|
|
@@ -278,6 +285,7 @@ var source_component_base = z7.object({
|
|
|
278
285
|
supplier_part_numbers: z7.record(supplier_name, z7.array(z7.string())).optional(),
|
|
279
286
|
display_value: z7.string().optional()
|
|
280
287
|
});
|
|
288
|
+
expectTypesMatch(true);
|
|
281
289
|
|
|
282
290
|
// src/source/source_simple_capacitor.ts
|
|
283
291
|
var source_simple_capacitor = source_component_base.extend({
|
|
@@ -378,10 +386,6 @@ var source_port = z20.object({
|
|
|
378
386
|
source_component_id: z20.string()
|
|
379
387
|
});
|
|
380
388
|
|
|
381
|
-
// src/utils/expect-types-match.ts
|
|
382
|
-
var expectTypesMatch = (shouldBe) => {
|
|
383
|
-
};
|
|
384
|
-
|
|
385
389
|
// src/source/source_trace.ts
|
|
386
390
|
import { z as z21 } from "zod";
|
|
387
391
|
var source_trace = z21.object({
|
|
@@ -415,11 +419,18 @@ var source_net = z23.object({
|
|
|
415
419
|
trace_width: z23.number().optional()
|
|
416
420
|
});
|
|
417
421
|
|
|
418
|
-
// src/
|
|
422
|
+
// src/source/source_simple_potentiometer.ts
|
|
419
423
|
import { z as z24 } from "zod";
|
|
420
|
-
var
|
|
421
|
-
|
|
422
|
-
|
|
424
|
+
var source_simple_potentiometer = source_component_base.extend({
|
|
425
|
+
ftype: z24.literal("simple_potentiometer"),
|
|
426
|
+
max_resistance: resistance
|
|
427
|
+
});
|
|
428
|
+
|
|
429
|
+
// src/schematic/schematic_box.ts
|
|
430
|
+
import { z as z25 } from "zod";
|
|
431
|
+
var schematic_box = z25.object({
|
|
432
|
+
type: z25.literal("schematic_box"),
|
|
433
|
+
schematic_component_id: z25.string(),
|
|
423
434
|
width: distance,
|
|
424
435
|
height: distance,
|
|
425
436
|
x: distance,
|
|
@@ -427,77 +438,77 @@ var schematic_box = z24.object({
|
|
|
427
438
|
}).describe("Draws a box on the schematic");
|
|
428
439
|
|
|
429
440
|
// src/schematic/schematic_path.ts
|
|
430
|
-
import { z as
|
|
431
|
-
var schematic_path =
|
|
432
|
-
type:
|
|
433
|
-
schematic_component_id:
|
|
434
|
-
fill_color:
|
|
435
|
-
is_filled:
|
|
436
|
-
points:
|
|
441
|
+
import { z as z26 } from "zod";
|
|
442
|
+
var schematic_path = z26.object({
|
|
443
|
+
type: z26.literal("schematic_path"),
|
|
444
|
+
schematic_component_id: z26.string(),
|
|
445
|
+
fill_color: z26.enum(["red", "blue"]).optional(),
|
|
446
|
+
is_filled: z26.boolean().optional(),
|
|
447
|
+
points: z26.array(point)
|
|
437
448
|
});
|
|
438
449
|
|
|
439
450
|
// src/schematic/schematic_component.ts
|
|
440
|
-
import { z as
|
|
441
|
-
var schematic_pin_styles =
|
|
442
|
-
|
|
451
|
+
import { z as z27 } from "zod";
|
|
452
|
+
var schematic_pin_styles = z27.record(
|
|
453
|
+
z27.object({
|
|
443
454
|
left_margin: length.optional(),
|
|
444
455
|
right_margin: length.optional(),
|
|
445
456
|
top_margin: length.optional(),
|
|
446
457
|
bottom_margin: length.optional()
|
|
447
458
|
})
|
|
448
459
|
);
|
|
449
|
-
var schematic_component_port_arrangement_by_size =
|
|
450
|
-
left_size:
|
|
451
|
-
right_size:
|
|
452
|
-
top_size:
|
|
453
|
-
bottom_size:
|
|
460
|
+
var schematic_component_port_arrangement_by_size = z27.object({
|
|
461
|
+
left_size: z27.number(),
|
|
462
|
+
right_size: z27.number(),
|
|
463
|
+
top_size: z27.number().optional(),
|
|
464
|
+
bottom_size: z27.number().optional()
|
|
454
465
|
});
|
|
455
466
|
expectTypesMatch(true);
|
|
456
|
-
var schematic_component_port_arrangement_by_sides =
|
|
457
|
-
left_side:
|
|
458
|
-
pins:
|
|
459
|
-
direction:
|
|
467
|
+
var schematic_component_port_arrangement_by_sides = z27.object({
|
|
468
|
+
left_side: z27.object({
|
|
469
|
+
pins: z27.array(z27.number()),
|
|
470
|
+
direction: z27.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
460
471
|
}).optional(),
|
|
461
|
-
right_side:
|
|
462
|
-
pins:
|
|
463
|
-
direction:
|
|
472
|
+
right_side: z27.object({
|
|
473
|
+
pins: z27.array(z27.number()),
|
|
474
|
+
direction: z27.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
464
475
|
}).optional(),
|
|
465
|
-
top_side:
|
|
466
|
-
pins:
|
|
467
|
-
direction:
|
|
476
|
+
top_side: z27.object({
|
|
477
|
+
pins: z27.array(z27.number()),
|
|
478
|
+
direction: z27.enum(["left-to-right", "right-to-left"]).optional()
|
|
468
479
|
}).optional(),
|
|
469
|
-
bottom_side:
|
|
470
|
-
pins:
|
|
471
|
-
direction:
|
|
480
|
+
bottom_side: z27.object({
|
|
481
|
+
pins: z27.array(z27.number()),
|
|
482
|
+
direction: z27.enum(["left-to-right", "right-to-left"]).optional()
|
|
472
483
|
}).optional()
|
|
473
484
|
});
|
|
474
485
|
expectTypesMatch(true);
|
|
475
|
-
var port_arrangement =
|
|
486
|
+
var port_arrangement = z27.union([
|
|
476
487
|
schematic_component_port_arrangement_by_size,
|
|
477
488
|
schematic_component_port_arrangement_by_sides
|
|
478
489
|
]);
|
|
479
|
-
var schematic_component =
|
|
480
|
-
type:
|
|
490
|
+
var schematic_component = z27.object({
|
|
491
|
+
type: z27.literal("schematic_component"),
|
|
481
492
|
rotation: rotation.default(0),
|
|
482
493
|
size,
|
|
483
494
|
center: point,
|
|
484
|
-
source_component_id:
|
|
485
|
-
schematic_component_id:
|
|
495
|
+
source_component_id: z27.string(),
|
|
496
|
+
schematic_component_id: z27.string(),
|
|
486
497
|
pin_spacing: length.optional(),
|
|
487
498
|
pin_styles: schematic_pin_styles.optional(),
|
|
488
499
|
box_width: length.optional(),
|
|
489
|
-
symbol_name:
|
|
500
|
+
symbol_name: z27.string().optional(),
|
|
490
501
|
port_arrangement: port_arrangement.optional(),
|
|
491
|
-
port_labels:
|
|
492
|
-
symbol_display_value:
|
|
502
|
+
port_labels: z27.record(z27.string()).optional(),
|
|
503
|
+
symbol_display_value: z27.string().optional()
|
|
493
504
|
});
|
|
494
505
|
expectTypesMatch(true);
|
|
495
506
|
|
|
496
507
|
// src/schematic/schematic_line.ts
|
|
497
|
-
import { z as
|
|
498
|
-
var schematic_line =
|
|
499
|
-
type:
|
|
500
|
-
schematic_component_id:
|
|
508
|
+
import { z as z28 } from "zod";
|
|
509
|
+
var schematic_line = z28.object({
|
|
510
|
+
type: z28.literal("schematic_line"),
|
|
511
|
+
schematic_component_id: z28.string(),
|
|
501
512
|
x1: distance,
|
|
502
513
|
x2: distance,
|
|
503
514
|
y1: distance,
|
|
@@ -505,111 +516,111 @@ var schematic_line = z27.object({
|
|
|
505
516
|
});
|
|
506
517
|
|
|
507
518
|
// src/schematic/schematic_trace.ts
|
|
508
|
-
import { z as
|
|
509
|
-
var schematic_trace =
|
|
510
|
-
type:
|
|
511
|
-
schematic_trace_id:
|
|
512
|
-
source_trace_id:
|
|
513
|
-
junctions:
|
|
514
|
-
|
|
515
|
-
x:
|
|
516
|
-
y:
|
|
519
|
+
import { z as z29 } from "zod";
|
|
520
|
+
var schematic_trace = z29.object({
|
|
521
|
+
type: z29.literal("schematic_trace"),
|
|
522
|
+
schematic_trace_id: z29.string(),
|
|
523
|
+
source_trace_id: z29.string(),
|
|
524
|
+
junctions: z29.array(
|
|
525
|
+
z29.object({
|
|
526
|
+
x: z29.number(),
|
|
527
|
+
y: z29.number()
|
|
517
528
|
})
|
|
518
529
|
),
|
|
519
|
-
edges:
|
|
520
|
-
|
|
521
|
-
from:
|
|
522
|
-
x:
|
|
523
|
-
y:
|
|
530
|
+
edges: z29.array(
|
|
531
|
+
z29.object({
|
|
532
|
+
from: z29.object({
|
|
533
|
+
x: z29.number(),
|
|
534
|
+
y: z29.number()
|
|
524
535
|
}),
|
|
525
|
-
to:
|
|
526
|
-
x:
|
|
527
|
-
y:
|
|
536
|
+
to: z29.object({
|
|
537
|
+
x: z29.number(),
|
|
538
|
+
y: z29.number()
|
|
528
539
|
}),
|
|
529
|
-
is_crossing:
|
|
530
|
-
from_schematic_port_id:
|
|
531
|
-
to_schematic_port_id:
|
|
540
|
+
is_crossing: z29.boolean().optional(),
|
|
541
|
+
from_schematic_port_id: z29.string().optional(),
|
|
542
|
+
to_schematic_port_id: z29.string().optional()
|
|
532
543
|
})
|
|
533
544
|
)
|
|
534
545
|
});
|
|
535
546
|
expectTypesMatch(true);
|
|
536
547
|
|
|
537
548
|
// src/schematic/schematic_text.ts
|
|
538
|
-
import { z as
|
|
539
|
-
var schematic_text =
|
|
540
|
-
type:
|
|
541
|
-
schematic_component_id:
|
|
542
|
-
schematic_text_id:
|
|
543
|
-
text:
|
|
544
|
-
position:
|
|
549
|
+
import { z as z30 } from "zod";
|
|
550
|
+
var schematic_text = z30.object({
|
|
551
|
+
type: z30.literal("schematic_text"),
|
|
552
|
+
schematic_component_id: z30.string(),
|
|
553
|
+
schematic_text_id: z30.string(),
|
|
554
|
+
text: z30.string(),
|
|
555
|
+
position: z30.object({
|
|
545
556
|
x: distance,
|
|
546
557
|
y: distance
|
|
547
558
|
}),
|
|
548
|
-
rotation:
|
|
549
|
-
anchor:
|
|
550
|
-
color:
|
|
559
|
+
rotation: z30.number().default(0),
|
|
560
|
+
anchor: z30.enum(["center", "left", "right", "top", "bottom"]).default("center"),
|
|
561
|
+
color: z30.string().default("#000000")
|
|
551
562
|
});
|
|
552
563
|
|
|
553
564
|
// src/schematic/schematic_port.ts
|
|
554
|
-
import { z as
|
|
555
|
-
var schematic_port =
|
|
556
|
-
type:
|
|
557
|
-
schematic_port_id:
|
|
558
|
-
source_port_id:
|
|
559
|
-
schematic_component_id:
|
|
565
|
+
import { z as z31 } from "zod";
|
|
566
|
+
var schematic_port = z31.object({
|
|
567
|
+
type: z31.literal("schematic_port"),
|
|
568
|
+
schematic_port_id: z31.string(),
|
|
569
|
+
source_port_id: z31.string(),
|
|
570
|
+
schematic_component_id: z31.string().optional(),
|
|
560
571
|
center: point,
|
|
561
|
-
facing_direction:
|
|
562
|
-
distance_from_component_edge:
|
|
563
|
-
side_of_component:
|
|
564
|
-
true_ccw_index:
|
|
565
|
-
pin_number:
|
|
566
|
-
display_pin_label:
|
|
572
|
+
facing_direction: z31.enum(["up", "down", "left", "right"]).optional(),
|
|
573
|
+
distance_from_component_edge: z31.number().optional(),
|
|
574
|
+
side_of_component: z31.enum(["top", "bottom", "left", "right"]).optional(),
|
|
575
|
+
true_ccw_index: z31.number().optional(),
|
|
576
|
+
pin_number: z31.number().optional(),
|
|
577
|
+
display_pin_label: z31.string().optional()
|
|
567
578
|
}).describe("Defines a port on a schematic component");
|
|
568
579
|
expectTypesMatch(true);
|
|
569
580
|
|
|
570
581
|
// src/schematic/schematic_net_label.ts
|
|
571
|
-
import { z as
|
|
572
|
-
var schematic_net_label =
|
|
573
|
-
type:
|
|
574
|
-
source_net_id:
|
|
582
|
+
import { z as z32 } from "zod";
|
|
583
|
+
var schematic_net_label = z32.object({
|
|
584
|
+
type: z32.literal("schematic_net_label"),
|
|
585
|
+
source_net_id: z32.string(),
|
|
575
586
|
center: point,
|
|
576
587
|
anchor_position: point.optional(),
|
|
577
|
-
anchor_side:
|
|
578
|
-
text:
|
|
579
|
-
symbol_name:
|
|
588
|
+
anchor_side: z32.enum(["top", "bottom", "left", "right"]),
|
|
589
|
+
text: z32.string(),
|
|
590
|
+
symbol_name: z32.string().optional()
|
|
580
591
|
});
|
|
581
592
|
|
|
582
593
|
// src/schematic/schematic_error.ts
|
|
583
|
-
import { z as
|
|
584
|
-
var schematic_error =
|
|
585
|
-
schematic_error_id:
|
|
586
|
-
type:
|
|
594
|
+
import { z as z33 } from "zod";
|
|
595
|
+
var schematic_error = z33.object({
|
|
596
|
+
schematic_error_id: z33.string(),
|
|
597
|
+
type: z33.literal("schematic_error"),
|
|
587
598
|
// eventually each error type should be broken out into a dir of files
|
|
588
|
-
error_type:
|
|
589
|
-
message:
|
|
599
|
+
error_type: z33.literal("schematic_port_not_found"),
|
|
600
|
+
message: z33.string()
|
|
590
601
|
}).describe("Defines a schematic error on the schematic");
|
|
591
602
|
|
|
592
603
|
// src/schematic/schematic_debug_object.ts
|
|
593
|
-
import { z as
|
|
594
|
-
var schematic_debug_object_base =
|
|
595
|
-
type:
|
|
596
|
-
label:
|
|
604
|
+
import { z as z34 } from "zod";
|
|
605
|
+
var schematic_debug_object_base = z34.object({
|
|
606
|
+
type: z34.literal("schematic_debug_object"),
|
|
607
|
+
label: z34.string().optional()
|
|
597
608
|
});
|
|
598
609
|
var schematic_debug_rect = schematic_debug_object_base.extend({
|
|
599
|
-
shape:
|
|
610
|
+
shape: z34.literal("rect"),
|
|
600
611
|
center: point,
|
|
601
612
|
size
|
|
602
613
|
});
|
|
603
614
|
var schematic_debug_line = schematic_debug_object_base.extend({
|
|
604
|
-
shape:
|
|
615
|
+
shape: z34.literal("line"),
|
|
605
616
|
start: point,
|
|
606
617
|
end: point
|
|
607
618
|
});
|
|
608
619
|
var schematic_debug_point = schematic_debug_object_base.extend({
|
|
609
|
-
shape:
|
|
620
|
+
shape: z34.literal("point"),
|
|
610
621
|
center: point
|
|
611
622
|
});
|
|
612
|
-
var schematic_debug_object =
|
|
623
|
+
var schematic_debug_object = z34.discriminatedUnion("shape", [
|
|
613
624
|
schematic_debug_rect,
|
|
614
625
|
schematic_debug_line,
|
|
615
626
|
schematic_debug_point
|
|
@@ -617,7 +628,7 @@ var schematic_debug_object = z33.discriminatedUnion("shape", [
|
|
|
617
628
|
expectTypesMatch(true);
|
|
618
629
|
|
|
619
630
|
// src/pcb/properties/layer_ref.ts
|
|
620
|
-
import { z as
|
|
631
|
+
import { z as z35 } from "zod";
|
|
621
632
|
var all_layers = [
|
|
622
633
|
"top",
|
|
623
634
|
"bottom",
|
|
@@ -628,9 +639,9 @@ var all_layers = [
|
|
|
628
639
|
"inner5",
|
|
629
640
|
"inner6"
|
|
630
641
|
];
|
|
631
|
-
var layer_string =
|
|
642
|
+
var layer_string = z35.enum(all_layers);
|
|
632
643
|
var layer_ref = layer_string.or(
|
|
633
|
-
|
|
644
|
+
z35.object({
|
|
634
645
|
name: layer_string
|
|
635
646
|
})
|
|
636
647
|
).transform((layer) => {
|
|
@@ -639,34 +650,34 @@ var layer_ref = layer_string.or(
|
|
|
639
650
|
}
|
|
640
651
|
return layer.name;
|
|
641
652
|
});
|
|
642
|
-
var visible_layer =
|
|
653
|
+
var visible_layer = z35.enum(["top", "bottom"]);
|
|
643
654
|
|
|
644
655
|
// src/pcb/properties/pcb_route_hints.ts
|
|
645
|
-
import { z as
|
|
646
|
-
var pcb_route_hint =
|
|
656
|
+
import { z as z36 } from "zod";
|
|
657
|
+
var pcb_route_hint = z36.object({
|
|
647
658
|
x: distance,
|
|
648
659
|
y: distance,
|
|
649
|
-
via:
|
|
660
|
+
via: z36.boolean().optional(),
|
|
650
661
|
via_to_layer: layer_ref.optional()
|
|
651
662
|
});
|
|
652
|
-
var pcb_route_hints =
|
|
663
|
+
var pcb_route_hints = z36.array(pcb_route_hint);
|
|
653
664
|
|
|
654
665
|
// src/pcb/properties/route_hint_point.ts
|
|
655
|
-
import { z as
|
|
656
|
-
var route_hint_point =
|
|
666
|
+
import { z as z37 } from "zod";
|
|
667
|
+
var route_hint_point = z37.object({
|
|
657
668
|
x: distance,
|
|
658
669
|
y: distance,
|
|
659
|
-
via:
|
|
670
|
+
via: z37.boolean().optional(),
|
|
660
671
|
to_layer: layer_ref.optional(),
|
|
661
672
|
trace_width: distance.optional()
|
|
662
673
|
});
|
|
663
674
|
|
|
664
675
|
// src/pcb/pcb_component.ts
|
|
665
|
-
import { z as
|
|
666
|
-
var pcb_component =
|
|
667
|
-
type:
|
|
676
|
+
import { z as z38 } from "zod";
|
|
677
|
+
var pcb_component = z38.object({
|
|
678
|
+
type: z38.literal("pcb_component"),
|
|
668
679
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
669
|
-
source_component_id:
|
|
680
|
+
source_component_id: z38.string(),
|
|
670
681
|
center: point,
|
|
671
682
|
layer: layer_ref,
|
|
672
683
|
rotation,
|
|
@@ -676,12 +687,12 @@ var pcb_component = z37.object({
|
|
|
676
687
|
expectTypesMatch(true);
|
|
677
688
|
|
|
678
689
|
// src/pcb/pcb_hole.ts
|
|
679
|
-
import { z as
|
|
680
|
-
var pcb_hole_circle_or_square =
|
|
681
|
-
type:
|
|
690
|
+
import { z as z39 } from "zod";
|
|
691
|
+
var pcb_hole_circle_or_square = z39.object({
|
|
692
|
+
type: z39.literal("pcb_hole"),
|
|
682
693
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
683
|
-
hole_shape:
|
|
684
|
-
hole_diameter:
|
|
694
|
+
hole_shape: z39.enum(["circle", "square"]),
|
|
695
|
+
hole_diameter: z39.number(),
|
|
685
696
|
x: distance,
|
|
686
697
|
y: distance
|
|
687
698
|
});
|
|
@@ -689,12 +700,12 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
|
|
|
689
700
|
"Defines a circular or square hole on the PCB"
|
|
690
701
|
);
|
|
691
702
|
expectTypesMatch(true);
|
|
692
|
-
var pcb_hole_oval =
|
|
693
|
-
type:
|
|
703
|
+
var pcb_hole_oval = z39.object({
|
|
704
|
+
type: z39.literal("pcb_hole"),
|
|
694
705
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
695
|
-
hole_shape:
|
|
696
|
-
hole_width:
|
|
697
|
-
hole_height:
|
|
706
|
+
hole_shape: z39.literal("oval"),
|
|
707
|
+
hole_width: z39.number(),
|
|
708
|
+
hole_height: z39.number(),
|
|
698
709
|
x: distance,
|
|
699
710
|
y: distance
|
|
700
711
|
});
|
|
@@ -705,36 +716,36 @@ expectTypesMatch(true);
|
|
|
705
716
|
var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
|
|
706
717
|
|
|
707
718
|
// src/pcb/pcb_plated_hole.ts
|
|
708
|
-
import { z as
|
|
709
|
-
var pcb_plated_hole_circle =
|
|
710
|
-
type:
|
|
711
|
-
shape:
|
|
712
|
-
outer_diameter:
|
|
713
|
-
hole_diameter:
|
|
719
|
+
import { z as z40 } from "zod";
|
|
720
|
+
var pcb_plated_hole_circle = z40.object({
|
|
721
|
+
type: z40.literal("pcb_plated_hole"),
|
|
722
|
+
shape: z40.literal("circle"),
|
|
723
|
+
outer_diameter: z40.number(),
|
|
724
|
+
hole_diameter: z40.number(),
|
|
714
725
|
x: distance,
|
|
715
726
|
y: distance,
|
|
716
|
-
layers:
|
|
717
|
-
port_hints:
|
|
718
|
-
pcb_component_id:
|
|
719
|
-
pcb_port_id:
|
|
727
|
+
layers: z40.array(layer_ref),
|
|
728
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
729
|
+
pcb_component_id: z40.string().optional(),
|
|
730
|
+
pcb_port_id: z40.string().optional(),
|
|
720
731
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
721
732
|
});
|
|
722
|
-
var pcb_plated_hole_oval =
|
|
723
|
-
type:
|
|
724
|
-
shape:
|
|
725
|
-
outer_width:
|
|
726
|
-
outer_height:
|
|
727
|
-
hole_width:
|
|
728
|
-
hole_height:
|
|
733
|
+
var pcb_plated_hole_oval = z40.object({
|
|
734
|
+
type: z40.literal("pcb_plated_hole"),
|
|
735
|
+
shape: z40.enum(["oval", "pill"]),
|
|
736
|
+
outer_width: z40.number(),
|
|
737
|
+
outer_height: z40.number(),
|
|
738
|
+
hole_width: z40.number(),
|
|
739
|
+
hole_height: z40.number(),
|
|
729
740
|
x: distance,
|
|
730
741
|
y: distance,
|
|
731
|
-
layers:
|
|
732
|
-
port_hints:
|
|
733
|
-
pcb_component_id:
|
|
734
|
-
pcb_port_id:
|
|
742
|
+
layers: z40.array(layer_ref),
|
|
743
|
+
port_hints: z40.array(z40.string()).optional(),
|
|
744
|
+
pcb_component_id: z40.string().optional(),
|
|
745
|
+
pcb_port_id: z40.string().optional(),
|
|
735
746
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
736
747
|
});
|
|
737
|
-
var pcb_plated_hole =
|
|
748
|
+
var pcb_plated_hole = z40.union([
|
|
738
749
|
pcb_plated_hole_circle,
|
|
739
750
|
pcb_plated_hole_oval
|
|
740
751
|
]);
|
|
@@ -744,140 +755,140 @@ expectTypesMatch(
|
|
|
744
755
|
expectTypesMatch(true);
|
|
745
756
|
|
|
746
757
|
// src/pcb/pcb_port.ts
|
|
747
|
-
import { z as
|
|
748
|
-
var pcb_port =
|
|
749
|
-
type:
|
|
758
|
+
import { z as z41 } from "zod";
|
|
759
|
+
var pcb_port = z41.object({
|
|
760
|
+
type: z41.literal("pcb_port"),
|
|
750
761
|
pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
|
|
751
|
-
source_port_id:
|
|
752
|
-
pcb_component_id:
|
|
762
|
+
source_port_id: z41.string(),
|
|
763
|
+
pcb_component_id: z41.string(),
|
|
753
764
|
x: distance,
|
|
754
765
|
y: distance,
|
|
755
|
-
layers:
|
|
766
|
+
layers: z41.array(layer_ref)
|
|
756
767
|
}).describe("Defines a port on the PCB");
|
|
757
768
|
expectTypesMatch(true);
|
|
758
769
|
|
|
759
770
|
// src/pcb/pcb_smtpad.ts
|
|
760
|
-
import { z as
|
|
761
|
-
var pcb_smtpad_circle =
|
|
762
|
-
type:
|
|
763
|
-
shape:
|
|
771
|
+
import { z as z42 } from "zod";
|
|
772
|
+
var pcb_smtpad_circle = z42.object({
|
|
773
|
+
type: z42.literal("pcb_smtpad"),
|
|
774
|
+
shape: z42.literal("circle"),
|
|
764
775
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
765
776
|
x: distance,
|
|
766
777
|
y: distance,
|
|
767
|
-
radius:
|
|
778
|
+
radius: z42.number(),
|
|
768
779
|
layer: layer_ref,
|
|
769
|
-
port_hints:
|
|
770
|
-
pcb_component_id:
|
|
771
|
-
pcb_port_id:
|
|
780
|
+
port_hints: z42.array(z42.string()).optional(),
|
|
781
|
+
pcb_component_id: z42.string().optional(),
|
|
782
|
+
pcb_port_id: z42.string().optional()
|
|
772
783
|
});
|
|
773
|
-
var pcb_smtpad_rect =
|
|
774
|
-
type:
|
|
775
|
-
shape:
|
|
784
|
+
var pcb_smtpad_rect = z42.object({
|
|
785
|
+
type: z42.literal("pcb_smtpad"),
|
|
786
|
+
shape: z42.literal("rect"),
|
|
776
787
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
777
788
|
x: distance,
|
|
778
789
|
y: distance,
|
|
779
|
-
width:
|
|
780
|
-
height:
|
|
790
|
+
width: z42.number(),
|
|
791
|
+
height: z42.number(),
|
|
781
792
|
layer: layer_ref,
|
|
782
|
-
port_hints:
|
|
783
|
-
pcb_component_id:
|
|
784
|
-
pcb_port_id:
|
|
793
|
+
port_hints: z42.array(z42.string()).optional(),
|
|
794
|
+
pcb_component_id: z42.string().optional(),
|
|
795
|
+
pcb_port_id: z42.string().optional()
|
|
785
796
|
});
|
|
786
|
-
var pcb_smtpad =
|
|
797
|
+
var pcb_smtpad = z42.union([pcb_smtpad_circle, pcb_smtpad_rect]).describe("Defines an SMT pad on the PCB");
|
|
787
798
|
expectTypesMatch(true);
|
|
788
799
|
expectTypesMatch(true);
|
|
789
800
|
|
|
790
801
|
// src/pcb/pcb_solder_paste.ts
|
|
791
|
-
import { z as
|
|
792
|
-
var pcb_solder_paste_circle =
|
|
793
|
-
type:
|
|
794
|
-
shape:
|
|
802
|
+
import { z as z43 } from "zod";
|
|
803
|
+
var pcb_solder_paste_circle = z43.object({
|
|
804
|
+
type: z43.literal("pcb_solder_paste"),
|
|
805
|
+
shape: z43.literal("circle"),
|
|
795
806
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
796
807
|
x: distance,
|
|
797
808
|
y: distance,
|
|
798
|
-
radius:
|
|
809
|
+
radius: z43.number(),
|
|
799
810
|
layer: layer_ref,
|
|
800
|
-
pcb_component_id:
|
|
801
|
-
pcb_smtpad_id:
|
|
811
|
+
pcb_component_id: z43.string().optional(),
|
|
812
|
+
pcb_smtpad_id: z43.string().optional()
|
|
802
813
|
});
|
|
803
|
-
var pcb_solder_paste_rect =
|
|
804
|
-
type:
|
|
805
|
-
shape:
|
|
814
|
+
var pcb_solder_paste_rect = z43.object({
|
|
815
|
+
type: z43.literal("pcb_solder_paste"),
|
|
816
|
+
shape: z43.literal("rect"),
|
|
806
817
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
807
818
|
x: distance,
|
|
808
819
|
y: distance,
|
|
809
|
-
width:
|
|
810
|
-
height:
|
|
820
|
+
width: z43.number(),
|
|
821
|
+
height: z43.number(),
|
|
811
822
|
layer: layer_ref,
|
|
812
|
-
pcb_component_id:
|
|
813
|
-
pcb_smtpad_id:
|
|
823
|
+
pcb_component_id: z43.string().optional(),
|
|
824
|
+
pcb_smtpad_id: z43.string().optional()
|
|
814
825
|
});
|
|
815
|
-
var pcb_solder_paste =
|
|
826
|
+
var pcb_solder_paste = z43.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
|
|
816
827
|
expectTypesMatch(true);
|
|
817
828
|
expectTypesMatch(true);
|
|
818
829
|
|
|
819
830
|
// src/pcb/pcb_text.ts
|
|
820
|
-
import { z as
|
|
821
|
-
var pcb_text =
|
|
822
|
-
type:
|
|
831
|
+
import { z as z44 } from "zod";
|
|
832
|
+
var pcb_text = z44.object({
|
|
833
|
+
type: z44.literal("pcb_text"),
|
|
823
834
|
pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
|
|
824
|
-
text:
|
|
835
|
+
text: z44.string(),
|
|
825
836
|
center: point,
|
|
826
837
|
layer: layer_ref,
|
|
827
838
|
width: length,
|
|
828
839
|
height: length,
|
|
829
|
-
lines:
|
|
830
|
-
align:
|
|
840
|
+
lines: z44.number(),
|
|
841
|
+
align: z44.enum(["bottom-left"])
|
|
831
842
|
}).describe("Defines text on the PCB");
|
|
832
843
|
expectTypesMatch(true);
|
|
833
844
|
|
|
834
845
|
// src/pcb/pcb_trace.ts
|
|
835
|
-
import { z as
|
|
836
|
-
var pcb_trace_route_point_wire =
|
|
837
|
-
route_type:
|
|
846
|
+
import { z as z45 } from "zod";
|
|
847
|
+
var pcb_trace_route_point_wire = z45.object({
|
|
848
|
+
route_type: z45.literal("wire"),
|
|
838
849
|
x: distance,
|
|
839
850
|
y: distance,
|
|
840
851
|
width: distance,
|
|
841
|
-
start_pcb_port_id:
|
|
842
|
-
end_pcb_port_id:
|
|
852
|
+
start_pcb_port_id: z45.string().optional(),
|
|
853
|
+
end_pcb_port_id: z45.string().optional(),
|
|
843
854
|
layer: layer_ref
|
|
844
855
|
});
|
|
845
|
-
var pcb_trace_route_point_via =
|
|
846
|
-
route_type:
|
|
856
|
+
var pcb_trace_route_point_via = z45.object({
|
|
857
|
+
route_type: z45.literal("via"),
|
|
847
858
|
x: distance,
|
|
848
859
|
y: distance,
|
|
849
|
-
from_layer:
|
|
850
|
-
to_layer:
|
|
860
|
+
from_layer: z45.string(),
|
|
861
|
+
to_layer: z45.string()
|
|
851
862
|
});
|
|
852
|
-
var pcb_trace_route_point =
|
|
863
|
+
var pcb_trace_route_point = z45.union([
|
|
853
864
|
pcb_trace_route_point_wire,
|
|
854
865
|
pcb_trace_route_point_via
|
|
855
866
|
]);
|
|
856
|
-
var pcb_trace =
|
|
857
|
-
type:
|
|
858
|
-
source_trace_id:
|
|
859
|
-
pcb_component_id:
|
|
867
|
+
var pcb_trace = z45.object({
|
|
868
|
+
type: z45.literal("pcb_trace"),
|
|
869
|
+
source_trace_id: z45.string().optional(),
|
|
870
|
+
pcb_component_id: z45.string().optional(),
|
|
860
871
|
pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
|
|
861
|
-
route_thickness_mode:
|
|
862
|
-
route_order_index:
|
|
863
|
-
should_round_corners:
|
|
864
|
-
route:
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
route_type:
|
|
872
|
+
route_thickness_mode: z45.enum(["constant", "interpolated"]).default("constant").optional(),
|
|
873
|
+
route_order_index: z45.number().optional(),
|
|
874
|
+
should_round_corners: z45.boolean().optional(),
|
|
875
|
+
route: z45.array(
|
|
876
|
+
z45.union([
|
|
877
|
+
z45.object({
|
|
878
|
+
route_type: z45.literal("wire"),
|
|
868
879
|
x: distance,
|
|
869
880
|
y: distance,
|
|
870
881
|
width: distance,
|
|
871
|
-
start_pcb_port_id:
|
|
872
|
-
end_pcb_port_id:
|
|
882
|
+
start_pcb_port_id: z45.string().optional(),
|
|
883
|
+
end_pcb_port_id: z45.string().optional(),
|
|
873
884
|
layer: layer_ref
|
|
874
885
|
}),
|
|
875
|
-
|
|
876
|
-
route_type:
|
|
886
|
+
z45.object({
|
|
887
|
+
route_type: z45.literal("via"),
|
|
877
888
|
x: distance,
|
|
878
889
|
y: distance,
|
|
879
|
-
from_layer:
|
|
880
|
-
to_layer:
|
|
890
|
+
from_layer: z45.string(),
|
|
891
|
+
to_layer: z45.string()
|
|
881
892
|
})
|
|
882
893
|
])
|
|
883
894
|
)
|
|
@@ -886,34 +897,34 @@ expectTypesMatch(true);
|
|
|
886
897
|
expectTypesMatch(true);
|
|
887
898
|
|
|
888
899
|
// src/pcb/pcb_trace_error.ts
|
|
889
|
-
import { z as
|
|
890
|
-
var pcb_trace_error =
|
|
891
|
-
type:
|
|
900
|
+
import { z as z46 } from "zod";
|
|
901
|
+
var pcb_trace_error = z46.object({
|
|
902
|
+
type: z46.literal("pcb_trace_error"),
|
|
892
903
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
893
|
-
error_type:
|
|
894
|
-
message:
|
|
904
|
+
error_type: z46.literal("pcb_trace_error"),
|
|
905
|
+
message: z46.string(),
|
|
895
906
|
center: point.optional(),
|
|
896
|
-
pcb_trace_id:
|
|
897
|
-
source_trace_id:
|
|
898
|
-
pcb_component_ids:
|
|
899
|
-
pcb_port_ids:
|
|
907
|
+
pcb_trace_id: z46.string(),
|
|
908
|
+
source_trace_id: z46.string(),
|
|
909
|
+
pcb_component_ids: z46.array(z46.string()),
|
|
910
|
+
pcb_port_ids: z46.array(z46.string())
|
|
900
911
|
}).describe("Defines a trace error on the PCB");
|
|
901
912
|
expectTypesMatch(true);
|
|
902
913
|
|
|
903
914
|
// src/pcb/pcb_port_not_matched_error.ts
|
|
904
|
-
import { z as
|
|
905
|
-
var pcb_port_not_matched_error =
|
|
906
|
-
type:
|
|
915
|
+
import { z as z47 } from "zod";
|
|
916
|
+
var pcb_port_not_matched_error = z47.object({
|
|
917
|
+
type: z47.literal("pcb_port_not_matched_error"),
|
|
907
918
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
908
|
-
message:
|
|
909
|
-
pcb_component_ids:
|
|
919
|
+
message: z47.string(),
|
|
920
|
+
pcb_component_ids: z47.array(z47.string())
|
|
910
921
|
}).describe("Defines a trace error on the PCB where a port is not matched");
|
|
911
922
|
expectTypesMatch(true);
|
|
912
923
|
|
|
913
924
|
// src/pcb/pcb_via.ts
|
|
914
|
-
import { z as
|
|
915
|
-
var pcb_via =
|
|
916
|
-
type:
|
|
925
|
+
import { z as z48 } from "zod";
|
|
926
|
+
var pcb_via = z48.object({
|
|
927
|
+
type: z48.literal("pcb_via"),
|
|
917
928
|
pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
|
|
918
929
|
x: distance,
|
|
919
930
|
y: distance,
|
|
@@ -923,51 +934,51 @@ var pcb_via = z47.object({
|
|
|
923
934
|
from_layer: layer_ref.optional(),
|
|
924
935
|
/** @deprecated */
|
|
925
936
|
to_layer: layer_ref.optional(),
|
|
926
|
-
layers:
|
|
927
|
-
pcb_trace_id:
|
|
937
|
+
layers: z48.array(layer_ref),
|
|
938
|
+
pcb_trace_id: z48.string().optional()
|
|
928
939
|
}).describe("Defines a via on the PCB");
|
|
929
940
|
expectTypesMatch(true);
|
|
930
941
|
|
|
931
942
|
// src/pcb/pcb_board.ts
|
|
932
|
-
import { z as
|
|
933
|
-
var pcb_board =
|
|
934
|
-
type:
|
|
943
|
+
import { z as z49 } from "zod";
|
|
944
|
+
var pcb_board = z49.object({
|
|
945
|
+
type: z49.literal("pcb_board"),
|
|
935
946
|
pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
|
|
936
947
|
width: length,
|
|
937
948
|
height: length,
|
|
938
949
|
center: point,
|
|
939
950
|
thickness: length.optional().default(1.4),
|
|
940
|
-
num_layers:
|
|
941
|
-
outline:
|
|
951
|
+
num_layers: z49.number().optional().default(4),
|
|
952
|
+
outline: z49.array(point).optional()
|
|
942
953
|
}).describe("Defines the board outline of the PCB");
|
|
943
954
|
expectTypesMatch(true);
|
|
944
955
|
|
|
945
956
|
// src/pcb/pcb_placement_error.ts
|
|
946
|
-
import { z as
|
|
947
|
-
var pcb_placement_error =
|
|
948
|
-
type:
|
|
957
|
+
import { z as z50 } from "zod";
|
|
958
|
+
var pcb_placement_error = z50.object({
|
|
959
|
+
type: z50.literal("pcb_placement_error"),
|
|
949
960
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
950
|
-
message:
|
|
961
|
+
message: z50.string()
|
|
951
962
|
}).describe("Defines a placement error on the PCB");
|
|
952
963
|
expectTypesMatch(true);
|
|
953
964
|
|
|
954
965
|
// src/pcb/pcb_trace_hint.ts
|
|
955
|
-
import { z as
|
|
956
|
-
var pcb_trace_hint =
|
|
957
|
-
type:
|
|
966
|
+
import { z as z51 } from "zod";
|
|
967
|
+
var pcb_trace_hint = z51.object({
|
|
968
|
+
type: z51.literal("pcb_trace_hint"),
|
|
958
969
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
959
|
-
pcb_port_id:
|
|
960
|
-
pcb_component_id:
|
|
961
|
-
route:
|
|
970
|
+
pcb_port_id: z51.string(),
|
|
971
|
+
pcb_component_id: z51.string(),
|
|
972
|
+
route: z51.array(route_hint_point)
|
|
962
973
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
963
974
|
expectTypesMatch(true);
|
|
964
975
|
|
|
965
976
|
// src/pcb/pcb_silkscreen_line.ts
|
|
966
|
-
import { z as
|
|
967
|
-
var pcb_silkscreen_line =
|
|
968
|
-
type:
|
|
977
|
+
import { z as z52 } from "zod";
|
|
978
|
+
var pcb_silkscreen_line = z52.object({
|
|
979
|
+
type: z52.literal("pcb_silkscreen_line"),
|
|
969
980
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
970
|
-
pcb_component_id:
|
|
981
|
+
pcb_component_id: z52.string(),
|
|
971
982
|
stroke_width: distance.default("0.1mm"),
|
|
972
983
|
x1: distance,
|
|
973
984
|
y1: distance,
|
|
@@ -978,39 +989,39 @@ var pcb_silkscreen_line = z51.object({
|
|
|
978
989
|
expectTypesMatch(true);
|
|
979
990
|
|
|
980
991
|
// src/pcb/pcb_silkscreen_path.ts
|
|
981
|
-
import { z as
|
|
982
|
-
var pcb_silkscreen_path =
|
|
983
|
-
type:
|
|
992
|
+
import { z as z53 } from "zod";
|
|
993
|
+
var pcb_silkscreen_path = z53.object({
|
|
994
|
+
type: z53.literal("pcb_silkscreen_path"),
|
|
984
995
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
985
|
-
pcb_component_id:
|
|
996
|
+
pcb_component_id: z53.string(),
|
|
986
997
|
layer: visible_layer,
|
|
987
|
-
route:
|
|
998
|
+
route: z53.array(point),
|
|
988
999
|
stroke_width: length
|
|
989
1000
|
}).describe("Defines a silkscreen path on the PCB");
|
|
990
1001
|
expectTypesMatch(true);
|
|
991
1002
|
|
|
992
1003
|
// src/pcb/pcb_silkscreen_text.ts
|
|
993
|
-
import { z as
|
|
994
|
-
var pcb_silkscreen_text =
|
|
995
|
-
type:
|
|
1004
|
+
import { z as z54 } from "zod";
|
|
1005
|
+
var pcb_silkscreen_text = z54.object({
|
|
1006
|
+
type: z54.literal("pcb_silkscreen_text"),
|
|
996
1007
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
997
|
-
font:
|
|
1008
|
+
font: z54.literal("tscircuit2024").default("tscircuit2024"),
|
|
998
1009
|
font_size: distance.default("0.2mm"),
|
|
999
|
-
pcb_component_id:
|
|
1000
|
-
text:
|
|
1010
|
+
pcb_component_id: z54.string(),
|
|
1011
|
+
text: z54.string(),
|
|
1001
1012
|
layer: layer_ref,
|
|
1002
|
-
is_mirrored:
|
|
1013
|
+
is_mirrored: z54.boolean().default(false).optional(),
|
|
1003
1014
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1004
|
-
anchor_alignment:
|
|
1015
|
+
anchor_alignment: z54.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
|
|
1005
1016
|
}).describe("Defines silkscreen text on the PCB");
|
|
1006
1017
|
expectTypesMatch(true);
|
|
1007
1018
|
|
|
1008
1019
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
1009
|
-
import { z as
|
|
1010
|
-
var pcb_silkscreen_rect =
|
|
1011
|
-
type:
|
|
1020
|
+
import { z as z55 } from "zod";
|
|
1021
|
+
var pcb_silkscreen_rect = z55.object({
|
|
1022
|
+
type: z55.literal("pcb_silkscreen_rect"),
|
|
1012
1023
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
1013
|
-
pcb_component_id:
|
|
1024
|
+
pcb_component_id: z55.string(),
|
|
1014
1025
|
center: point,
|
|
1015
1026
|
width: length,
|
|
1016
1027
|
height: length,
|
|
@@ -1019,13 +1030,13 @@ var pcb_silkscreen_rect = z54.object({
|
|
|
1019
1030
|
expectTypesMatch(true);
|
|
1020
1031
|
|
|
1021
1032
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
1022
|
-
import { z as
|
|
1023
|
-
var pcb_silkscreen_circle =
|
|
1024
|
-
type:
|
|
1033
|
+
import { z as z56 } from "zod";
|
|
1034
|
+
var pcb_silkscreen_circle = z56.object({
|
|
1035
|
+
type: z56.literal("pcb_silkscreen_circle"),
|
|
1025
1036
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
1026
1037
|
"pcb_silkscreen_circle"
|
|
1027
1038
|
),
|
|
1028
|
-
pcb_component_id:
|
|
1039
|
+
pcb_component_id: z56.string(),
|
|
1029
1040
|
center: point,
|
|
1030
1041
|
radius: length,
|
|
1031
1042
|
layer: visible_layer
|
|
@@ -1033,11 +1044,11 @@ var pcb_silkscreen_circle = z55.object({
|
|
|
1033
1044
|
expectTypesMatch(true);
|
|
1034
1045
|
|
|
1035
1046
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
1036
|
-
import { z as
|
|
1037
|
-
var pcb_silkscreen_oval =
|
|
1038
|
-
type:
|
|
1047
|
+
import { z as z57 } from "zod";
|
|
1048
|
+
var pcb_silkscreen_oval = z57.object({
|
|
1049
|
+
type: z57.literal("pcb_silkscreen_oval"),
|
|
1039
1050
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
1040
|
-
pcb_component_id:
|
|
1051
|
+
pcb_component_id: z57.string(),
|
|
1041
1052
|
center: point,
|
|
1042
1053
|
radius_x: distance,
|
|
1043
1054
|
radius_y: distance,
|
|
@@ -1046,106 +1057,106 @@ var pcb_silkscreen_oval = z56.object({
|
|
|
1046
1057
|
expectTypesMatch(true);
|
|
1047
1058
|
|
|
1048
1059
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
1049
|
-
import { z as
|
|
1050
|
-
var pcb_fabrication_note_text =
|
|
1051
|
-
type:
|
|
1060
|
+
import { z as z58 } from "zod";
|
|
1061
|
+
var pcb_fabrication_note_text = z58.object({
|
|
1062
|
+
type: z58.literal("pcb_fabrication_note_text"),
|
|
1052
1063
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
1053
1064
|
"pcb_fabrication_note_text"
|
|
1054
1065
|
),
|
|
1055
|
-
font:
|
|
1066
|
+
font: z58.literal("tscircuit2024").default("tscircuit2024"),
|
|
1056
1067
|
font_size: distance.default("1mm"),
|
|
1057
|
-
pcb_component_id:
|
|
1058
|
-
text:
|
|
1068
|
+
pcb_component_id: z58.string(),
|
|
1069
|
+
text: z58.string(),
|
|
1059
1070
|
layer: visible_layer,
|
|
1060
1071
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1061
|
-
anchor_alignment:
|
|
1062
|
-
color:
|
|
1072
|
+
anchor_alignment: z58.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1073
|
+
color: z58.string().optional()
|
|
1063
1074
|
}).describe(
|
|
1064
1075
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
1065
1076
|
);
|
|
1066
1077
|
expectTypesMatch(true);
|
|
1067
1078
|
|
|
1068
1079
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
1069
|
-
import { z as
|
|
1070
|
-
var pcb_fabrication_note_path =
|
|
1071
|
-
type:
|
|
1080
|
+
import { z as z59 } from "zod";
|
|
1081
|
+
var pcb_fabrication_note_path = z59.object({
|
|
1082
|
+
type: z59.literal("pcb_fabrication_note_path"),
|
|
1072
1083
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
1073
1084
|
"pcb_fabrication_note_path"
|
|
1074
1085
|
),
|
|
1075
|
-
pcb_component_id:
|
|
1086
|
+
pcb_component_id: z59.string(),
|
|
1076
1087
|
layer: layer_ref,
|
|
1077
|
-
route:
|
|
1088
|
+
route: z59.array(point),
|
|
1078
1089
|
stroke_width: length,
|
|
1079
|
-
color:
|
|
1090
|
+
color: z59.string().optional()
|
|
1080
1091
|
}).describe(
|
|
1081
1092
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
1082
1093
|
);
|
|
1083
1094
|
expectTypesMatch(true);
|
|
1084
1095
|
|
|
1085
1096
|
// src/pcb/pcb_keepout.ts
|
|
1086
|
-
import { z as
|
|
1087
|
-
var pcb_keepout =
|
|
1088
|
-
type:
|
|
1089
|
-
shape:
|
|
1097
|
+
import { z as z60 } from "zod";
|
|
1098
|
+
var pcb_keepout = z60.object({
|
|
1099
|
+
type: z60.literal("pcb_keepout"),
|
|
1100
|
+
shape: z60.literal("rect"),
|
|
1090
1101
|
center: point,
|
|
1091
1102
|
width: distance,
|
|
1092
1103
|
height: distance,
|
|
1093
|
-
pcb_keepout_id:
|
|
1094
|
-
layers:
|
|
1104
|
+
pcb_keepout_id: z60.string(),
|
|
1105
|
+
layers: z60.array(z60.string()),
|
|
1095
1106
|
// Specify layers where the keepout applies
|
|
1096
|
-
description:
|
|
1107
|
+
description: z60.string().optional()
|
|
1097
1108
|
// Optional description of the keepout
|
|
1098
1109
|
}).or(
|
|
1099
|
-
|
|
1100
|
-
type:
|
|
1101
|
-
shape:
|
|
1110
|
+
z60.object({
|
|
1111
|
+
type: z60.literal("pcb_keepout"),
|
|
1112
|
+
shape: z60.literal("circle"),
|
|
1102
1113
|
center: point,
|
|
1103
1114
|
radius: distance,
|
|
1104
|
-
pcb_keepout_id:
|
|
1105
|
-
layers:
|
|
1115
|
+
pcb_keepout_id: z60.string(),
|
|
1116
|
+
layers: z60.array(z60.string()),
|
|
1106
1117
|
// Specify layers where the keepout applies
|
|
1107
|
-
description:
|
|
1118
|
+
description: z60.string().optional()
|
|
1108
1119
|
// Optional description of the keepout
|
|
1109
1120
|
})
|
|
1110
1121
|
);
|
|
1111
1122
|
|
|
1112
1123
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
1113
|
-
import { z as
|
|
1114
|
-
var pcb_missing_footprint_error =
|
|
1115
|
-
type:
|
|
1124
|
+
import { z as z61 } from "zod";
|
|
1125
|
+
var pcb_missing_footprint_error = z61.object({
|
|
1126
|
+
type: z61.literal("pcb_missing_footprint_error"),
|
|
1116
1127
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
1117
1128
|
"pcb_missing_footprint_error"
|
|
1118
1129
|
),
|
|
1119
|
-
error_type:
|
|
1120
|
-
source_component_id:
|
|
1121
|
-
message:
|
|
1130
|
+
error_type: z61.literal("pcb_missing_footprint_error"),
|
|
1131
|
+
source_component_id: z61.string(),
|
|
1132
|
+
message: z61.string()
|
|
1122
1133
|
}).describe("Defines a missing footprint error on the PCB");
|
|
1123
1134
|
expectTypesMatch(
|
|
1124
1135
|
true
|
|
1125
1136
|
);
|
|
1126
1137
|
|
|
1127
1138
|
// src/cad/cad_component.ts
|
|
1128
|
-
import { z as
|
|
1129
|
-
var cad_component =
|
|
1130
|
-
type:
|
|
1131
|
-
cad_component_id:
|
|
1132
|
-
pcb_component_id:
|
|
1133
|
-
source_component_id:
|
|
1139
|
+
import { z as z62 } from "zod";
|
|
1140
|
+
var cad_component = z62.object({
|
|
1141
|
+
type: z62.literal("cad_component"),
|
|
1142
|
+
cad_component_id: z62.string(),
|
|
1143
|
+
pcb_component_id: z62.string(),
|
|
1144
|
+
source_component_id: z62.string(),
|
|
1134
1145
|
position: point3,
|
|
1135
1146
|
rotation: point3.optional(),
|
|
1136
1147
|
size: point3.optional(),
|
|
1137
1148
|
layer: layer_ref.optional(),
|
|
1138
1149
|
// These are all ways to generate/load the 3d model
|
|
1139
|
-
footprinter_string:
|
|
1140
|
-
model_obj_url:
|
|
1141
|
-
model_stl_url:
|
|
1142
|
-
model_3mf_url:
|
|
1143
|
-
model_jscad:
|
|
1150
|
+
footprinter_string: z62.string().optional(),
|
|
1151
|
+
model_obj_url: z62.string().optional(),
|
|
1152
|
+
model_stl_url: z62.string().optional(),
|
|
1153
|
+
model_3mf_url: z62.string().optional(),
|
|
1154
|
+
model_jscad: z62.any().optional()
|
|
1144
1155
|
}).describe("Defines a component on the PCB");
|
|
1145
1156
|
|
|
1146
1157
|
// src/any_circuit_element.ts
|
|
1147
|
-
import { z as
|
|
1148
|
-
var any_circuit_element =
|
|
1158
|
+
import { z as z63 } from "zod";
|
|
1159
|
+
var any_circuit_element = z63.union([
|
|
1149
1160
|
source_trace,
|
|
1150
1161
|
source_port,
|
|
1151
1162
|
any_source_component,
|
|
@@ -1282,6 +1293,7 @@ export {
|
|
|
1282
1293
|
source_simple_diode,
|
|
1283
1294
|
source_simple_ground,
|
|
1284
1295
|
source_simple_inductor,
|
|
1296
|
+
source_simple_potentiometer,
|
|
1285
1297
|
source_simple_power_source,
|
|
1286
1298
|
source_simple_push_button,
|
|
1287
1299
|
source_simple_resistor,
|