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