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