circuit-json 0.0.119 → 0.0.121
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/README.md +16 -0
- package/dist/index.d.mts +223 -7
- package/dist/index.mjs +412 -394
- package/dist/index.mjs.map +1 -1
- package/package.json +8 -4
package/dist/index.mjs
CHANGED
|
@@ -349,7 +349,7 @@ var source_simple_power_source = source_component_base.extend({
|
|
|
349
349
|
expectTypesMatch(true);
|
|
350
350
|
|
|
351
351
|
// src/source/any_source_component.ts
|
|
352
|
-
import { z as
|
|
352
|
+
import { z as z23 } from "zod";
|
|
353
353
|
|
|
354
354
|
// src/source/source_simple_battery.ts
|
|
355
355
|
import { z as z16 } from "zod";
|
|
@@ -398,8 +398,18 @@ var source_simple_pin_header = source_component_base.extend({
|
|
|
398
398
|
gender: z21.enum(["male", "female"]).optional().default("male")
|
|
399
399
|
});
|
|
400
400
|
|
|
401
|
+
// src/source/source_simple_resonator.ts
|
|
402
|
+
import { z as z22 } from "zod";
|
|
403
|
+
var source_simple_resonator = source_component_base.extend({
|
|
404
|
+
ftype: z22.literal("simple_resonator"),
|
|
405
|
+
load_capacitance: capacitance,
|
|
406
|
+
equivalent_series_resistance: resistance.optional(),
|
|
407
|
+
frequency
|
|
408
|
+
});
|
|
409
|
+
expectTypesMatch(true);
|
|
410
|
+
|
|
401
411
|
// src/source/any_source_component.ts
|
|
402
|
-
var any_source_component =
|
|
412
|
+
var any_source_component = z23.union([
|
|
403
413
|
source_simple_resistor,
|
|
404
414
|
source_simple_capacitor,
|
|
405
415
|
source_simple_diode,
|
|
@@ -413,59 +423,60 @@ var any_source_component = z22.union([
|
|
|
413
423
|
source_simple_push_button,
|
|
414
424
|
source_simple_potentiometer,
|
|
415
425
|
source_simple_crystal,
|
|
416
|
-
source_simple_pin_header
|
|
426
|
+
source_simple_pin_header,
|
|
427
|
+
source_simple_resonator
|
|
417
428
|
]);
|
|
418
429
|
|
|
419
430
|
// src/source/source_port.ts
|
|
420
|
-
import { z as
|
|
421
|
-
var source_port =
|
|
422
|
-
type:
|
|
423
|
-
pin_number:
|
|
424
|
-
port_hints:
|
|
425
|
-
name:
|
|
426
|
-
source_port_id:
|
|
427
|
-
source_component_id:
|
|
431
|
+
import { z as z24 } from "zod";
|
|
432
|
+
var source_port = z24.object({
|
|
433
|
+
type: z24.literal("source_port"),
|
|
434
|
+
pin_number: z24.number().optional(),
|
|
435
|
+
port_hints: z24.array(z24.string()).optional(),
|
|
436
|
+
name: z24.string(),
|
|
437
|
+
source_port_id: z24.string(),
|
|
438
|
+
source_component_id: z24.string()
|
|
428
439
|
});
|
|
429
440
|
expectTypesMatch(true);
|
|
430
441
|
|
|
431
442
|
// src/source/source_trace.ts
|
|
432
|
-
import { z as
|
|
433
|
-
var source_trace =
|
|
434
|
-
type:
|
|
435
|
-
source_trace_id:
|
|
436
|
-
connected_source_port_ids:
|
|
437
|
-
connected_source_net_ids:
|
|
438
|
-
subcircuit_connectivity_map_key:
|
|
443
|
+
import { z as z25 } from "zod";
|
|
444
|
+
var source_trace = z25.object({
|
|
445
|
+
type: z25.literal("source_trace"),
|
|
446
|
+
source_trace_id: z25.string(),
|
|
447
|
+
connected_source_port_ids: z25.array(z25.string()),
|
|
448
|
+
connected_source_net_ids: z25.array(z25.string()),
|
|
449
|
+
subcircuit_connectivity_map_key: z25.string().optional()
|
|
439
450
|
});
|
|
440
451
|
expectTypesMatch(true);
|
|
441
452
|
|
|
442
453
|
// src/source/source_group.ts
|
|
443
|
-
import { z as
|
|
444
|
-
var source_group =
|
|
445
|
-
type:
|
|
446
|
-
source_group_id:
|
|
447
|
-
name:
|
|
454
|
+
import { z as z26 } from "zod";
|
|
455
|
+
var source_group = z26.object({
|
|
456
|
+
type: z26.literal("source_group"),
|
|
457
|
+
source_group_id: z26.string(),
|
|
458
|
+
name: z26.string().optional()
|
|
448
459
|
});
|
|
449
460
|
|
|
450
461
|
// src/source/source_net.ts
|
|
451
|
-
import { z as
|
|
452
|
-
var source_net =
|
|
453
|
-
type:
|
|
454
|
-
source_net_id:
|
|
455
|
-
name:
|
|
456
|
-
member_source_group_ids:
|
|
457
|
-
is_power:
|
|
458
|
-
is_ground:
|
|
459
|
-
is_digital_signal:
|
|
460
|
-
is_analog_signal:
|
|
461
|
-
trace_width:
|
|
462
|
+
import { z as z27 } from "zod";
|
|
463
|
+
var source_net = z27.object({
|
|
464
|
+
type: z27.literal("source_net"),
|
|
465
|
+
source_net_id: z27.string(),
|
|
466
|
+
name: z27.string(),
|
|
467
|
+
member_source_group_ids: z27.array(z27.string()),
|
|
468
|
+
is_power: z27.boolean().optional(),
|
|
469
|
+
is_ground: z27.boolean().optional(),
|
|
470
|
+
is_digital_signal: z27.boolean().optional(),
|
|
471
|
+
is_analog_signal: z27.boolean().optional(),
|
|
472
|
+
trace_width: z27.number().optional()
|
|
462
473
|
});
|
|
463
474
|
|
|
464
475
|
// src/schematic/schematic_box.ts
|
|
465
|
-
import { z as
|
|
466
|
-
var schematic_box =
|
|
467
|
-
type:
|
|
468
|
-
schematic_component_id:
|
|
476
|
+
import { z as z28 } from "zod";
|
|
477
|
+
var schematic_box = z28.object({
|
|
478
|
+
type: z28.literal("schematic_box"),
|
|
479
|
+
schematic_component_id: z28.string(),
|
|
469
480
|
width: distance,
|
|
470
481
|
height: distance,
|
|
471
482
|
x: distance,
|
|
@@ -474,78 +485,82 @@ var schematic_box = z27.object({
|
|
|
474
485
|
expectTypesMatch(true);
|
|
475
486
|
|
|
476
487
|
// src/schematic/schematic_path.ts
|
|
477
|
-
import { z as
|
|
478
|
-
var schematic_path =
|
|
479
|
-
type:
|
|
480
|
-
schematic_component_id:
|
|
481
|
-
fill_color:
|
|
482
|
-
is_filled:
|
|
483
|
-
points:
|
|
488
|
+
import { z as z29 } from "zod";
|
|
489
|
+
var schematic_path = z29.object({
|
|
490
|
+
type: z29.literal("schematic_path"),
|
|
491
|
+
schematic_component_id: z29.string(),
|
|
492
|
+
fill_color: z29.enum(["red", "blue"]).optional(),
|
|
493
|
+
is_filled: z29.boolean().optional(),
|
|
494
|
+
points: z29.array(point)
|
|
484
495
|
});
|
|
485
496
|
expectTypesMatch(true);
|
|
486
497
|
|
|
487
498
|
// src/schematic/schematic_component.ts
|
|
488
|
-
import { z as
|
|
489
|
-
var schematic_pin_styles =
|
|
490
|
-
|
|
499
|
+
import { z as z30 } from "zod";
|
|
500
|
+
var schematic_pin_styles = z30.record(
|
|
501
|
+
z30.object({
|
|
491
502
|
left_margin: length.optional(),
|
|
492
503
|
right_margin: length.optional(),
|
|
493
504
|
top_margin: length.optional(),
|
|
494
505
|
bottom_margin: length.optional()
|
|
495
506
|
})
|
|
496
507
|
);
|
|
497
|
-
var schematic_component_port_arrangement_by_size =
|
|
498
|
-
left_size:
|
|
499
|
-
right_size:
|
|
500
|
-
top_size:
|
|
501
|
-
bottom_size:
|
|
508
|
+
var schematic_component_port_arrangement_by_size = z30.object({
|
|
509
|
+
left_size: z30.number(),
|
|
510
|
+
right_size: z30.number(),
|
|
511
|
+
top_size: z30.number().optional(),
|
|
512
|
+
bottom_size: z30.number().optional()
|
|
502
513
|
});
|
|
503
514
|
expectTypesMatch(true);
|
|
504
|
-
var schematic_component_port_arrangement_by_sides =
|
|
505
|
-
left_side:
|
|
506
|
-
pins:
|
|
507
|
-
|
|
515
|
+
var schematic_component_port_arrangement_by_sides = z30.object({
|
|
516
|
+
left_side: z30.object({
|
|
517
|
+
pins: z30.array(z30.number()),
|
|
518
|
+
// @ts-ignore
|
|
519
|
+
direction: z30.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
508
520
|
}).optional(),
|
|
509
|
-
right_side:
|
|
510
|
-
pins:
|
|
511
|
-
|
|
521
|
+
right_side: z30.object({
|
|
522
|
+
pins: z30.array(z30.number()),
|
|
523
|
+
// @ts-ignore
|
|
524
|
+
direction: z30.enum(["top-to-bottom", "bottom-to-top"]).optional()
|
|
512
525
|
}).optional(),
|
|
513
|
-
top_side:
|
|
514
|
-
pins:
|
|
515
|
-
|
|
526
|
+
top_side: z30.object({
|
|
527
|
+
pins: z30.array(z30.number()),
|
|
528
|
+
// @ts-ignore
|
|
529
|
+
direction: z30.enum(["left-to-right", "right-to-left"]).optional()
|
|
516
530
|
}).optional(),
|
|
517
|
-
bottom_side:
|
|
518
|
-
pins:
|
|
519
|
-
|
|
531
|
+
bottom_side: z30.object({
|
|
532
|
+
pins: z30.array(z30.number()),
|
|
533
|
+
// @ts-ignore
|
|
534
|
+
direction: z30.enum(["left-to-right", "right-to-left"]).optional()
|
|
520
535
|
}).optional()
|
|
521
536
|
});
|
|
522
537
|
expectTypesMatch(true);
|
|
523
|
-
var port_arrangement =
|
|
538
|
+
var port_arrangement = z30.union([
|
|
524
539
|
schematic_component_port_arrangement_by_size,
|
|
525
540
|
schematic_component_port_arrangement_by_sides
|
|
526
541
|
]);
|
|
527
|
-
var schematic_component =
|
|
528
|
-
type:
|
|
542
|
+
var schematic_component = z30.object({
|
|
543
|
+
type: z30.literal("schematic_component"),
|
|
529
544
|
rotation: rotation.default(0),
|
|
530
545
|
size,
|
|
531
546
|
center: point,
|
|
532
|
-
source_component_id:
|
|
533
|
-
schematic_component_id:
|
|
547
|
+
source_component_id: z30.string(),
|
|
548
|
+
schematic_component_id: z30.string(),
|
|
534
549
|
pin_spacing: length.optional(),
|
|
535
550
|
pin_styles: schematic_pin_styles.optional(),
|
|
536
551
|
box_width: length.optional(),
|
|
537
|
-
symbol_name:
|
|
552
|
+
symbol_name: z30.string().optional(),
|
|
538
553
|
port_arrangement: port_arrangement.optional(),
|
|
539
|
-
port_labels:
|
|
540
|
-
symbol_display_value:
|
|
554
|
+
port_labels: z30.record(z30.string()).optional(),
|
|
555
|
+
symbol_display_value: z30.string().optional()
|
|
541
556
|
});
|
|
542
557
|
expectTypesMatch(true);
|
|
543
558
|
|
|
544
559
|
// src/schematic/schematic_line.ts
|
|
545
|
-
import { z as
|
|
546
|
-
var schematic_line =
|
|
547
|
-
type:
|
|
548
|
-
schematic_component_id:
|
|
560
|
+
import { z as z31 } from "zod";
|
|
561
|
+
var schematic_line = z31.object({
|
|
562
|
+
type: z31.literal("schematic_line"),
|
|
563
|
+
schematic_component_id: z31.string(),
|
|
549
564
|
x1: distance,
|
|
550
565
|
x2: distance,
|
|
551
566
|
y1: distance,
|
|
@@ -554,113 +569,113 @@ var schematic_line = z30.object({
|
|
|
554
569
|
expectTypesMatch(true);
|
|
555
570
|
|
|
556
571
|
// src/schematic/schematic_trace.ts
|
|
557
|
-
import { z as
|
|
558
|
-
var schematic_trace =
|
|
559
|
-
type:
|
|
560
|
-
schematic_trace_id:
|
|
561
|
-
source_trace_id:
|
|
562
|
-
junctions:
|
|
563
|
-
|
|
564
|
-
x:
|
|
565
|
-
y:
|
|
572
|
+
import { z as z32 } from "zod";
|
|
573
|
+
var schematic_trace = z32.object({
|
|
574
|
+
type: z32.literal("schematic_trace"),
|
|
575
|
+
schematic_trace_id: z32.string(),
|
|
576
|
+
source_trace_id: z32.string(),
|
|
577
|
+
junctions: z32.array(
|
|
578
|
+
z32.object({
|
|
579
|
+
x: z32.number(),
|
|
580
|
+
y: z32.number()
|
|
566
581
|
})
|
|
567
582
|
),
|
|
568
|
-
edges:
|
|
569
|
-
|
|
570
|
-
from:
|
|
571
|
-
x:
|
|
572
|
-
y:
|
|
583
|
+
edges: z32.array(
|
|
584
|
+
z32.object({
|
|
585
|
+
from: z32.object({
|
|
586
|
+
x: z32.number(),
|
|
587
|
+
y: z32.number()
|
|
573
588
|
}),
|
|
574
|
-
to:
|
|
575
|
-
x:
|
|
576
|
-
y:
|
|
589
|
+
to: z32.object({
|
|
590
|
+
x: z32.number(),
|
|
591
|
+
y: z32.number()
|
|
577
592
|
}),
|
|
578
|
-
is_crossing:
|
|
579
|
-
from_schematic_port_id:
|
|
580
|
-
to_schematic_port_id:
|
|
593
|
+
is_crossing: z32.boolean().optional(),
|
|
594
|
+
from_schematic_port_id: z32.string().optional(),
|
|
595
|
+
to_schematic_port_id: z32.string().optional()
|
|
581
596
|
})
|
|
582
597
|
)
|
|
583
598
|
});
|
|
584
599
|
expectTypesMatch(true);
|
|
585
600
|
|
|
586
601
|
// src/schematic/schematic_text.ts
|
|
587
|
-
import { z as
|
|
588
|
-
var schematic_text =
|
|
589
|
-
type:
|
|
590
|
-
schematic_component_id:
|
|
591
|
-
schematic_text_id:
|
|
592
|
-
text:
|
|
593
|
-
position:
|
|
602
|
+
import { z as z33 } from "zod";
|
|
603
|
+
var schematic_text = z33.object({
|
|
604
|
+
type: z33.literal("schematic_text"),
|
|
605
|
+
schematic_component_id: z33.string(),
|
|
606
|
+
schematic_text_id: z33.string(),
|
|
607
|
+
text: z33.string(),
|
|
608
|
+
position: z33.object({
|
|
594
609
|
x: distance,
|
|
595
610
|
y: distance
|
|
596
611
|
}),
|
|
597
|
-
rotation:
|
|
598
|
-
anchor:
|
|
599
|
-
color:
|
|
612
|
+
rotation: z33.number().default(0),
|
|
613
|
+
anchor: z33.enum(["center", "left", "right", "top", "bottom"]).default("center"),
|
|
614
|
+
color: z33.string().default("#000000")
|
|
600
615
|
});
|
|
601
616
|
expectTypesMatch(true);
|
|
602
617
|
|
|
603
618
|
// src/schematic/schematic_port.ts
|
|
604
|
-
import { z as
|
|
605
|
-
var schematic_port =
|
|
606
|
-
type:
|
|
607
|
-
schematic_port_id:
|
|
608
|
-
source_port_id:
|
|
609
|
-
schematic_component_id:
|
|
619
|
+
import { z as z34 } from "zod";
|
|
620
|
+
var schematic_port = z34.object({
|
|
621
|
+
type: z34.literal("schematic_port"),
|
|
622
|
+
schematic_port_id: z34.string(),
|
|
623
|
+
source_port_id: z34.string(),
|
|
624
|
+
schematic_component_id: z34.string().optional(),
|
|
610
625
|
center: point,
|
|
611
|
-
facing_direction:
|
|
612
|
-
distance_from_component_edge:
|
|
613
|
-
side_of_component:
|
|
614
|
-
true_ccw_index:
|
|
615
|
-
pin_number:
|
|
616
|
-
display_pin_label:
|
|
626
|
+
facing_direction: z34.enum(["up", "down", "left", "right"]).optional(),
|
|
627
|
+
distance_from_component_edge: z34.number().optional(),
|
|
628
|
+
side_of_component: z34.enum(["top", "bottom", "left", "right"]).optional(),
|
|
629
|
+
true_ccw_index: z34.number().optional(),
|
|
630
|
+
pin_number: z34.number().optional(),
|
|
631
|
+
display_pin_label: z34.string().optional()
|
|
617
632
|
}).describe("Defines a port on a schematic component");
|
|
618
633
|
expectTypesMatch(true);
|
|
619
634
|
|
|
620
635
|
// src/schematic/schematic_net_label.ts
|
|
621
|
-
import { z as
|
|
622
|
-
var schematic_net_label =
|
|
623
|
-
type:
|
|
624
|
-
source_net_id:
|
|
636
|
+
import { z as z35 } from "zod";
|
|
637
|
+
var schematic_net_label = z35.object({
|
|
638
|
+
type: z35.literal("schematic_net_label"),
|
|
639
|
+
source_net_id: z35.string(),
|
|
625
640
|
center: point,
|
|
626
641
|
anchor_position: point.optional(),
|
|
627
|
-
anchor_side:
|
|
628
|
-
text:
|
|
629
|
-
symbol_name:
|
|
642
|
+
anchor_side: z35.enum(["top", "bottom", "left", "right"]),
|
|
643
|
+
text: z35.string(),
|
|
644
|
+
symbol_name: z35.string().optional()
|
|
630
645
|
});
|
|
631
646
|
|
|
632
647
|
// src/schematic/schematic_error.ts
|
|
633
|
-
import { z as
|
|
634
|
-
var schematic_error =
|
|
635
|
-
type:
|
|
636
|
-
schematic_error_id:
|
|
648
|
+
import { z as z36 } from "zod";
|
|
649
|
+
var schematic_error = z36.object({
|
|
650
|
+
type: z36.literal("schematic_error"),
|
|
651
|
+
schematic_error_id: z36.string(),
|
|
637
652
|
// eventually each error type should be broken out into a dir of files
|
|
638
|
-
error_type:
|
|
639
|
-
message:
|
|
653
|
+
error_type: z36.literal("schematic_port_not_found"),
|
|
654
|
+
message: z36.string()
|
|
640
655
|
}).describe("Defines a schematic error on the schematic");
|
|
641
656
|
expectTypesMatch(true);
|
|
642
657
|
|
|
643
658
|
// src/schematic/schematic_debug_object.ts
|
|
644
|
-
import { z as
|
|
645
|
-
var schematic_debug_object_base =
|
|
646
|
-
type:
|
|
647
|
-
label:
|
|
659
|
+
import { z as z37 } from "zod";
|
|
660
|
+
var schematic_debug_object_base = z37.object({
|
|
661
|
+
type: z37.literal("schematic_debug_object"),
|
|
662
|
+
label: z37.string().optional()
|
|
648
663
|
});
|
|
649
664
|
var schematic_debug_rect = schematic_debug_object_base.extend({
|
|
650
|
-
shape:
|
|
665
|
+
shape: z37.literal("rect"),
|
|
651
666
|
center: point,
|
|
652
667
|
size
|
|
653
668
|
});
|
|
654
669
|
var schematic_debug_line = schematic_debug_object_base.extend({
|
|
655
|
-
shape:
|
|
670
|
+
shape: z37.literal("line"),
|
|
656
671
|
start: point,
|
|
657
672
|
end: point
|
|
658
673
|
});
|
|
659
674
|
var schematic_debug_point = schematic_debug_object_base.extend({
|
|
660
|
-
shape:
|
|
675
|
+
shape: z37.literal("point"),
|
|
661
676
|
center: point
|
|
662
677
|
});
|
|
663
|
-
var schematic_debug_object =
|
|
678
|
+
var schematic_debug_object = z37.discriminatedUnion("shape", [
|
|
664
679
|
schematic_debug_rect,
|
|
665
680
|
schematic_debug_line,
|
|
666
681
|
schematic_debug_point
|
|
@@ -668,18 +683,18 @@ var schematic_debug_object = z36.discriminatedUnion("shape", [
|
|
|
668
683
|
expectTypesMatch(true);
|
|
669
684
|
|
|
670
685
|
// src/schematic/schematic_voltage_probe.ts
|
|
671
|
-
import { z as
|
|
672
|
-
var schematic_voltage_probe =
|
|
673
|
-
type:
|
|
674
|
-
schematic_voltage_probe_id:
|
|
686
|
+
import { z as z38 } from "zod";
|
|
687
|
+
var schematic_voltage_probe = z38.object({
|
|
688
|
+
type: z38.literal("schematic_voltage_probe"),
|
|
689
|
+
schematic_voltage_probe_id: z38.string(),
|
|
675
690
|
position: point,
|
|
676
|
-
schematic_trace_id:
|
|
691
|
+
schematic_trace_id: z38.string(),
|
|
677
692
|
voltage: voltage.optional()
|
|
678
693
|
}).describe("Defines a voltage probe measurement point on a schematic trace");
|
|
679
694
|
expectTypesMatch(true);
|
|
680
695
|
|
|
681
696
|
// src/pcb/properties/layer_ref.ts
|
|
682
|
-
import { z as
|
|
697
|
+
import { z as z39 } from "zod";
|
|
683
698
|
var all_layers = [
|
|
684
699
|
"top",
|
|
685
700
|
"bottom",
|
|
@@ -690,9 +705,9 @@ var all_layers = [
|
|
|
690
705
|
"inner5",
|
|
691
706
|
"inner6"
|
|
692
707
|
];
|
|
693
|
-
var layer_string =
|
|
708
|
+
var layer_string = z39.enum(all_layers);
|
|
694
709
|
var layer_ref = layer_string.or(
|
|
695
|
-
|
|
710
|
+
z39.object({
|
|
696
711
|
name: layer_string
|
|
697
712
|
})
|
|
698
713
|
).transform((layer) => {
|
|
@@ -701,34 +716,34 @@ var layer_ref = layer_string.or(
|
|
|
701
716
|
}
|
|
702
717
|
return layer.name;
|
|
703
718
|
});
|
|
704
|
-
var visible_layer =
|
|
719
|
+
var visible_layer = z39.enum(["top", "bottom"]);
|
|
705
720
|
|
|
706
721
|
// src/pcb/properties/pcb_route_hints.ts
|
|
707
|
-
import { z as
|
|
708
|
-
var pcb_route_hint =
|
|
722
|
+
import { z as z40 } from "zod";
|
|
723
|
+
var pcb_route_hint = z40.object({
|
|
709
724
|
x: distance,
|
|
710
725
|
y: distance,
|
|
711
|
-
via:
|
|
726
|
+
via: z40.boolean().optional(),
|
|
712
727
|
via_to_layer: layer_ref.optional()
|
|
713
728
|
});
|
|
714
|
-
var pcb_route_hints =
|
|
729
|
+
var pcb_route_hints = z40.array(pcb_route_hint);
|
|
715
730
|
|
|
716
731
|
// src/pcb/properties/route_hint_point.ts
|
|
717
|
-
import { z as
|
|
718
|
-
var route_hint_point =
|
|
732
|
+
import { z as z41 } from "zod";
|
|
733
|
+
var route_hint_point = z41.object({
|
|
719
734
|
x: distance,
|
|
720
735
|
y: distance,
|
|
721
|
-
via:
|
|
736
|
+
via: z41.boolean().optional(),
|
|
722
737
|
to_layer: layer_ref.optional(),
|
|
723
738
|
trace_width: distance.optional()
|
|
724
739
|
});
|
|
725
740
|
|
|
726
741
|
// src/pcb/pcb_component.ts
|
|
727
|
-
import { z as
|
|
728
|
-
var pcb_component =
|
|
729
|
-
type:
|
|
742
|
+
import { z as z42 } from "zod";
|
|
743
|
+
var pcb_component = z42.object({
|
|
744
|
+
type: z42.literal("pcb_component"),
|
|
730
745
|
pcb_component_id: getZodPrefixedIdWithDefault("pcb_component"),
|
|
731
|
-
source_component_id:
|
|
746
|
+
source_component_id: z42.string(),
|
|
732
747
|
center: point,
|
|
733
748
|
layer: layer_ref,
|
|
734
749
|
rotation,
|
|
@@ -738,12 +753,12 @@ var pcb_component = z41.object({
|
|
|
738
753
|
expectTypesMatch(true);
|
|
739
754
|
|
|
740
755
|
// src/pcb/pcb_hole.ts
|
|
741
|
-
import { z as
|
|
742
|
-
var pcb_hole_circle_or_square =
|
|
743
|
-
type:
|
|
756
|
+
import { z as z43 } from "zod";
|
|
757
|
+
var pcb_hole_circle_or_square = z43.object({
|
|
758
|
+
type: z43.literal("pcb_hole"),
|
|
744
759
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
745
|
-
hole_shape:
|
|
746
|
-
hole_diameter:
|
|
760
|
+
hole_shape: z43.enum(["circle", "square"]),
|
|
761
|
+
hole_diameter: z43.number(),
|
|
747
762
|
x: distance,
|
|
748
763
|
y: distance
|
|
749
764
|
});
|
|
@@ -751,12 +766,12 @@ var pcb_hole_circle_or_square_shape = pcb_hole_circle_or_square.describe(
|
|
|
751
766
|
"Defines a circular or square hole on the PCB"
|
|
752
767
|
);
|
|
753
768
|
expectTypesMatch(true);
|
|
754
|
-
var pcb_hole_oval =
|
|
755
|
-
type:
|
|
769
|
+
var pcb_hole_oval = z43.object({
|
|
770
|
+
type: z43.literal("pcb_hole"),
|
|
756
771
|
pcb_hole_id: getZodPrefixedIdWithDefault("pcb_hole"),
|
|
757
|
-
hole_shape:
|
|
758
|
-
hole_width:
|
|
759
|
-
hole_height:
|
|
772
|
+
hole_shape: z43.literal("oval"),
|
|
773
|
+
hole_width: z43.number(),
|
|
774
|
+
hole_height: z43.number(),
|
|
760
775
|
x: distance,
|
|
761
776
|
y: distance
|
|
762
777
|
});
|
|
@@ -767,36 +782,36 @@ expectTypesMatch(true);
|
|
|
767
782
|
var pcb_hole = pcb_hole_circle_or_square.or(pcb_hole_oval);
|
|
768
783
|
|
|
769
784
|
// src/pcb/pcb_plated_hole.ts
|
|
770
|
-
import { z as
|
|
771
|
-
var pcb_plated_hole_circle =
|
|
772
|
-
type:
|
|
773
|
-
shape:
|
|
774
|
-
outer_diameter:
|
|
775
|
-
hole_diameter:
|
|
785
|
+
import { z as z44 } from "zod";
|
|
786
|
+
var pcb_plated_hole_circle = z44.object({
|
|
787
|
+
type: z44.literal("pcb_plated_hole"),
|
|
788
|
+
shape: z44.literal("circle"),
|
|
789
|
+
outer_diameter: z44.number(),
|
|
790
|
+
hole_diameter: z44.number(),
|
|
776
791
|
x: distance,
|
|
777
792
|
y: distance,
|
|
778
|
-
layers:
|
|
779
|
-
port_hints:
|
|
780
|
-
pcb_component_id:
|
|
781
|
-
pcb_port_id:
|
|
793
|
+
layers: z44.array(layer_ref),
|
|
794
|
+
port_hints: z44.array(z44.string()).optional(),
|
|
795
|
+
pcb_component_id: z44.string().optional(),
|
|
796
|
+
pcb_port_id: z44.string().optional(),
|
|
782
797
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
783
798
|
});
|
|
784
|
-
var pcb_plated_hole_oval =
|
|
785
|
-
type:
|
|
786
|
-
shape:
|
|
787
|
-
outer_width:
|
|
788
|
-
outer_height:
|
|
789
|
-
hole_width:
|
|
790
|
-
hole_height:
|
|
799
|
+
var pcb_plated_hole_oval = z44.object({
|
|
800
|
+
type: z44.literal("pcb_plated_hole"),
|
|
801
|
+
shape: z44.enum(["oval", "pill"]),
|
|
802
|
+
outer_width: z44.number(),
|
|
803
|
+
outer_height: z44.number(),
|
|
804
|
+
hole_width: z44.number(),
|
|
805
|
+
hole_height: z44.number(),
|
|
791
806
|
x: distance,
|
|
792
807
|
y: distance,
|
|
793
|
-
layers:
|
|
794
|
-
port_hints:
|
|
795
|
-
pcb_component_id:
|
|
796
|
-
pcb_port_id:
|
|
808
|
+
layers: z44.array(layer_ref),
|
|
809
|
+
port_hints: z44.array(z44.string()).optional(),
|
|
810
|
+
pcb_component_id: z44.string().optional(),
|
|
811
|
+
pcb_port_id: z44.string().optional(),
|
|
797
812
|
pcb_plated_hole_id: getZodPrefixedIdWithDefault("pcb_plated_hole")
|
|
798
813
|
});
|
|
799
|
-
var pcb_plated_hole =
|
|
814
|
+
var pcb_plated_hole = z44.union([
|
|
800
815
|
pcb_plated_hole_circle,
|
|
801
816
|
pcb_plated_hole_oval
|
|
802
817
|
]);
|
|
@@ -806,155 +821,156 @@ expectTypesMatch(
|
|
|
806
821
|
expectTypesMatch(true);
|
|
807
822
|
|
|
808
823
|
// src/pcb/pcb_port.ts
|
|
809
|
-
import { z as
|
|
810
|
-
var pcb_port =
|
|
811
|
-
type:
|
|
824
|
+
import { z as z45 } from "zod";
|
|
825
|
+
var pcb_port = z45.object({
|
|
826
|
+
type: z45.literal("pcb_port"),
|
|
812
827
|
pcb_port_id: getZodPrefixedIdWithDefault("pcb_port"),
|
|
813
|
-
source_port_id:
|
|
814
|
-
pcb_component_id:
|
|
828
|
+
source_port_id: z45.string(),
|
|
829
|
+
pcb_component_id: z45.string(),
|
|
815
830
|
x: distance,
|
|
816
831
|
y: distance,
|
|
817
|
-
layers:
|
|
832
|
+
layers: z45.array(layer_ref)
|
|
818
833
|
}).describe("Defines a port on the PCB");
|
|
819
834
|
expectTypesMatch(true);
|
|
820
835
|
|
|
821
836
|
// src/pcb/pcb_smtpad.ts
|
|
822
|
-
import { z as
|
|
823
|
-
var pcb_smtpad_circle =
|
|
824
|
-
type:
|
|
825
|
-
shape:
|
|
837
|
+
import { z as z46 } from "zod";
|
|
838
|
+
var pcb_smtpad_circle = z46.object({
|
|
839
|
+
type: z46.literal("pcb_smtpad"),
|
|
840
|
+
shape: z46.literal("circle"),
|
|
826
841
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
827
842
|
x: distance,
|
|
828
843
|
y: distance,
|
|
829
|
-
radius:
|
|
844
|
+
radius: z46.number(),
|
|
830
845
|
layer: layer_ref,
|
|
831
|
-
port_hints:
|
|
832
|
-
pcb_component_id:
|
|
833
|
-
pcb_port_id:
|
|
846
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
847
|
+
pcb_component_id: z46.string().optional(),
|
|
848
|
+
pcb_port_id: z46.string().optional()
|
|
834
849
|
});
|
|
835
|
-
var pcb_smtpad_rect =
|
|
836
|
-
type:
|
|
837
|
-
shape:
|
|
850
|
+
var pcb_smtpad_rect = z46.object({
|
|
851
|
+
type: z46.literal("pcb_smtpad"),
|
|
852
|
+
shape: z46.literal("rect"),
|
|
838
853
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
839
854
|
x: distance,
|
|
840
855
|
y: distance,
|
|
841
|
-
width:
|
|
842
|
-
height:
|
|
856
|
+
width: z46.number(),
|
|
857
|
+
height: z46.number(),
|
|
843
858
|
layer: layer_ref,
|
|
844
|
-
port_hints:
|
|
845
|
-
pcb_component_id:
|
|
846
|
-
pcb_port_id:
|
|
859
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
860
|
+
pcb_component_id: z46.string().optional(),
|
|
861
|
+
pcb_port_id: z46.string().optional()
|
|
847
862
|
});
|
|
848
|
-
var pcb_smtpad_rotated_rect =
|
|
849
|
-
type:
|
|
850
|
-
shape:
|
|
863
|
+
var pcb_smtpad_rotated_rect = z46.object({
|
|
864
|
+
type: z46.literal("pcb_smtpad"),
|
|
865
|
+
shape: z46.literal("rotated_rect"),
|
|
851
866
|
pcb_smtpad_id: getZodPrefixedIdWithDefault("pcb_smtpad"),
|
|
852
867
|
x: distance,
|
|
853
868
|
y: distance,
|
|
854
|
-
width:
|
|
855
|
-
height:
|
|
869
|
+
width: z46.number(),
|
|
870
|
+
height: z46.number(),
|
|
856
871
|
ccw_rotation: rotation,
|
|
857
872
|
layer: layer_ref,
|
|
858
|
-
port_hints:
|
|
859
|
-
pcb_component_id:
|
|
860
|
-
pcb_port_id:
|
|
873
|
+
port_hints: z46.array(z46.string()).optional(),
|
|
874
|
+
pcb_component_id: z46.string().optional(),
|
|
875
|
+
pcb_port_id: z46.string().optional()
|
|
861
876
|
});
|
|
862
|
-
var pcb_smtpad =
|
|
877
|
+
var pcb_smtpad = z46.union([pcb_smtpad_circle, pcb_smtpad_rect, pcb_smtpad_rotated_rect]).describe("Defines an SMT pad on the PCB");
|
|
863
878
|
expectTypesMatch(true);
|
|
864
879
|
expectTypesMatch(true);
|
|
865
880
|
expectTypesMatch(true);
|
|
866
881
|
|
|
867
882
|
// src/pcb/pcb_solder_paste.ts
|
|
868
|
-
import { z as
|
|
869
|
-
var pcb_solder_paste_circle =
|
|
870
|
-
type:
|
|
871
|
-
shape:
|
|
883
|
+
import { z as z47 } from "zod";
|
|
884
|
+
var pcb_solder_paste_circle = z47.object({
|
|
885
|
+
type: z47.literal("pcb_solder_paste"),
|
|
886
|
+
shape: z47.literal("circle"),
|
|
872
887
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
873
888
|
x: distance,
|
|
874
889
|
y: distance,
|
|
875
|
-
radius:
|
|
890
|
+
radius: z47.number(),
|
|
876
891
|
layer: layer_ref,
|
|
877
|
-
pcb_component_id:
|
|
878
|
-
pcb_smtpad_id:
|
|
892
|
+
pcb_component_id: z47.string().optional(),
|
|
893
|
+
pcb_smtpad_id: z47.string().optional()
|
|
879
894
|
});
|
|
880
|
-
var pcb_solder_paste_rect =
|
|
881
|
-
type:
|
|
882
|
-
shape:
|
|
895
|
+
var pcb_solder_paste_rect = z47.object({
|
|
896
|
+
type: z47.literal("pcb_solder_paste"),
|
|
897
|
+
shape: z47.literal("rect"),
|
|
883
898
|
pcb_solder_paste_id: getZodPrefixedIdWithDefault("pcb_solder_paste"),
|
|
884
899
|
x: distance,
|
|
885
900
|
y: distance,
|
|
886
|
-
width:
|
|
887
|
-
height:
|
|
901
|
+
width: z47.number(),
|
|
902
|
+
height: z47.number(),
|
|
888
903
|
layer: layer_ref,
|
|
889
|
-
pcb_component_id:
|
|
890
|
-
pcb_smtpad_id:
|
|
904
|
+
pcb_component_id: z47.string().optional(),
|
|
905
|
+
pcb_smtpad_id: z47.string().optional()
|
|
891
906
|
});
|
|
892
|
-
var pcb_solder_paste =
|
|
907
|
+
var pcb_solder_paste = z47.union([pcb_solder_paste_circle, pcb_solder_paste_rect]).describe("Defines solderpaste on the PCB");
|
|
893
908
|
expectTypesMatch(true);
|
|
894
909
|
expectTypesMatch(true);
|
|
895
910
|
|
|
896
911
|
// src/pcb/pcb_text.ts
|
|
897
|
-
import { z as
|
|
898
|
-
var pcb_text =
|
|
899
|
-
type:
|
|
912
|
+
import { z as z48 } from "zod";
|
|
913
|
+
var pcb_text = z48.object({
|
|
914
|
+
type: z48.literal("pcb_text"),
|
|
900
915
|
pcb_text_id: getZodPrefixedIdWithDefault("pcb_text"),
|
|
901
|
-
text:
|
|
916
|
+
text: z48.string(),
|
|
902
917
|
center: point,
|
|
903
918
|
layer: layer_ref,
|
|
904
919
|
width: length,
|
|
905
920
|
height: length,
|
|
906
|
-
lines:
|
|
907
|
-
|
|
921
|
+
lines: z48.number(),
|
|
922
|
+
// @ts-ignore
|
|
923
|
+
align: z48.enum(["bottom-left"])
|
|
908
924
|
}).describe("Defines text on the PCB");
|
|
909
925
|
expectTypesMatch(true);
|
|
910
926
|
|
|
911
927
|
// src/pcb/pcb_trace.ts
|
|
912
|
-
import { z as
|
|
913
|
-
var pcb_trace_route_point_wire =
|
|
914
|
-
route_type:
|
|
928
|
+
import { z as z49 } from "zod";
|
|
929
|
+
var pcb_trace_route_point_wire = z49.object({
|
|
930
|
+
route_type: z49.literal("wire"),
|
|
915
931
|
x: distance,
|
|
916
932
|
y: distance,
|
|
917
933
|
width: distance,
|
|
918
|
-
start_pcb_port_id:
|
|
919
|
-
end_pcb_port_id:
|
|
934
|
+
start_pcb_port_id: z49.string().optional(),
|
|
935
|
+
end_pcb_port_id: z49.string().optional(),
|
|
920
936
|
layer: layer_ref
|
|
921
937
|
});
|
|
922
|
-
var pcb_trace_route_point_via =
|
|
923
|
-
route_type:
|
|
938
|
+
var pcb_trace_route_point_via = z49.object({
|
|
939
|
+
route_type: z49.literal("via"),
|
|
924
940
|
x: distance,
|
|
925
941
|
y: distance,
|
|
926
|
-
from_layer:
|
|
927
|
-
to_layer:
|
|
942
|
+
from_layer: z49.string(),
|
|
943
|
+
to_layer: z49.string()
|
|
928
944
|
});
|
|
929
|
-
var pcb_trace_route_point =
|
|
945
|
+
var pcb_trace_route_point = z49.union([
|
|
930
946
|
pcb_trace_route_point_wire,
|
|
931
947
|
pcb_trace_route_point_via
|
|
932
948
|
]);
|
|
933
|
-
var pcb_trace =
|
|
934
|
-
type:
|
|
935
|
-
source_trace_id:
|
|
936
|
-
pcb_component_id:
|
|
949
|
+
var pcb_trace = z49.object({
|
|
950
|
+
type: z49.literal("pcb_trace"),
|
|
951
|
+
source_trace_id: z49.string().optional(),
|
|
952
|
+
pcb_component_id: z49.string().optional(),
|
|
937
953
|
pcb_trace_id: getZodPrefixedIdWithDefault("pcb_trace"),
|
|
938
|
-
route_thickness_mode:
|
|
939
|
-
route_order_index:
|
|
940
|
-
should_round_corners:
|
|
941
|
-
route:
|
|
942
|
-
|
|
943
|
-
|
|
944
|
-
route_type:
|
|
954
|
+
route_thickness_mode: z49.enum(["constant", "interpolated"]).default("constant").optional(),
|
|
955
|
+
route_order_index: z49.number().optional(),
|
|
956
|
+
should_round_corners: z49.boolean().optional(),
|
|
957
|
+
route: z49.array(
|
|
958
|
+
z49.union([
|
|
959
|
+
z49.object({
|
|
960
|
+
route_type: z49.literal("wire"),
|
|
945
961
|
x: distance,
|
|
946
962
|
y: distance,
|
|
947
963
|
width: distance,
|
|
948
|
-
start_pcb_port_id:
|
|
949
|
-
end_pcb_port_id:
|
|
964
|
+
start_pcb_port_id: z49.string().optional(),
|
|
965
|
+
end_pcb_port_id: z49.string().optional(),
|
|
950
966
|
layer: layer_ref
|
|
951
967
|
}),
|
|
952
|
-
|
|
953
|
-
route_type:
|
|
968
|
+
z49.object({
|
|
969
|
+
route_type: z49.literal("via"),
|
|
954
970
|
x: distance,
|
|
955
971
|
y: distance,
|
|
956
|
-
from_layer:
|
|
957
|
-
to_layer:
|
|
972
|
+
from_layer: z49.string(),
|
|
973
|
+
to_layer: z49.string()
|
|
958
974
|
})
|
|
959
975
|
])
|
|
960
976
|
)
|
|
@@ -963,34 +979,34 @@ expectTypesMatch(true);
|
|
|
963
979
|
expectTypesMatch(true);
|
|
964
980
|
|
|
965
981
|
// src/pcb/pcb_trace_error.ts
|
|
966
|
-
import { z as
|
|
967
|
-
var pcb_trace_error =
|
|
968
|
-
type:
|
|
982
|
+
import { z as z50 } from "zod";
|
|
983
|
+
var pcb_trace_error = z50.object({
|
|
984
|
+
type: z50.literal("pcb_trace_error"),
|
|
969
985
|
pcb_trace_error_id: getZodPrefixedIdWithDefault("pcb_trace_error"),
|
|
970
|
-
error_type:
|
|
971
|
-
message:
|
|
986
|
+
error_type: z50.literal("pcb_trace_error"),
|
|
987
|
+
message: z50.string(),
|
|
972
988
|
center: point.optional(),
|
|
973
|
-
pcb_trace_id:
|
|
974
|
-
source_trace_id:
|
|
975
|
-
pcb_component_ids:
|
|
976
|
-
pcb_port_ids:
|
|
989
|
+
pcb_trace_id: z50.string(),
|
|
990
|
+
source_trace_id: z50.string(),
|
|
991
|
+
pcb_component_ids: z50.array(z50.string()),
|
|
992
|
+
pcb_port_ids: z50.array(z50.string())
|
|
977
993
|
}).describe("Defines a trace error on the PCB");
|
|
978
994
|
expectTypesMatch(true);
|
|
979
995
|
|
|
980
996
|
// src/pcb/pcb_port_not_matched_error.ts
|
|
981
|
-
import { z as
|
|
982
|
-
var pcb_port_not_matched_error =
|
|
983
|
-
type:
|
|
997
|
+
import { z as z51 } from "zod";
|
|
998
|
+
var pcb_port_not_matched_error = z51.object({
|
|
999
|
+
type: z51.literal("pcb_port_not_matched_error"),
|
|
984
1000
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_error"),
|
|
985
|
-
message:
|
|
986
|
-
pcb_component_ids:
|
|
1001
|
+
message: z51.string(),
|
|
1002
|
+
pcb_component_ids: z51.array(z51.string())
|
|
987
1003
|
}).describe("Defines a trace error on the PCB where a port is not matched");
|
|
988
1004
|
expectTypesMatch(true);
|
|
989
1005
|
|
|
990
1006
|
// src/pcb/pcb_via.ts
|
|
991
|
-
import { z as
|
|
992
|
-
var pcb_via =
|
|
993
|
-
type:
|
|
1007
|
+
import { z as z52 } from "zod";
|
|
1008
|
+
var pcb_via = z52.object({
|
|
1009
|
+
type: z52.literal("pcb_via"),
|
|
994
1010
|
pcb_via_id: getZodPrefixedIdWithDefault("pcb_via"),
|
|
995
1011
|
x: distance,
|
|
996
1012
|
y: distance,
|
|
@@ -1000,51 +1016,51 @@ var pcb_via = z51.object({
|
|
|
1000
1016
|
from_layer: layer_ref.optional(),
|
|
1001
1017
|
/** @deprecated */
|
|
1002
1018
|
to_layer: layer_ref.optional(),
|
|
1003
|
-
layers:
|
|
1004
|
-
pcb_trace_id:
|
|
1019
|
+
layers: z52.array(layer_ref),
|
|
1020
|
+
pcb_trace_id: z52.string().optional()
|
|
1005
1021
|
}).describe("Defines a via on the PCB");
|
|
1006
1022
|
expectTypesMatch(true);
|
|
1007
1023
|
|
|
1008
1024
|
// src/pcb/pcb_board.ts
|
|
1009
|
-
import { z as
|
|
1010
|
-
var pcb_board =
|
|
1011
|
-
type:
|
|
1025
|
+
import { z as z53 } from "zod";
|
|
1026
|
+
var pcb_board = z53.object({
|
|
1027
|
+
type: z53.literal("pcb_board"),
|
|
1012
1028
|
pcb_board_id: getZodPrefixedIdWithDefault("pcb_board"),
|
|
1013
1029
|
width: length,
|
|
1014
1030
|
height: length,
|
|
1015
1031
|
center: point,
|
|
1016
1032
|
thickness: length.optional().default(1.4),
|
|
1017
|
-
num_layers:
|
|
1018
|
-
outline:
|
|
1033
|
+
num_layers: z53.number().optional().default(4),
|
|
1034
|
+
outline: z53.array(point).optional()
|
|
1019
1035
|
}).describe("Defines the board outline of the PCB");
|
|
1020
1036
|
expectTypesMatch(true);
|
|
1021
1037
|
|
|
1022
1038
|
// src/pcb/pcb_placement_error.ts
|
|
1023
|
-
import { z as
|
|
1024
|
-
var pcb_placement_error =
|
|
1025
|
-
type:
|
|
1039
|
+
import { z as z54 } from "zod";
|
|
1040
|
+
var pcb_placement_error = z54.object({
|
|
1041
|
+
type: z54.literal("pcb_placement_error"),
|
|
1026
1042
|
pcb_placement_error_id: getZodPrefixedIdWithDefault("pcb_placement_error"),
|
|
1027
|
-
message:
|
|
1043
|
+
message: z54.string()
|
|
1028
1044
|
}).describe("Defines a placement error on the PCB");
|
|
1029
1045
|
expectTypesMatch(true);
|
|
1030
1046
|
|
|
1031
1047
|
// src/pcb/pcb_trace_hint.ts
|
|
1032
|
-
import { z as
|
|
1033
|
-
var pcb_trace_hint =
|
|
1034
|
-
type:
|
|
1048
|
+
import { z as z55 } from "zod";
|
|
1049
|
+
var pcb_trace_hint = z55.object({
|
|
1050
|
+
type: z55.literal("pcb_trace_hint"),
|
|
1035
1051
|
pcb_trace_hint_id: getZodPrefixedIdWithDefault("pcb_trace_hint"),
|
|
1036
|
-
pcb_port_id:
|
|
1037
|
-
pcb_component_id:
|
|
1038
|
-
route:
|
|
1052
|
+
pcb_port_id: z55.string(),
|
|
1053
|
+
pcb_component_id: z55.string(),
|
|
1054
|
+
route: z55.array(route_hint_point)
|
|
1039
1055
|
}).describe("A hint that can be used during generation of a PCB trace");
|
|
1040
1056
|
expectTypesMatch(true);
|
|
1041
1057
|
|
|
1042
1058
|
// src/pcb/pcb_silkscreen_line.ts
|
|
1043
|
-
import { z as
|
|
1044
|
-
var pcb_silkscreen_line =
|
|
1045
|
-
type:
|
|
1059
|
+
import { z as z56 } from "zod";
|
|
1060
|
+
var pcb_silkscreen_line = z56.object({
|
|
1061
|
+
type: z56.literal("pcb_silkscreen_line"),
|
|
1046
1062
|
pcb_silkscreen_line_id: getZodPrefixedIdWithDefault("pcb_silkscreen_line"),
|
|
1047
|
-
pcb_component_id:
|
|
1063
|
+
pcb_component_id: z56.string(),
|
|
1048
1064
|
stroke_width: distance.default("0.1mm"),
|
|
1049
1065
|
x1: distance,
|
|
1050
1066
|
y1: distance,
|
|
@@ -1055,40 +1071,40 @@ var pcb_silkscreen_line = z55.object({
|
|
|
1055
1071
|
expectTypesMatch(true);
|
|
1056
1072
|
|
|
1057
1073
|
// src/pcb/pcb_silkscreen_path.ts
|
|
1058
|
-
import { z as
|
|
1059
|
-
var pcb_silkscreen_path =
|
|
1060
|
-
type:
|
|
1074
|
+
import { z as z57 } from "zod";
|
|
1075
|
+
var pcb_silkscreen_path = z57.object({
|
|
1076
|
+
type: z57.literal("pcb_silkscreen_path"),
|
|
1061
1077
|
pcb_silkscreen_path_id: getZodPrefixedIdWithDefault("pcb_silkscreen_path"),
|
|
1062
|
-
pcb_component_id:
|
|
1078
|
+
pcb_component_id: z57.string(),
|
|
1063
1079
|
layer: visible_layer,
|
|
1064
|
-
route:
|
|
1080
|
+
route: z57.array(point),
|
|
1065
1081
|
stroke_width: length
|
|
1066
1082
|
}).describe("Defines a silkscreen path on the PCB");
|
|
1067
1083
|
expectTypesMatch(true);
|
|
1068
1084
|
|
|
1069
1085
|
// src/pcb/pcb_silkscreen_text.ts
|
|
1070
|
-
import { z as
|
|
1071
|
-
var pcb_silkscreen_text =
|
|
1072
|
-
type:
|
|
1086
|
+
import { z as z58 } from "zod";
|
|
1087
|
+
var pcb_silkscreen_text = z58.object({
|
|
1088
|
+
type: z58.literal("pcb_silkscreen_text"),
|
|
1073
1089
|
pcb_silkscreen_text_id: getZodPrefixedIdWithDefault("pcb_silkscreen_text"),
|
|
1074
|
-
font:
|
|
1090
|
+
font: z58.literal("tscircuit2024").default("tscircuit2024"),
|
|
1075
1091
|
font_size: distance.default("0.2mm"),
|
|
1076
|
-
pcb_component_id:
|
|
1077
|
-
text:
|
|
1078
|
-
ccw_rotation:
|
|
1092
|
+
pcb_component_id: z58.string(),
|
|
1093
|
+
text: z58.string(),
|
|
1094
|
+
ccw_rotation: z58.number().optional(),
|
|
1079
1095
|
layer: layer_ref,
|
|
1080
|
-
is_mirrored:
|
|
1096
|
+
is_mirrored: z58.boolean().default(false).optional(),
|
|
1081
1097
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1082
|
-
anchor_alignment:
|
|
1098
|
+
anchor_alignment: z58.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center")
|
|
1083
1099
|
}).describe("Defines silkscreen text on the PCB");
|
|
1084
1100
|
expectTypesMatch(true);
|
|
1085
1101
|
|
|
1086
1102
|
// src/pcb/pcb_silkscreen_rect.ts
|
|
1087
|
-
import { z as
|
|
1088
|
-
var pcb_silkscreen_rect =
|
|
1089
|
-
type:
|
|
1103
|
+
import { z as z59 } from "zod";
|
|
1104
|
+
var pcb_silkscreen_rect = z59.object({
|
|
1105
|
+
type: z59.literal("pcb_silkscreen_rect"),
|
|
1090
1106
|
pcb_silkscreen_rect_id: getZodPrefixedIdWithDefault("pcb_silkscreen_rect"),
|
|
1091
|
-
pcb_component_id:
|
|
1107
|
+
pcb_component_id: z59.string(),
|
|
1092
1108
|
center: point,
|
|
1093
1109
|
width: length,
|
|
1094
1110
|
height: length,
|
|
@@ -1097,13 +1113,13 @@ var pcb_silkscreen_rect = z58.object({
|
|
|
1097
1113
|
expectTypesMatch(true);
|
|
1098
1114
|
|
|
1099
1115
|
// src/pcb/pcb_silkscreen_circle.ts
|
|
1100
|
-
import { z as
|
|
1101
|
-
var pcb_silkscreen_circle =
|
|
1102
|
-
type:
|
|
1116
|
+
import { z as z60 } from "zod";
|
|
1117
|
+
var pcb_silkscreen_circle = z60.object({
|
|
1118
|
+
type: z60.literal("pcb_silkscreen_circle"),
|
|
1103
1119
|
pcb_silkscreen_circle_id: getZodPrefixedIdWithDefault(
|
|
1104
1120
|
"pcb_silkscreen_circle"
|
|
1105
1121
|
),
|
|
1106
|
-
pcb_component_id:
|
|
1122
|
+
pcb_component_id: z60.string(),
|
|
1107
1123
|
center: point,
|
|
1108
1124
|
radius: length,
|
|
1109
1125
|
layer: visible_layer
|
|
@@ -1111,11 +1127,11 @@ var pcb_silkscreen_circle = z59.object({
|
|
|
1111
1127
|
expectTypesMatch(true);
|
|
1112
1128
|
|
|
1113
1129
|
// src/pcb/pcb_silkscreen_oval.ts
|
|
1114
|
-
import { z as
|
|
1115
|
-
var pcb_silkscreen_oval =
|
|
1116
|
-
type:
|
|
1130
|
+
import { z as z61 } from "zod";
|
|
1131
|
+
var pcb_silkscreen_oval = z61.object({
|
|
1132
|
+
type: z61.literal("pcb_silkscreen_oval"),
|
|
1117
1133
|
pcb_silkscreen_oval_id: getZodPrefixedIdWithDefault("pcb_silkscreen_oval"),
|
|
1118
|
-
pcb_component_id:
|
|
1134
|
+
pcb_component_id: z61.string(),
|
|
1119
1135
|
center: point,
|
|
1120
1136
|
radius_x: distance,
|
|
1121
1137
|
radius_y: distance,
|
|
@@ -1124,133 +1140,133 @@ var pcb_silkscreen_oval = z60.object({
|
|
|
1124
1140
|
expectTypesMatch(true);
|
|
1125
1141
|
|
|
1126
1142
|
// src/pcb/pcb_fabrication_note_text.ts
|
|
1127
|
-
import { z as
|
|
1128
|
-
var pcb_fabrication_note_text =
|
|
1129
|
-
type:
|
|
1143
|
+
import { z as z62 } from "zod";
|
|
1144
|
+
var pcb_fabrication_note_text = z62.object({
|
|
1145
|
+
type: z62.literal("pcb_fabrication_note_text"),
|
|
1130
1146
|
pcb_fabrication_note_text_id: getZodPrefixedIdWithDefault(
|
|
1131
1147
|
"pcb_fabrication_note_text"
|
|
1132
1148
|
),
|
|
1133
|
-
font:
|
|
1149
|
+
font: z62.literal("tscircuit2024").default("tscircuit2024"),
|
|
1134
1150
|
font_size: distance.default("1mm"),
|
|
1135
|
-
pcb_component_id:
|
|
1136
|
-
text:
|
|
1151
|
+
pcb_component_id: z62.string(),
|
|
1152
|
+
text: z62.string(),
|
|
1137
1153
|
layer: visible_layer,
|
|
1138
1154
|
anchor_position: point.default({ x: 0, y: 0 }),
|
|
1139
|
-
anchor_alignment:
|
|
1140
|
-
color:
|
|
1155
|
+
anchor_alignment: z62.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1156
|
+
color: z62.string().optional()
|
|
1141
1157
|
}).describe(
|
|
1142
1158
|
"Defines a fabrication note in text on the PCB, useful for leaving notes for assemblers or fabricators"
|
|
1143
1159
|
);
|
|
1144
1160
|
expectTypesMatch(true);
|
|
1145
1161
|
|
|
1146
1162
|
// src/pcb/pcb_fabrication_note_path.ts
|
|
1147
|
-
import { z as
|
|
1148
|
-
var pcb_fabrication_note_path =
|
|
1149
|
-
type:
|
|
1163
|
+
import { z as z63 } from "zod";
|
|
1164
|
+
var pcb_fabrication_note_path = z63.object({
|
|
1165
|
+
type: z63.literal("pcb_fabrication_note_path"),
|
|
1150
1166
|
pcb_fabrication_note_path_id: getZodPrefixedIdWithDefault(
|
|
1151
1167
|
"pcb_fabrication_note_path"
|
|
1152
1168
|
),
|
|
1153
|
-
pcb_component_id:
|
|
1169
|
+
pcb_component_id: z63.string(),
|
|
1154
1170
|
layer: layer_ref,
|
|
1155
|
-
route:
|
|
1171
|
+
route: z63.array(point),
|
|
1156
1172
|
stroke_width: length,
|
|
1157
|
-
color:
|
|
1173
|
+
color: z63.string().optional()
|
|
1158
1174
|
}).describe(
|
|
1159
1175
|
"Defines a fabrication path on the PCB for fabricators or assemblers"
|
|
1160
1176
|
);
|
|
1161
1177
|
expectTypesMatch(true);
|
|
1162
1178
|
|
|
1163
1179
|
// src/pcb/pcb_keepout.ts
|
|
1164
|
-
import { z as
|
|
1165
|
-
var pcb_keepout =
|
|
1166
|
-
type:
|
|
1167
|
-
shape:
|
|
1180
|
+
import { z as z64 } from "zod";
|
|
1181
|
+
var pcb_keepout = z64.object({
|
|
1182
|
+
type: z64.literal("pcb_keepout"),
|
|
1183
|
+
shape: z64.literal("rect"),
|
|
1168
1184
|
center: point,
|
|
1169
1185
|
width: distance,
|
|
1170
1186
|
height: distance,
|
|
1171
|
-
pcb_keepout_id:
|
|
1172
|
-
layers:
|
|
1187
|
+
pcb_keepout_id: z64.string(),
|
|
1188
|
+
layers: z64.array(z64.string()),
|
|
1173
1189
|
// Specify layers where the keepout applies
|
|
1174
|
-
description:
|
|
1190
|
+
description: z64.string().optional()
|
|
1175
1191
|
// Optional description of the keepout
|
|
1176
1192
|
}).or(
|
|
1177
|
-
|
|
1178
|
-
type:
|
|
1179
|
-
shape:
|
|
1193
|
+
z64.object({
|
|
1194
|
+
type: z64.literal("pcb_keepout"),
|
|
1195
|
+
shape: z64.literal("circle"),
|
|
1180
1196
|
center: point,
|
|
1181
1197
|
radius: distance,
|
|
1182
|
-
pcb_keepout_id:
|
|
1183
|
-
layers:
|
|
1198
|
+
pcb_keepout_id: z64.string(),
|
|
1199
|
+
layers: z64.array(z64.string()),
|
|
1184
1200
|
// Specify layers where the keepout applies
|
|
1185
|
-
description:
|
|
1201
|
+
description: z64.string().optional()
|
|
1186
1202
|
// Optional description of the keepout
|
|
1187
1203
|
})
|
|
1188
1204
|
);
|
|
1189
1205
|
|
|
1190
1206
|
// src/pcb/pcb_missing_footprint_error.ts
|
|
1191
|
-
import { z as
|
|
1192
|
-
var pcb_missing_footprint_error =
|
|
1193
|
-
type:
|
|
1207
|
+
import { z as z65 } from "zod";
|
|
1208
|
+
var pcb_missing_footprint_error = z65.object({
|
|
1209
|
+
type: z65.literal("pcb_missing_footprint_error"),
|
|
1194
1210
|
pcb_missing_footprint_error_id: getZodPrefixedIdWithDefault(
|
|
1195
1211
|
"pcb_missing_footprint_error"
|
|
1196
1212
|
),
|
|
1197
|
-
error_type:
|
|
1198
|
-
source_component_id:
|
|
1199
|
-
message:
|
|
1213
|
+
error_type: z65.literal("pcb_missing_footprint_error"),
|
|
1214
|
+
source_component_id: z65.string(),
|
|
1215
|
+
message: z65.string()
|
|
1200
1216
|
}).describe("Defines a missing footprint error on the PCB");
|
|
1201
1217
|
expectTypesMatch(
|
|
1202
1218
|
true
|
|
1203
1219
|
);
|
|
1204
1220
|
|
|
1205
1221
|
// src/pcb/pcb_manual_edit_conflict_error.ts
|
|
1206
|
-
import { z as
|
|
1207
|
-
var pcb_manual_edit_conflict_error =
|
|
1208
|
-
type:
|
|
1222
|
+
import { z as z66 } from "zod";
|
|
1223
|
+
var pcb_manual_edit_conflict_error = z66.object({
|
|
1224
|
+
type: z66.literal("pcb_manual_edit_conflict_error"),
|
|
1209
1225
|
pcb_error_id: getZodPrefixedIdWithDefault("pcb_manual_edit_conflict_error"),
|
|
1210
|
-
message:
|
|
1211
|
-
pcb_component_id:
|
|
1212
|
-
source_component_id:
|
|
1226
|
+
message: z66.string(),
|
|
1227
|
+
pcb_component_id: z66.string(),
|
|
1228
|
+
source_component_id: z66.string()
|
|
1213
1229
|
}).describe(
|
|
1214
1230
|
"Error emitted when a component has both manual placement and explicit pcbX/pcbY coordinates"
|
|
1215
1231
|
);
|
|
1216
1232
|
expectTypesMatch(true);
|
|
1217
1233
|
|
|
1218
1234
|
// src/pcb/pcb_group.ts
|
|
1219
|
-
import { z as
|
|
1220
|
-
var pcb_group =
|
|
1221
|
-
type:
|
|
1235
|
+
import { z as z67 } from "zod";
|
|
1236
|
+
var pcb_group = z67.object({
|
|
1237
|
+
type: z67.literal("pcb_group"),
|
|
1222
1238
|
pcb_group_id: getZodPrefixedIdWithDefault("pcb_group"),
|
|
1223
1239
|
width: length,
|
|
1224
1240
|
height: length,
|
|
1225
1241
|
center: point,
|
|
1226
|
-
pcb_component_ids:
|
|
1227
|
-
name:
|
|
1228
|
-
description:
|
|
1242
|
+
pcb_component_ids: z67.array(z67.string()),
|
|
1243
|
+
name: z67.string().optional(),
|
|
1244
|
+
description: z67.string().optional()
|
|
1229
1245
|
}).describe("Defines a group of components on the PCB");
|
|
1230
1246
|
expectTypesMatch(true);
|
|
1231
1247
|
|
|
1232
1248
|
// src/cad/cad_component.ts
|
|
1233
|
-
import { z as
|
|
1234
|
-
var cad_component =
|
|
1235
|
-
type:
|
|
1236
|
-
cad_component_id:
|
|
1237
|
-
pcb_component_id:
|
|
1238
|
-
source_component_id:
|
|
1249
|
+
import { z as z68 } from "zod";
|
|
1250
|
+
var cad_component = z68.object({
|
|
1251
|
+
type: z68.literal("cad_component"),
|
|
1252
|
+
cad_component_id: z68.string(),
|
|
1253
|
+
pcb_component_id: z68.string(),
|
|
1254
|
+
source_component_id: z68.string(),
|
|
1239
1255
|
position: point3,
|
|
1240
1256
|
rotation: point3.optional(),
|
|
1241
1257
|
size: point3.optional(),
|
|
1242
1258
|
layer: layer_ref.optional(),
|
|
1243
1259
|
// These are all ways to generate/load the 3d model
|
|
1244
|
-
footprinter_string:
|
|
1245
|
-
model_obj_url:
|
|
1246
|
-
model_stl_url:
|
|
1247
|
-
model_3mf_url:
|
|
1248
|
-
model_jscad:
|
|
1260
|
+
footprinter_string: z68.string().optional(),
|
|
1261
|
+
model_obj_url: z68.string().optional(),
|
|
1262
|
+
model_stl_url: z68.string().optional(),
|
|
1263
|
+
model_3mf_url: z68.string().optional(),
|
|
1264
|
+
model_jscad: z68.any().optional()
|
|
1249
1265
|
}).describe("Defines a component on the PCB");
|
|
1250
1266
|
|
|
1251
1267
|
// src/any_circuit_element.ts
|
|
1252
|
-
import { z as
|
|
1253
|
-
var any_circuit_element =
|
|
1268
|
+
import { z as z69 } from "zod";
|
|
1269
|
+
var any_circuit_element = z69.union([
|
|
1254
1270
|
source_trace,
|
|
1255
1271
|
source_port,
|
|
1256
1272
|
any_source_component,
|
|
@@ -1266,6 +1282,7 @@ var any_circuit_element = z68.union([
|
|
|
1266
1282
|
source_simple_battery,
|
|
1267
1283
|
source_simple_inductor,
|
|
1268
1284
|
source_simple_pin_header,
|
|
1285
|
+
source_simple_resonator,
|
|
1269
1286
|
source_simple_potentiometer,
|
|
1270
1287
|
source_simple_push_button,
|
|
1271
1288
|
pcb_component,
|
|
@@ -1402,6 +1419,7 @@ export {
|
|
|
1402
1419
|
source_simple_power_source,
|
|
1403
1420
|
source_simple_push_button,
|
|
1404
1421
|
source_simple_resistor,
|
|
1422
|
+
source_simple_resonator,
|
|
1405
1423
|
source_trace,
|
|
1406
1424
|
supplier_name,
|
|
1407
1425
|
time,
|