@tscircuit/props 0.0.417 → 0.0.419
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 +83 -64
- package/dist/index.d.ts +972 -1
- package/dist/index.js +881 -871
- package/dist/index.js.map +1 -1
- package/lib/common/pcbStyle.ts +4 -0
- package/lib/common/schematicSize.ts +8 -0
- package/lib/components/capacitor.ts +6 -0
- package/lib/components/resistor.ts +6 -0
- package/lib/index.ts +1 -0
- package/package.json +1 -1
package/dist/index.js
CHANGED
|
@@ -109,6 +109,8 @@ import { distance as distance3 } from "circuit-json";
|
|
|
109
109
|
import { z as z7 } from "zod";
|
|
110
110
|
var pcbStyle = z7.object({
|
|
111
111
|
silkscreenFontSize: distance3.optional(),
|
|
112
|
+
viaPadDiameter: distance3.optional(),
|
|
113
|
+
viaHoleDiameter: distance3.optional(),
|
|
112
114
|
silkscreenTextPosition: z7.union([
|
|
113
115
|
z7.enum(["centered", "outside", "none"]),
|
|
114
116
|
z7.object({
|
|
@@ -329,9 +331,14 @@ expectTypesMatch(true);
|
|
|
329
331
|
import { z as z13 } from "zod";
|
|
330
332
|
var schematicPinLabel = z13.string().regex(/^[A-Za-z0-9_]+$/);
|
|
331
333
|
|
|
332
|
-
// lib/common/
|
|
334
|
+
// lib/common/schematicSize.ts
|
|
335
|
+
import { distance as distance6 } from "circuit-json";
|
|
333
336
|
import { z as z14 } from "zod";
|
|
334
|
-
var
|
|
337
|
+
var schematicSymbolSize = distance6.or(z14.enum(["xs", "sm", "default", "md"])).describe("distance between pin1 and pin2 of the schematic symbol");
|
|
338
|
+
|
|
339
|
+
// lib/common/ninePointAnchor.ts
|
|
340
|
+
import { z as z15 } from "zod";
|
|
341
|
+
var ninePointAnchor = z15.enum([
|
|
335
342
|
"top_left",
|
|
336
343
|
"top_center",
|
|
337
344
|
"top_right",
|
|
@@ -344,52 +351,52 @@ var ninePointAnchor = z14.enum([
|
|
|
344
351
|
]);
|
|
345
352
|
|
|
346
353
|
// lib/common/point.ts
|
|
347
|
-
import { distance as
|
|
348
|
-
import { z as
|
|
349
|
-
var point =
|
|
350
|
-
x:
|
|
351
|
-
y:
|
|
354
|
+
import { distance as distance7 } from "circuit-json";
|
|
355
|
+
import { z as z16 } from "zod";
|
|
356
|
+
var point = z16.object({
|
|
357
|
+
x: distance7,
|
|
358
|
+
y: distance7
|
|
352
359
|
});
|
|
353
360
|
|
|
354
361
|
// lib/components/board.ts
|
|
355
|
-
import { z as
|
|
362
|
+
import { z as z30 } from "zod";
|
|
356
363
|
|
|
357
364
|
// lib/components/group.ts
|
|
358
|
-
import { length as length2, distance as
|
|
359
|
-
import { z as
|
|
365
|
+
import { length as length2, distance as distance8 } from "circuit-json";
|
|
366
|
+
import { z as z29 } from "zod";
|
|
360
367
|
|
|
361
368
|
// lib/manual-edits/manual-edit-events/base_manual_edit_event.ts
|
|
362
|
-
import { z as
|
|
363
|
-
var base_manual_edit_event =
|
|
364
|
-
edit_event_id:
|
|
365
|
-
in_progress:
|
|
366
|
-
created_at:
|
|
369
|
+
import { z as z17 } from "zod";
|
|
370
|
+
var base_manual_edit_event = z17.object({
|
|
371
|
+
edit_event_id: z17.string(),
|
|
372
|
+
in_progress: z17.boolean().optional(),
|
|
373
|
+
created_at: z17.number()
|
|
367
374
|
});
|
|
368
375
|
expectTypesMatch(
|
|
369
376
|
true
|
|
370
377
|
);
|
|
371
378
|
|
|
372
379
|
// lib/manual-edits/manual-edit-events/edit_pcb_component_location_event.ts
|
|
373
|
-
import { z as
|
|
380
|
+
import { z as z18 } from "zod";
|
|
374
381
|
var edit_pcb_component_location_event = base_manual_edit_event.extend({
|
|
375
|
-
pcb_edit_event_type:
|
|
376
|
-
edit_event_type:
|
|
377
|
-
pcb_component_id:
|
|
378
|
-
original_center:
|
|
379
|
-
new_center:
|
|
382
|
+
pcb_edit_event_type: z18.literal("edit_component_location").describe("deprecated"),
|
|
383
|
+
edit_event_type: z18.literal("edit_pcb_component_location"),
|
|
384
|
+
pcb_component_id: z18.string(),
|
|
385
|
+
original_center: z18.object({ x: z18.number(), y: z18.number() }),
|
|
386
|
+
new_center: z18.object({ x: z18.number(), y: z18.number() })
|
|
380
387
|
});
|
|
381
388
|
var edit_component_location_event = edit_pcb_component_location_event;
|
|
382
389
|
expectTypesMatch(true);
|
|
383
390
|
|
|
384
391
|
// lib/manual-edits/manual-edit-events/edit_trace_hint_event.ts
|
|
385
|
-
import { z as
|
|
392
|
+
import { z as z19 } from "zod";
|
|
386
393
|
var edit_trace_hint_event = base_manual_edit_event.extend({
|
|
387
|
-
pcb_edit_event_type:
|
|
388
|
-
edit_event_type:
|
|
389
|
-
pcb_port_id:
|
|
390
|
-
pcb_trace_hint_id:
|
|
391
|
-
route:
|
|
392
|
-
|
|
394
|
+
pcb_edit_event_type: z19.literal("edit_trace_hint").describe("deprecated"),
|
|
395
|
+
edit_event_type: z19.literal("edit_pcb_trace_hint").optional(),
|
|
396
|
+
pcb_port_id: z19.string(),
|
|
397
|
+
pcb_trace_hint_id: z19.string().optional(),
|
|
398
|
+
route: z19.array(
|
|
399
|
+
z19.object({ x: z19.number(), y: z19.number(), via: z19.boolean().optional() })
|
|
393
400
|
)
|
|
394
401
|
});
|
|
395
402
|
expectTypesMatch(
|
|
@@ -397,38 +404,38 @@ expectTypesMatch(
|
|
|
397
404
|
);
|
|
398
405
|
|
|
399
406
|
// lib/manual-edits/manual-edit-events/edit_schematic_component_location_event.ts
|
|
400
|
-
import { z as
|
|
407
|
+
import { z as z20 } from "zod";
|
|
401
408
|
var edit_schematic_component_location_event = base_manual_edit_event.extend({
|
|
402
|
-
edit_event_type:
|
|
403
|
-
schematic_component_id:
|
|
404
|
-
original_center:
|
|
405
|
-
new_center:
|
|
409
|
+
edit_event_type: z20.literal("edit_schematic_component_location"),
|
|
410
|
+
schematic_component_id: z20.string(),
|
|
411
|
+
original_center: z20.object({ x: z20.number(), y: z20.number() }),
|
|
412
|
+
new_center: z20.object({ x: z20.number(), y: z20.number() })
|
|
406
413
|
});
|
|
407
414
|
expectTypesMatch(true);
|
|
408
415
|
|
|
409
416
|
// lib/manual-edits/manual-edit-events/edit_pcb_group_location_event.ts
|
|
410
|
-
import { z as
|
|
417
|
+
import { z as z21 } from "zod";
|
|
411
418
|
var edit_pcb_group_location_event = base_manual_edit_event.extend({
|
|
412
|
-
edit_event_type:
|
|
413
|
-
pcb_group_id:
|
|
414
|
-
original_center:
|
|
415
|
-
new_center:
|
|
419
|
+
edit_event_type: z21.literal("edit_pcb_group_location"),
|
|
420
|
+
pcb_group_id: z21.string(),
|
|
421
|
+
original_center: z21.object({ x: z21.number(), y: z21.number() }),
|
|
422
|
+
new_center: z21.object({ x: z21.number(), y: z21.number() })
|
|
416
423
|
});
|
|
417
424
|
expectTypesMatch(true);
|
|
418
425
|
|
|
419
426
|
// lib/manual-edits/manual-edit-events/edit_schematic_group_location_event.ts
|
|
420
|
-
import { z as
|
|
427
|
+
import { z as z22 } from "zod";
|
|
421
428
|
var edit_schematic_group_location_event = base_manual_edit_event.extend({
|
|
422
|
-
edit_event_type:
|
|
423
|
-
schematic_group_id:
|
|
424
|
-
original_center:
|
|
425
|
-
new_center:
|
|
429
|
+
edit_event_type: z22.literal("edit_schematic_group_location"),
|
|
430
|
+
schematic_group_id: z22.string(),
|
|
431
|
+
original_center: z22.object({ x: z22.number(), y: z22.number() }),
|
|
432
|
+
new_center: z22.object({ x: z22.number(), y: z22.number() })
|
|
426
433
|
});
|
|
427
434
|
expectTypesMatch(true);
|
|
428
435
|
|
|
429
436
|
// lib/manual-edits/manual_edit_event.ts
|
|
430
|
-
import { z as
|
|
431
|
-
var manual_edit_event =
|
|
437
|
+
import { z as z23 } from "zod";
|
|
438
|
+
var manual_edit_event = z23.union([
|
|
432
439
|
edit_pcb_component_location_event,
|
|
433
440
|
edit_trace_hint_event,
|
|
434
441
|
edit_schematic_component_location_event
|
|
@@ -436,33 +443,33 @@ var manual_edit_event = z22.union([
|
|
|
436
443
|
expectTypesMatch(true);
|
|
437
444
|
|
|
438
445
|
// lib/manual-edits/manual_edits_file.ts
|
|
439
|
-
import { z as
|
|
446
|
+
import { z as z27 } from "zod";
|
|
440
447
|
|
|
441
448
|
// lib/manual-edits/manual_pcb_placement.ts
|
|
442
|
-
import { z as
|
|
449
|
+
import { z as z24 } from "zod";
|
|
443
450
|
import { point as point2 } from "circuit-json";
|
|
444
|
-
var manual_pcb_placement =
|
|
445
|
-
selector:
|
|
446
|
-
relative_to:
|
|
451
|
+
var manual_pcb_placement = z24.object({
|
|
452
|
+
selector: z24.string(),
|
|
453
|
+
relative_to: z24.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
447
454
|
center: point2
|
|
448
455
|
});
|
|
449
456
|
expectTypesMatch(true);
|
|
450
457
|
|
|
451
458
|
// lib/manual-edits/manual_trace_hint.ts
|
|
452
|
-
import { z as
|
|
459
|
+
import { z as z25 } from "zod";
|
|
453
460
|
import { route_hint_point } from "circuit-json";
|
|
454
|
-
var manual_trace_hint =
|
|
455
|
-
pcb_port_selector:
|
|
456
|
-
offsets:
|
|
461
|
+
var manual_trace_hint = z25.object({
|
|
462
|
+
pcb_port_selector: z25.string(),
|
|
463
|
+
offsets: z25.array(route_hint_point)
|
|
457
464
|
});
|
|
458
465
|
expectTypesMatch(true);
|
|
459
466
|
|
|
460
467
|
// lib/manual-edits/manual_schematic_placement.ts
|
|
461
|
-
import { z as
|
|
468
|
+
import { z as z26 } from "zod";
|
|
462
469
|
import { point as point4 } from "circuit-json";
|
|
463
|
-
var manual_schematic_placement =
|
|
464
|
-
selector:
|
|
465
|
-
relative_to:
|
|
470
|
+
var manual_schematic_placement = z26.object({
|
|
471
|
+
selector: z26.string(),
|
|
472
|
+
relative_to: z26.string().optional().default("group_center").describe("Can be a selector or 'group_center'"),
|
|
466
473
|
center: point4
|
|
467
474
|
});
|
|
468
475
|
expectTypesMatch(
|
|
@@ -470,37 +477,37 @@ expectTypesMatch(
|
|
|
470
477
|
);
|
|
471
478
|
|
|
472
479
|
// lib/manual-edits/manual_edits_file.ts
|
|
473
|
-
var manual_edits_file =
|
|
474
|
-
pcb_placements:
|
|
475
|
-
manual_trace_hints:
|
|
476
|
-
schematic_placements:
|
|
480
|
+
var manual_edits_file = z27.object({
|
|
481
|
+
pcb_placements: z27.array(manual_pcb_placement).optional(),
|
|
482
|
+
manual_trace_hints: z27.array(manual_trace_hint).optional(),
|
|
483
|
+
schematic_placements: z27.array(manual_schematic_placement).optional()
|
|
477
484
|
});
|
|
478
485
|
expectTypesMatch(true);
|
|
479
486
|
|
|
480
487
|
// lib/common/connectionsProp.ts
|
|
481
|
-
import { z as
|
|
482
|
-
var connectionTarget =
|
|
488
|
+
import { z as z28 } from "zod";
|
|
489
|
+
var connectionTarget = z28.string().or(z28.array(z28.string()).readonly()).or(z28.array(z28.string()));
|
|
483
490
|
var createConnectionsProp = (labels) => {
|
|
484
|
-
return
|
|
491
|
+
return z28.record(z28.enum(labels), connectionTarget);
|
|
485
492
|
};
|
|
486
493
|
|
|
487
494
|
// lib/components/group.ts
|
|
488
|
-
var layoutConfig =
|
|
489
|
-
layoutMode:
|
|
490
|
-
position:
|
|
491
|
-
grid:
|
|
492
|
-
gridCols:
|
|
493
|
-
gridRows:
|
|
494
|
-
gridTemplateRows:
|
|
495
|
-
gridTemplateColumns:
|
|
496
|
-
gridTemplate:
|
|
497
|
-
gridGap:
|
|
498
|
-
gridRowGap:
|
|
499
|
-
gridColumnGap:
|
|
500
|
-
flex:
|
|
501
|
-
flexDirection:
|
|
502
|
-
alignItems:
|
|
503
|
-
justifyContent:
|
|
495
|
+
var layoutConfig = z29.object({
|
|
496
|
+
layoutMode: z29.enum(["grid", "flex", "match-adapt", "relative", "none"]).optional(),
|
|
497
|
+
position: z29.enum(["absolute", "relative"]).optional(),
|
|
498
|
+
grid: z29.boolean().optional(),
|
|
499
|
+
gridCols: z29.number().or(z29.string()).optional(),
|
|
500
|
+
gridRows: z29.number().or(z29.string()).optional(),
|
|
501
|
+
gridTemplateRows: z29.string().optional(),
|
|
502
|
+
gridTemplateColumns: z29.string().optional(),
|
|
503
|
+
gridTemplate: z29.string().optional(),
|
|
504
|
+
gridGap: z29.number().or(z29.string()).optional(),
|
|
505
|
+
gridRowGap: z29.number().or(z29.string()).optional(),
|
|
506
|
+
gridColumnGap: z29.number().or(z29.string()).optional(),
|
|
507
|
+
flex: z29.boolean().or(z29.string()).optional(),
|
|
508
|
+
flexDirection: z29.enum(["row", "column"]).optional(),
|
|
509
|
+
alignItems: z29.enum(["start", "center", "end", "stretch"]).optional(),
|
|
510
|
+
justifyContent: z29.enum([
|
|
504
511
|
"start",
|
|
505
512
|
"center",
|
|
506
513
|
"end",
|
|
@@ -509,16 +516,16 @@ var layoutConfig = z28.object({
|
|
|
509
516
|
"space-around",
|
|
510
517
|
"space-evenly"
|
|
511
518
|
]).optional(),
|
|
512
|
-
flexRow:
|
|
513
|
-
flexColumn:
|
|
514
|
-
gap:
|
|
515
|
-
pack:
|
|
516
|
-
packOrderStrategy:
|
|
519
|
+
flexRow: z29.boolean().optional(),
|
|
520
|
+
flexColumn: z29.boolean().optional(),
|
|
521
|
+
gap: z29.number().or(z29.string()).optional(),
|
|
522
|
+
pack: z29.boolean().optional().describe("Pack the contents of this group using a packing strategy"),
|
|
523
|
+
packOrderStrategy: z29.enum([
|
|
517
524
|
"largest_to_smallest",
|
|
518
525
|
"first_to_last",
|
|
519
526
|
"highest_to_lowest_pin_count"
|
|
520
527
|
]).optional(),
|
|
521
|
-
packPlacementStrategy:
|
|
528
|
+
packPlacementStrategy: z29.enum(["shortest_connection_along_outline"]).optional(),
|
|
522
529
|
padding: length2.optional(),
|
|
523
530
|
paddingLeft: length2.optional(),
|
|
524
531
|
paddingRight: length2.optional(),
|
|
@@ -528,28 +535,28 @@ var layoutConfig = z28.object({
|
|
|
528
535
|
paddingY: length2.optional(),
|
|
529
536
|
width: length2.optional(),
|
|
530
537
|
height: length2.optional(),
|
|
531
|
-
matchAdapt:
|
|
532
|
-
matchAdaptTemplate:
|
|
538
|
+
matchAdapt: z29.boolean().optional(),
|
|
539
|
+
matchAdaptTemplate: z29.any().optional()
|
|
533
540
|
});
|
|
534
541
|
expectTypesMatch(true);
|
|
535
|
-
var border =
|
|
542
|
+
var border = z29.object({
|
|
536
543
|
strokeWidth: length2.optional(),
|
|
537
|
-
dashed:
|
|
538
|
-
solid:
|
|
539
|
-
});
|
|
540
|
-
var pcbPositionAnchorAutocomplete =
|
|
541
|
-
var autorouterConfig =
|
|
542
|
-
serverUrl:
|
|
543
|
-
inputFormat:
|
|
544
|
-
serverMode:
|
|
545
|
-
serverCacheEnabled:
|
|
546
|
-
cache:
|
|
544
|
+
dashed: z29.boolean().optional(),
|
|
545
|
+
solid: z29.boolean().optional()
|
|
546
|
+
});
|
|
547
|
+
var pcbPositionAnchorAutocomplete = z29.custom((value) => typeof value === "string");
|
|
548
|
+
var autorouterConfig = z29.object({
|
|
549
|
+
serverUrl: z29.string().optional(),
|
|
550
|
+
inputFormat: z29.enum(["simplified", "circuit-json"]).optional(),
|
|
551
|
+
serverMode: z29.enum(["job", "solve-endpoint"]).optional(),
|
|
552
|
+
serverCacheEnabled: z29.boolean().optional(),
|
|
553
|
+
cache: z29.custom((v) => true).optional(),
|
|
547
554
|
traceClearance: length2.optional(),
|
|
548
|
-
groupMode:
|
|
549
|
-
algorithmFn:
|
|
555
|
+
groupMode: z29.enum(["sequential_trace", "subcircuit", "sequential-trace"]).optional(),
|
|
556
|
+
algorithmFn: z29.custom(
|
|
550
557
|
(v) => typeof v === "function" || v === void 0
|
|
551
558
|
).optional(),
|
|
552
|
-
preset:
|
|
559
|
+
preset: z29.enum([
|
|
553
560
|
"sequential_trace",
|
|
554
561
|
"subcircuit",
|
|
555
562
|
"auto",
|
|
@@ -561,54 +568,54 @@ var autorouterConfig = z28.object({
|
|
|
561
568
|
"auto-local",
|
|
562
569
|
"auto-cloud"
|
|
563
570
|
]).optional(),
|
|
564
|
-
local:
|
|
565
|
-
});
|
|
566
|
-
var autorouterPreset =
|
|
567
|
-
|
|
568
|
-
|
|
569
|
-
|
|
570
|
-
|
|
571
|
-
|
|
572
|
-
|
|
573
|
-
|
|
571
|
+
local: z29.boolean().optional()
|
|
572
|
+
});
|
|
573
|
+
var autorouterPreset = z29.union([
|
|
574
|
+
z29.literal("sequential_trace"),
|
|
575
|
+
z29.literal("subcircuit"),
|
|
576
|
+
z29.literal("auto"),
|
|
577
|
+
z29.literal("auto_local"),
|
|
578
|
+
z29.literal("auto_cloud"),
|
|
579
|
+
z29.literal("freerouting"),
|
|
580
|
+
z29.literal("laser_prefab"),
|
|
574
581
|
// Prefabricated PCB with laser copper ablation
|
|
575
|
-
|
|
576
|
-
|
|
577
|
-
|
|
582
|
+
z29.literal("sequential-trace"),
|
|
583
|
+
z29.literal("auto-local"),
|
|
584
|
+
z29.literal("auto-cloud")
|
|
578
585
|
]);
|
|
579
|
-
var autorouterString =
|
|
580
|
-
var autorouterProp =
|
|
586
|
+
var autorouterString = z29.string();
|
|
587
|
+
var autorouterProp = z29.union([
|
|
581
588
|
autorouterConfig,
|
|
582
589
|
autorouterPreset,
|
|
583
590
|
autorouterString
|
|
584
591
|
]);
|
|
585
592
|
var baseGroupProps = commonLayoutProps.extend({
|
|
586
|
-
name:
|
|
587
|
-
children:
|
|
588
|
-
schTitle:
|
|
589
|
-
key:
|
|
590
|
-
showAsSchematicBox:
|
|
591
|
-
connections:
|
|
593
|
+
name: z29.string().optional(),
|
|
594
|
+
children: z29.any().optional(),
|
|
595
|
+
schTitle: z29.string().optional(),
|
|
596
|
+
key: z29.any().optional(),
|
|
597
|
+
showAsSchematicBox: z29.boolean().optional(),
|
|
598
|
+
connections: z29.record(z29.string(), connectionTarget.optional()).optional(),
|
|
592
599
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
593
600
|
schPinSpacing: length2.optional(),
|
|
594
601
|
schPinStyle: schematicPinStyle.optional(),
|
|
595
602
|
...layoutConfig.shape,
|
|
596
603
|
grid: layoutConfig.shape.grid.describe("@deprecated use pcbGrid"),
|
|
597
604
|
flex: layoutConfig.shape.flex.describe("@deprecated use pcbFlex"),
|
|
598
|
-
pcbGrid:
|
|
599
|
-
pcbGridCols:
|
|
600
|
-
pcbGridRows:
|
|
601
|
-
pcbGridTemplateRows:
|
|
602
|
-
pcbGridTemplateColumns:
|
|
603
|
-
pcbGridTemplate:
|
|
604
|
-
pcbGridGap:
|
|
605
|
-
pcbGridRowGap:
|
|
606
|
-
pcbGridColumnGap:
|
|
607
|
-
pcbFlex:
|
|
608
|
-
pcbFlexGap:
|
|
609
|
-
pcbFlexDirection:
|
|
610
|
-
pcbAlignItems:
|
|
611
|
-
pcbJustifyContent:
|
|
605
|
+
pcbGrid: z29.boolean().optional(),
|
|
606
|
+
pcbGridCols: z29.number().or(z29.string()).optional(),
|
|
607
|
+
pcbGridRows: z29.number().or(z29.string()).optional(),
|
|
608
|
+
pcbGridTemplateRows: z29.string().optional(),
|
|
609
|
+
pcbGridTemplateColumns: z29.string().optional(),
|
|
610
|
+
pcbGridTemplate: z29.string().optional(),
|
|
611
|
+
pcbGridGap: z29.number().or(z29.string()).optional(),
|
|
612
|
+
pcbGridRowGap: z29.number().or(z29.string()).optional(),
|
|
613
|
+
pcbGridColumnGap: z29.number().or(z29.string()).optional(),
|
|
614
|
+
pcbFlex: z29.boolean().or(z29.string()).optional(),
|
|
615
|
+
pcbFlexGap: z29.number().or(z29.string()).optional(),
|
|
616
|
+
pcbFlexDirection: z29.enum(["row", "column"]).optional(),
|
|
617
|
+
pcbAlignItems: z29.enum(["start", "center", "end", "stretch"]).optional(),
|
|
618
|
+
pcbJustifyContent: z29.enum([
|
|
612
619
|
"start",
|
|
613
620
|
"center",
|
|
614
621
|
"end",
|
|
@@ -617,25 +624,25 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
617
624
|
"space-around",
|
|
618
625
|
"space-evenly"
|
|
619
626
|
]).optional(),
|
|
620
|
-
pcbFlexRow:
|
|
621
|
-
pcbFlexColumn:
|
|
622
|
-
pcbGap:
|
|
623
|
-
pcbPack:
|
|
624
|
-
pcbPackGap:
|
|
625
|
-
schGrid:
|
|
626
|
-
schGridCols:
|
|
627
|
-
schGridRows:
|
|
628
|
-
schGridTemplateRows:
|
|
629
|
-
schGridTemplateColumns:
|
|
630
|
-
schGridTemplate:
|
|
631
|
-
schGridGap:
|
|
632
|
-
schGridRowGap:
|
|
633
|
-
schGridColumnGap:
|
|
634
|
-
schFlex:
|
|
635
|
-
schFlexGap:
|
|
636
|
-
schFlexDirection:
|
|
637
|
-
schAlignItems:
|
|
638
|
-
schJustifyContent:
|
|
627
|
+
pcbFlexRow: z29.boolean().optional(),
|
|
628
|
+
pcbFlexColumn: z29.boolean().optional(),
|
|
629
|
+
pcbGap: z29.number().or(z29.string()).optional(),
|
|
630
|
+
pcbPack: z29.boolean().optional(),
|
|
631
|
+
pcbPackGap: z29.number().or(z29.string()).optional(),
|
|
632
|
+
schGrid: z29.boolean().optional(),
|
|
633
|
+
schGridCols: z29.number().or(z29.string()).optional(),
|
|
634
|
+
schGridRows: z29.number().or(z29.string()).optional(),
|
|
635
|
+
schGridTemplateRows: z29.string().optional(),
|
|
636
|
+
schGridTemplateColumns: z29.string().optional(),
|
|
637
|
+
schGridTemplate: z29.string().optional(),
|
|
638
|
+
schGridGap: z29.number().or(z29.string()).optional(),
|
|
639
|
+
schGridRowGap: z29.number().or(z29.string()).optional(),
|
|
640
|
+
schGridColumnGap: z29.number().or(z29.string()).optional(),
|
|
641
|
+
schFlex: z29.boolean().or(z29.string()).optional(),
|
|
642
|
+
schFlexGap: z29.number().or(z29.string()).optional(),
|
|
643
|
+
schFlexDirection: z29.enum(["row", "column"]).optional(),
|
|
644
|
+
schAlignItems: z29.enum(["start", "center", "end", "stretch"]).optional(),
|
|
645
|
+
schJustifyContent: z29.enum([
|
|
639
646
|
"start",
|
|
640
647
|
"center",
|
|
641
648
|
"end",
|
|
@@ -644,11 +651,11 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
644
651
|
"space-around",
|
|
645
652
|
"space-evenly"
|
|
646
653
|
]).optional(),
|
|
647
|
-
schFlexRow:
|
|
648
|
-
schFlexColumn:
|
|
649
|
-
schGap:
|
|
650
|
-
schPack:
|
|
651
|
-
schMatchAdapt:
|
|
654
|
+
schFlexRow: z29.boolean().optional(),
|
|
655
|
+
schFlexColumn: z29.boolean().optional(),
|
|
656
|
+
schGap: z29.number().or(z29.string()).optional(),
|
|
657
|
+
schPack: z29.boolean().optional(),
|
|
658
|
+
schMatchAdapt: z29.boolean().optional(),
|
|
652
659
|
pcbWidth: length2.optional(),
|
|
653
660
|
pcbHeight: length2.optional(),
|
|
654
661
|
minTraceWidth: length2.optional(),
|
|
@@ -670,33 +677,33 @@ var baseGroupProps = commonLayoutProps.extend({
|
|
|
670
677
|
pcbPaddingBottom: length2.optional(),
|
|
671
678
|
pcbPositionAnchor: pcbPositionAnchorAutocomplete.optional()
|
|
672
679
|
});
|
|
673
|
-
var partsEngine =
|
|
680
|
+
var partsEngine = z29.custom((v) => "findPart" in v);
|
|
674
681
|
var subcircuitGroupProps = baseGroupProps.extend({
|
|
675
682
|
manualEdits: manual_edits_file.optional(),
|
|
676
|
-
schAutoLayoutEnabled:
|
|
677
|
-
schTraceAutoLabelEnabled:
|
|
678
|
-
schMaxTraceDistance:
|
|
679
|
-
routingDisabled:
|
|
683
|
+
schAutoLayoutEnabled: z29.boolean().optional(),
|
|
684
|
+
schTraceAutoLabelEnabled: z29.boolean().optional(),
|
|
685
|
+
schMaxTraceDistance: distance8.optional(),
|
|
686
|
+
routingDisabled: z29.boolean().optional(),
|
|
680
687
|
defaultTraceWidth: length2.optional(),
|
|
681
688
|
minTraceWidth: length2.optional(),
|
|
682
689
|
partsEngine: partsEngine.optional(),
|
|
683
|
-
pcbRouteCache:
|
|
690
|
+
pcbRouteCache: z29.custom((v) => true).optional(),
|
|
684
691
|
autorouter: autorouterProp.optional(),
|
|
685
|
-
square:
|
|
686
|
-
emptyArea:
|
|
687
|
-
filledArea:
|
|
688
|
-
width:
|
|
689
|
-
height:
|
|
690
|
-
outline:
|
|
691
|
-
outlineOffsetX:
|
|
692
|
-
outlineOffsetY:
|
|
693
|
-
circuitJson:
|
|
692
|
+
square: z29.boolean().optional(),
|
|
693
|
+
emptyArea: z29.string().optional(),
|
|
694
|
+
filledArea: z29.string().optional(),
|
|
695
|
+
width: distance8.optional(),
|
|
696
|
+
height: distance8.optional(),
|
|
697
|
+
outline: z29.array(point).optional(),
|
|
698
|
+
outlineOffsetX: distance8.optional(),
|
|
699
|
+
outlineOffsetY: distance8.optional(),
|
|
700
|
+
circuitJson: z29.array(z29.any()).optional()
|
|
694
701
|
});
|
|
695
702
|
var subcircuitGroupPropsWithBool = subcircuitGroupProps.extend({
|
|
696
|
-
subcircuit:
|
|
703
|
+
subcircuit: z29.literal(true)
|
|
697
704
|
});
|
|
698
|
-
var groupProps =
|
|
699
|
-
baseGroupProps.extend({ subcircuit:
|
|
705
|
+
var groupProps = z29.discriminatedUnion("subcircuit", [
|
|
706
|
+
baseGroupProps.extend({ subcircuit: z29.literal(false).optional() }),
|
|
700
707
|
subcircuitGroupPropsWithBool
|
|
701
708
|
]);
|
|
702
709
|
expectTypesMatch(true);
|
|
@@ -705,34 +712,34 @@ expectTypesMatch(true);
|
|
|
705
712
|
expectTypesMatch(true);
|
|
706
713
|
|
|
707
714
|
// lib/components/board.ts
|
|
708
|
-
var boardColor =
|
|
715
|
+
var boardColor = z30.custom((value) => typeof value === "string");
|
|
709
716
|
var boardProps = subcircuitGroupProps.omit({ connections: true }).extend({
|
|
710
|
-
material:
|
|
711
|
-
layers:
|
|
712
|
-
|
|
713
|
-
|
|
714
|
-
|
|
715
|
-
|
|
716
|
-
|
|
717
|
+
material: z30.enum(["fr4", "fr1"]).default("fr4"),
|
|
718
|
+
layers: z30.union([
|
|
719
|
+
z30.literal(1),
|
|
720
|
+
z30.literal(2),
|
|
721
|
+
z30.literal(4),
|
|
722
|
+
z30.literal(6),
|
|
723
|
+
z30.literal(8)
|
|
717
724
|
]).default(2),
|
|
718
725
|
borderRadius: distance.optional(),
|
|
719
726
|
thickness: distance.optional(),
|
|
720
727
|
boardAnchorPosition: point.optional(),
|
|
721
728
|
boardAnchorAlignment: ninePointAnchor.optional(),
|
|
722
|
-
title:
|
|
729
|
+
title: z30.string().optional(),
|
|
723
730
|
solderMaskColor: boardColor.optional(),
|
|
724
731
|
topSolderMaskColor: boardColor.optional(),
|
|
725
732
|
bottomSolderMaskColor: boardColor.optional(),
|
|
726
733
|
silkscreenColor: boardColor.optional(),
|
|
727
734
|
topSilkscreenColor: boardColor.optional(),
|
|
728
735
|
bottomSilkscreenColor: boardColor.optional(),
|
|
729
|
-
doubleSidedAssembly:
|
|
730
|
-
schematicDisabled:
|
|
736
|
+
doubleSidedAssembly: z30.boolean().optional().default(false),
|
|
737
|
+
schematicDisabled: z30.boolean().optional()
|
|
731
738
|
});
|
|
732
739
|
expectTypesMatch(true);
|
|
733
740
|
|
|
734
741
|
// lib/components/panel.ts
|
|
735
|
-
import { z as
|
|
742
|
+
import { z as z31 } from "zod";
|
|
736
743
|
var panelProps = baseGroupProps.omit({
|
|
737
744
|
width: true,
|
|
738
745
|
height: true,
|
|
@@ -740,57 +747,57 @@ var panelProps = baseGroupProps.omit({
|
|
|
740
747
|
}).extend({
|
|
741
748
|
width: distance,
|
|
742
749
|
height: distance,
|
|
743
|
-
children:
|
|
744
|
-
noSolderMask:
|
|
745
|
-
panelizationMethod:
|
|
750
|
+
children: z31.any().optional(),
|
|
751
|
+
noSolderMask: z31.boolean().optional(),
|
|
752
|
+
panelizationMethod: z31.enum(["tab-routing", "none"]).optional(),
|
|
746
753
|
boardGap: distance.optional(),
|
|
747
754
|
tabWidth: distance.optional(),
|
|
748
755
|
tabLength: distance.optional(),
|
|
749
|
-
mouseBites:
|
|
756
|
+
mouseBites: z31.boolean().optional()
|
|
750
757
|
});
|
|
751
758
|
expectTypesMatch(true);
|
|
752
759
|
|
|
753
760
|
// lib/components/breakout.ts
|
|
754
|
-
import { distance as
|
|
761
|
+
import { distance as distance9 } from "circuit-json";
|
|
755
762
|
import "zod";
|
|
756
763
|
var breakoutProps = subcircuitGroupProps.extend({
|
|
757
|
-
padding:
|
|
758
|
-
paddingLeft:
|
|
759
|
-
paddingRight:
|
|
760
|
-
paddingTop:
|
|
761
|
-
paddingBottom:
|
|
764
|
+
padding: distance9.optional(),
|
|
765
|
+
paddingLeft: distance9.optional(),
|
|
766
|
+
paddingRight: distance9.optional(),
|
|
767
|
+
paddingTop: distance9.optional(),
|
|
768
|
+
paddingBottom: distance9.optional()
|
|
762
769
|
});
|
|
763
770
|
expectTypesMatch(true);
|
|
764
771
|
|
|
765
772
|
// lib/components/chip.ts
|
|
766
|
-
import { distance as
|
|
767
|
-
import { z as
|
|
768
|
-
var connectionTarget2 =
|
|
769
|
-
var connectionsProp =
|
|
770
|
-
var pinLabelsProp =
|
|
773
|
+
import { distance as distance10, supplier_name as supplier_name2 } from "circuit-json";
|
|
774
|
+
import { z as z33 } from "zod";
|
|
775
|
+
var connectionTarget2 = z33.string().or(z33.array(z33.string()).readonly()).or(z33.array(z33.string()));
|
|
776
|
+
var connectionsProp = z33.custom().pipe(z33.record(z33.string(), connectionTarget2));
|
|
777
|
+
var pinLabelsProp = z33.record(
|
|
771
778
|
schematicPinLabel,
|
|
772
|
-
schematicPinLabel.or(
|
|
779
|
+
schematicPinLabel.or(z33.array(schematicPinLabel).readonly()).or(z33.array(schematicPinLabel))
|
|
773
780
|
);
|
|
774
781
|
expectTypesMatch(true);
|
|
775
|
-
var pinCompatibleVariant =
|
|
776
|
-
manufacturerPartNumber:
|
|
777
|
-
supplierPartNumber:
|
|
782
|
+
var pinCompatibleVariant = z33.object({
|
|
783
|
+
manufacturerPartNumber: z33.string().optional(),
|
|
784
|
+
supplierPartNumber: z33.record(supplier_name2, z33.array(z33.string())).optional()
|
|
778
785
|
});
|
|
779
786
|
var chipProps = commonComponentProps.extend({
|
|
780
|
-
manufacturerPartNumber:
|
|
787
|
+
manufacturerPartNumber: z33.string().optional(),
|
|
781
788
|
pinLabels: pinLabelsProp.optional(),
|
|
782
|
-
showPinAliases:
|
|
783
|
-
pcbPinLabels:
|
|
784
|
-
internallyConnectedPins:
|
|
785
|
-
externallyConnectedPins:
|
|
789
|
+
showPinAliases: z33.boolean().optional(),
|
|
790
|
+
pcbPinLabels: z33.record(z33.string(), z33.string()).optional(),
|
|
791
|
+
internallyConnectedPins: z33.array(z33.array(z33.union([z33.string(), z33.number()]))).optional(),
|
|
792
|
+
externallyConnectedPins: z33.array(z33.array(z33.string())).optional(),
|
|
786
793
|
schPinArrangement: schematicPortArrangement.optional(),
|
|
787
794
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
788
|
-
pinCompatibleVariants:
|
|
795
|
+
pinCompatibleVariants: z33.array(pinCompatibleVariant).optional(),
|
|
789
796
|
schPinStyle: schematicPinStyle.optional(),
|
|
790
|
-
schPinSpacing:
|
|
791
|
-
schWidth:
|
|
792
|
-
schHeight:
|
|
793
|
-
noSchematicRepresentation:
|
|
797
|
+
schPinSpacing: distance10.optional(),
|
|
798
|
+
schWidth: distance10.optional(),
|
|
799
|
+
schHeight: distance10.optional(),
|
|
800
|
+
noSchematicRepresentation: z33.boolean().optional(),
|
|
794
801
|
connections: connectionsProp.optional()
|
|
795
802
|
});
|
|
796
803
|
var bugProps = chipProps;
|
|
@@ -801,177 +808,177 @@ var pinoutProps = chipProps;
|
|
|
801
808
|
expectTypesMatch(true);
|
|
802
809
|
|
|
803
810
|
// lib/components/jumper.ts
|
|
804
|
-
import { distance as
|
|
805
|
-
import { z as
|
|
811
|
+
import { distance as distance11 } from "circuit-json";
|
|
812
|
+
import { z as z34 } from "zod";
|
|
806
813
|
var jumperProps = commonComponentProps.extend({
|
|
807
|
-
manufacturerPartNumber:
|
|
808
|
-
pinLabels:
|
|
809
|
-
|
|
810
|
-
schematicPinLabel.or(
|
|
814
|
+
manufacturerPartNumber: z34.string().optional(),
|
|
815
|
+
pinLabels: z34.record(
|
|
816
|
+
z34.number().or(schematicPinLabel),
|
|
817
|
+
schematicPinLabel.or(z34.array(schematicPinLabel))
|
|
811
818
|
).optional(),
|
|
812
819
|
schPinStyle: schematicPinStyle.optional(),
|
|
813
|
-
schPinSpacing:
|
|
814
|
-
schWidth:
|
|
815
|
-
schHeight:
|
|
816
|
-
schDirection:
|
|
820
|
+
schPinSpacing: distance11.optional(),
|
|
821
|
+
schWidth: distance11.optional(),
|
|
822
|
+
schHeight: distance11.optional(),
|
|
823
|
+
schDirection: z34.enum(["left", "right"]).optional(),
|
|
817
824
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
818
825
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
819
|
-
pcbPinLabels:
|
|
820
|
-
pinCount:
|
|
821
|
-
internallyConnectedPins:
|
|
822
|
-
connections:
|
|
826
|
+
pcbPinLabels: z34.record(z34.string(), z34.string()).optional(),
|
|
827
|
+
pinCount: z34.union([z34.literal(2), z34.literal(3)]).optional(),
|
|
828
|
+
internallyConnectedPins: z34.array(z34.array(z34.union([z34.string(), z34.number()]))).optional(),
|
|
829
|
+
connections: z34.custom().pipe(z34.record(z34.string(), connectionTarget)).optional()
|
|
823
830
|
});
|
|
824
831
|
expectTypesMatch(true);
|
|
825
832
|
|
|
826
833
|
// lib/components/solderjumper.ts
|
|
827
|
-
import { z as
|
|
834
|
+
import { z as z35 } from "zod";
|
|
828
835
|
var solderjumperProps = jumperProps.extend({
|
|
829
|
-
bridgedPins:
|
|
830
|
-
bridged:
|
|
836
|
+
bridgedPins: z35.array(z35.array(z35.string())).optional(),
|
|
837
|
+
bridged: z35.boolean().optional()
|
|
831
838
|
});
|
|
832
839
|
expectTypesMatch(true);
|
|
833
840
|
|
|
834
841
|
// lib/components/connector.ts
|
|
835
|
-
import { distance as
|
|
836
|
-
import { z as
|
|
842
|
+
import { distance as distance12 } from "circuit-json";
|
|
843
|
+
import { z as z36 } from "zod";
|
|
837
844
|
var connectorProps = commonComponentProps.extend({
|
|
838
|
-
manufacturerPartNumber:
|
|
839
|
-
pinLabels:
|
|
840
|
-
|
|
841
|
-
schematicPinLabel.or(
|
|
845
|
+
manufacturerPartNumber: z36.string().optional(),
|
|
846
|
+
pinLabels: z36.record(
|
|
847
|
+
z36.number().or(schematicPinLabel),
|
|
848
|
+
schematicPinLabel.or(z36.array(schematicPinLabel))
|
|
842
849
|
).optional(),
|
|
843
850
|
schPinStyle: schematicPinStyle.optional(),
|
|
844
|
-
schPinSpacing:
|
|
845
|
-
schWidth:
|
|
846
|
-
schHeight:
|
|
847
|
-
schDirection:
|
|
851
|
+
schPinSpacing: distance12.optional(),
|
|
852
|
+
schWidth: distance12.optional(),
|
|
853
|
+
schHeight: distance12.optional(),
|
|
854
|
+
schDirection: z36.enum(["left", "right"]).optional(),
|
|
848
855
|
schPortArrangement: schematicPortArrangement.optional(),
|
|
849
|
-
internallyConnectedPins:
|
|
850
|
-
standard:
|
|
856
|
+
internallyConnectedPins: z36.array(z36.array(z36.union([z36.string(), z36.number()]))).optional(),
|
|
857
|
+
standard: z36.enum(["usb_c", "m2"]).optional()
|
|
851
858
|
});
|
|
852
859
|
expectTypesMatch(true);
|
|
853
860
|
|
|
854
861
|
// lib/components/interconnect.ts
|
|
855
|
-
import { z as
|
|
862
|
+
import { z as z37 } from "zod";
|
|
856
863
|
var interconnectProps = commonComponentProps.extend({
|
|
857
|
-
standard:
|
|
864
|
+
standard: z37.enum(["TSC0001_36P_XALT_2025_11"]).optional()
|
|
858
865
|
});
|
|
859
866
|
expectTypesMatch(true);
|
|
860
867
|
|
|
861
868
|
// lib/components/fuse.ts
|
|
862
|
-
import { z as
|
|
869
|
+
import { z as z38 } from "zod";
|
|
863
870
|
var fusePinLabels = ["pin1", "pin2"];
|
|
864
871
|
var fuseProps = commonComponentProps.extend({
|
|
865
|
-
currentRating:
|
|
866
|
-
voltageRating:
|
|
867
|
-
schShowRatings:
|
|
872
|
+
currentRating: z38.union([z38.number(), z38.string()]),
|
|
873
|
+
voltageRating: z38.union([z38.number(), z38.string()]).optional(),
|
|
874
|
+
schShowRatings: z38.boolean().optional(),
|
|
868
875
|
schOrientation: schematicOrientation.optional(),
|
|
869
|
-
connections:
|
|
870
|
-
|
|
871
|
-
|
|
872
|
-
|
|
873
|
-
|
|
874
|
-
|
|
876
|
+
connections: z38.record(
|
|
877
|
+
z38.string(),
|
|
878
|
+
z38.union([
|
|
879
|
+
z38.string(),
|
|
880
|
+
z38.array(z38.string()).readonly(),
|
|
881
|
+
z38.array(z38.string())
|
|
875
882
|
])
|
|
876
883
|
).optional()
|
|
877
884
|
});
|
|
878
885
|
|
|
879
886
|
// lib/components/platedhole.ts
|
|
880
|
-
import { distance as
|
|
881
|
-
import { z as
|
|
882
|
-
var distanceHiddenUndefined =
|
|
887
|
+
import { distance as distance13 } from "circuit-json";
|
|
888
|
+
import { z as z39 } from "zod";
|
|
889
|
+
var distanceHiddenUndefined = z39.custom().transform((a) => {
|
|
883
890
|
if (a === void 0) return void 0;
|
|
884
|
-
return
|
|
891
|
+
return distance13.parse(a);
|
|
885
892
|
});
|
|
886
|
-
var platedHoleProps =
|
|
893
|
+
var platedHoleProps = z39.discriminatedUnion("shape", [
|
|
887
894
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
888
|
-
name:
|
|
889
|
-
connectsTo:
|
|
890
|
-
shape:
|
|
891
|
-
holeDiameter:
|
|
892
|
-
outerDiameter:
|
|
893
|
-
padDiameter:
|
|
895
|
+
name: z39.string().optional(),
|
|
896
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
897
|
+
shape: z39.literal("circle"),
|
|
898
|
+
holeDiameter: distance13,
|
|
899
|
+
outerDiameter: distance13,
|
|
900
|
+
padDiameter: distance13.optional().describe("Diameter of the copper pad"),
|
|
894
901
|
portHints: portHints.optional(),
|
|
895
|
-
solderMaskMargin:
|
|
896
|
-
coveredWithSolderMask:
|
|
902
|
+
solderMaskMargin: distance13.optional(),
|
|
903
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
897
904
|
}),
|
|
898
905
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
899
|
-
name:
|
|
900
|
-
connectsTo:
|
|
901
|
-
shape:
|
|
902
|
-
outerWidth:
|
|
903
|
-
outerHeight:
|
|
906
|
+
name: z39.string().optional(),
|
|
907
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
908
|
+
shape: z39.literal("oval"),
|
|
909
|
+
outerWidth: distance13,
|
|
910
|
+
outerHeight: distance13,
|
|
904
911
|
holeWidth: distanceHiddenUndefined,
|
|
905
912
|
holeHeight: distanceHiddenUndefined,
|
|
906
|
-
innerWidth:
|
|
907
|
-
innerHeight:
|
|
913
|
+
innerWidth: distance13.optional().describe("DEPRECATED use holeWidth"),
|
|
914
|
+
innerHeight: distance13.optional().describe("DEPRECATED use holeHeight"),
|
|
908
915
|
portHints: portHints.optional(),
|
|
909
|
-
solderMaskMargin:
|
|
910
|
-
coveredWithSolderMask:
|
|
916
|
+
solderMaskMargin: distance13.optional(),
|
|
917
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
911
918
|
}),
|
|
912
919
|
pcbLayoutProps.omit({ layer: true }).extend({
|
|
913
|
-
name:
|
|
914
|
-
connectsTo:
|
|
915
|
-
shape:
|
|
916
|
-
rectPad:
|
|
917
|
-
outerWidth:
|
|
918
|
-
outerHeight:
|
|
920
|
+
name: z39.string().optional(),
|
|
921
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
922
|
+
shape: z39.literal("pill"),
|
|
923
|
+
rectPad: z39.boolean().optional(),
|
|
924
|
+
outerWidth: distance13,
|
|
925
|
+
outerHeight: distance13,
|
|
919
926
|
holeWidth: distanceHiddenUndefined,
|
|
920
927
|
holeHeight: distanceHiddenUndefined,
|
|
921
|
-
innerWidth:
|
|
922
|
-
innerHeight:
|
|
928
|
+
innerWidth: distance13.optional().describe("DEPRECATED use holeWidth"),
|
|
929
|
+
innerHeight: distance13.optional().describe("DEPRECATED use holeHeight"),
|
|
923
930
|
portHints: portHints.optional(),
|
|
924
|
-
holeOffsetX:
|
|
925
|
-
holeOffsetY:
|
|
926
|
-
solderMaskMargin:
|
|
927
|
-
coveredWithSolderMask:
|
|
931
|
+
holeOffsetX: distance13.optional(),
|
|
932
|
+
holeOffsetY: distance13.optional(),
|
|
933
|
+
solderMaskMargin: distance13.optional(),
|
|
934
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
928
935
|
}),
|
|
929
936
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
930
|
-
name:
|
|
931
|
-
connectsTo:
|
|
932
|
-
shape:
|
|
933
|
-
holeDiameter:
|
|
934
|
-
rectPadWidth:
|
|
935
|
-
rectPadHeight:
|
|
936
|
-
rectBorderRadius:
|
|
937
|
-
holeShape:
|
|
938
|
-
padShape:
|
|
937
|
+
name: z39.string().optional(),
|
|
938
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
939
|
+
shape: z39.literal("circular_hole_with_rect_pad"),
|
|
940
|
+
holeDiameter: distance13,
|
|
941
|
+
rectPadWidth: distance13,
|
|
942
|
+
rectPadHeight: distance13,
|
|
943
|
+
rectBorderRadius: distance13.optional(),
|
|
944
|
+
holeShape: z39.literal("circle").optional(),
|
|
945
|
+
padShape: z39.literal("rect").optional(),
|
|
939
946
|
portHints: portHints.optional(),
|
|
940
|
-
holeOffsetX:
|
|
941
|
-
holeOffsetY:
|
|
942
|
-
solderMaskMargin:
|
|
943
|
-
coveredWithSolderMask:
|
|
947
|
+
holeOffsetX: distance13.optional(),
|
|
948
|
+
holeOffsetY: distance13.optional(),
|
|
949
|
+
solderMaskMargin: distance13.optional(),
|
|
950
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
944
951
|
}),
|
|
945
952
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
946
|
-
name:
|
|
947
|
-
connectsTo:
|
|
948
|
-
shape:
|
|
949
|
-
holeShape:
|
|
950
|
-
padShape:
|
|
951
|
-
holeWidth:
|
|
952
|
-
holeHeight:
|
|
953
|
-
rectPadWidth:
|
|
954
|
-
rectPadHeight:
|
|
953
|
+
name: z39.string().optional(),
|
|
954
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
955
|
+
shape: z39.literal("pill_hole_with_rect_pad"),
|
|
956
|
+
holeShape: z39.literal("pill"),
|
|
957
|
+
padShape: z39.literal("rect"),
|
|
958
|
+
holeWidth: distance13,
|
|
959
|
+
holeHeight: distance13,
|
|
960
|
+
rectPadWidth: distance13,
|
|
961
|
+
rectPadHeight: distance13,
|
|
955
962
|
portHints: portHints.optional(),
|
|
956
|
-
holeOffsetX:
|
|
957
|
-
holeOffsetY:
|
|
958
|
-
solderMaskMargin:
|
|
959
|
-
coveredWithSolderMask:
|
|
963
|
+
holeOffsetX: distance13.optional(),
|
|
964
|
+
holeOffsetY: distance13.optional(),
|
|
965
|
+
solderMaskMargin: distance13.optional(),
|
|
966
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
960
967
|
}),
|
|
961
968
|
pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
962
|
-
name:
|
|
963
|
-
connectsTo:
|
|
964
|
-
shape:
|
|
965
|
-
holeShape:
|
|
966
|
-
holeDiameter:
|
|
967
|
-
holeWidth:
|
|
968
|
-
holeHeight:
|
|
969
|
-
padOutline:
|
|
970
|
-
holeOffsetX:
|
|
971
|
-
holeOffsetY:
|
|
969
|
+
name: z39.string().optional(),
|
|
970
|
+
connectsTo: z39.string().or(z39.array(z39.string())).optional(),
|
|
971
|
+
shape: z39.literal("hole_with_polygon_pad"),
|
|
972
|
+
holeShape: z39.enum(["circle", "oval", "pill", "rotated_pill"]),
|
|
973
|
+
holeDiameter: distance13.optional(),
|
|
974
|
+
holeWidth: distance13.optional(),
|
|
975
|
+
holeHeight: distance13.optional(),
|
|
976
|
+
padOutline: z39.array(point),
|
|
977
|
+
holeOffsetX: distance13,
|
|
978
|
+
holeOffsetY: distance13,
|
|
972
979
|
portHints: portHints.optional(),
|
|
973
|
-
solderMaskMargin:
|
|
974
|
-
coveredWithSolderMask:
|
|
980
|
+
solderMaskMargin: distance13.optional(),
|
|
981
|
+
coveredWithSolderMask: z39.boolean().optional()
|
|
975
982
|
})
|
|
976
983
|
]).refine((a) => {
|
|
977
984
|
if ("innerWidth" in a && a.innerWidth !== void 0) {
|
|
@@ -986,15 +993,16 @@ expectTypesMatch(true);
|
|
|
986
993
|
|
|
987
994
|
// lib/components/resistor.ts
|
|
988
995
|
import { resistance } from "circuit-json";
|
|
989
|
-
import { z as
|
|
996
|
+
import { z as z40 } from "zod";
|
|
990
997
|
var resistorPinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
991
998
|
var resistorProps = commonComponentProps.extend({
|
|
992
999
|
resistance,
|
|
993
|
-
pullupFor:
|
|
994
|
-
pullupTo:
|
|
995
|
-
pulldownFor:
|
|
996
|
-
pulldownTo:
|
|
1000
|
+
pullupFor: z40.string().optional(),
|
|
1001
|
+
pullupTo: z40.string().optional(),
|
|
1002
|
+
pulldownFor: z40.string().optional(),
|
|
1003
|
+
pulldownTo: z40.string().optional(),
|
|
997
1004
|
schOrientation: schematicOrientation.optional(),
|
|
1005
|
+
schSize: schematicSymbolSize.optional(),
|
|
998
1006
|
connections: createConnectionsProp(resistorPinLabels).optional()
|
|
999
1007
|
});
|
|
1000
1008
|
var resistorPins = lrPins;
|
|
@@ -1002,23 +1010,23 @@ expectTypesMatch(true);
|
|
|
1002
1010
|
|
|
1003
1011
|
// lib/components/potentiometer.ts
|
|
1004
1012
|
import { resistance as resistance2 } from "circuit-json";
|
|
1005
|
-
import { z as
|
|
1013
|
+
import { z as z41 } from "zod";
|
|
1006
1014
|
var potentiometerProps = commonComponentProps.extend({
|
|
1007
1015
|
maxResistance: resistance2,
|
|
1008
|
-
pinVariant:
|
|
1016
|
+
pinVariant: z41.enum(["two_pin", "three_pin"]).optional()
|
|
1009
1017
|
});
|
|
1010
1018
|
expectTypesMatch(true);
|
|
1011
1019
|
|
|
1012
1020
|
// lib/components/crystal.ts
|
|
1013
1021
|
import { frequency, capacitance } from "circuit-json";
|
|
1014
|
-
import { z as
|
|
1022
|
+
import { z as z42 } from "zod";
|
|
1015
1023
|
var crystalPins = lrPins;
|
|
1016
1024
|
var crystalProps = commonComponentProps.extend({
|
|
1017
1025
|
frequency,
|
|
1018
1026
|
loadCapacitance: capacitance,
|
|
1019
|
-
manufacturerPartNumber:
|
|
1020
|
-
mpn:
|
|
1021
|
-
pinVariant:
|
|
1027
|
+
manufacturerPartNumber: z42.string().optional(),
|
|
1028
|
+
mpn: z42.string().optional(),
|
|
1029
|
+
pinVariant: z42.enum(["two_pin", "four_pin"]).optional(),
|
|
1022
1030
|
schOrientation: schematicOrientation.optional(),
|
|
1023
1031
|
connections: createConnectionsProp(crystalPins).optional()
|
|
1024
1032
|
});
|
|
@@ -1026,34 +1034,34 @@ expectTypesMatch(true);
|
|
|
1026
1034
|
|
|
1027
1035
|
// lib/components/resonator.ts
|
|
1028
1036
|
import { frequency as frequency2, capacitance as capacitance2 } from "circuit-json";
|
|
1029
|
-
import { z as
|
|
1037
|
+
import { z as z43 } from "zod";
|
|
1030
1038
|
var resonatorProps = commonComponentProps.extend({
|
|
1031
1039
|
frequency: frequency2,
|
|
1032
1040
|
loadCapacitance: capacitance2,
|
|
1033
|
-
pinVariant:
|
|
1041
|
+
pinVariant: z43.enum(["no_ground", "ground_pin", "two_ground_pins"]).optional()
|
|
1034
1042
|
});
|
|
1035
1043
|
expectTypesMatch(true);
|
|
1036
1044
|
|
|
1037
1045
|
// lib/components/stampboard.ts
|
|
1038
|
-
import { distance as
|
|
1039
|
-
import { z as
|
|
1046
|
+
import { distance as distance14 } from "circuit-json";
|
|
1047
|
+
import { z as z44 } from "zod";
|
|
1040
1048
|
var stampboardProps = boardProps.extend({
|
|
1041
|
-
leftPinCount:
|
|
1042
|
-
rightPinCount:
|
|
1043
|
-
topPinCount:
|
|
1044
|
-
bottomPinCount:
|
|
1045
|
-
leftPins:
|
|
1046
|
-
rightPins:
|
|
1047
|
-
topPins:
|
|
1048
|
-
bottomPins:
|
|
1049
|
-
pinPitch:
|
|
1050
|
-
innerHoles:
|
|
1049
|
+
leftPinCount: z44.number().optional(),
|
|
1050
|
+
rightPinCount: z44.number().optional(),
|
|
1051
|
+
topPinCount: z44.number().optional(),
|
|
1052
|
+
bottomPinCount: z44.number().optional(),
|
|
1053
|
+
leftPins: z44.array(z44.string()).optional(),
|
|
1054
|
+
rightPins: z44.array(z44.string()).optional(),
|
|
1055
|
+
topPins: z44.array(z44.string()).optional(),
|
|
1056
|
+
bottomPins: z44.array(z44.string()).optional(),
|
|
1057
|
+
pinPitch: distance14.optional(),
|
|
1058
|
+
innerHoles: z44.boolean().optional()
|
|
1051
1059
|
});
|
|
1052
1060
|
expectTypesMatch(true);
|
|
1053
1061
|
|
|
1054
1062
|
// lib/components/capacitor.ts
|
|
1055
1063
|
import { capacitance as capacitance3, voltage } from "circuit-json";
|
|
1056
|
-
import { z as
|
|
1064
|
+
import { z as z45 } from "zod";
|
|
1057
1065
|
var capacitorPinLabels = [
|
|
1058
1066
|
"pin1",
|
|
1059
1067
|
"pin2",
|
|
@@ -1065,80 +1073,81 @@ var capacitorPinLabels = [
|
|
|
1065
1073
|
var capacitorProps = commonComponentProps.extend({
|
|
1066
1074
|
capacitance: capacitance3,
|
|
1067
1075
|
maxVoltageRating: voltage.optional(),
|
|
1068
|
-
schShowRatings:
|
|
1069
|
-
polarized:
|
|
1070
|
-
decouplingFor:
|
|
1071
|
-
decouplingTo:
|
|
1072
|
-
bypassFor:
|
|
1073
|
-
bypassTo:
|
|
1074
|
-
maxDecouplingTraceLength:
|
|
1076
|
+
schShowRatings: z45.boolean().optional().default(false),
|
|
1077
|
+
polarized: z45.boolean().optional().default(false),
|
|
1078
|
+
decouplingFor: z45.string().optional(),
|
|
1079
|
+
decouplingTo: z45.string().optional(),
|
|
1080
|
+
bypassFor: z45.string().optional(),
|
|
1081
|
+
bypassTo: z45.string().optional(),
|
|
1082
|
+
maxDecouplingTraceLength: z45.number().optional(),
|
|
1075
1083
|
schOrientation: schematicOrientation.optional(),
|
|
1084
|
+
schSize: schematicSymbolSize.optional(),
|
|
1076
1085
|
connections: createConnectionsProp(capacitorPinLabels).optional()
|
|
1077
1086
|
});
|
|
1078
1087
|
var capacitorPins = lrPolarPins;
|
|
1079
1088
|
expectTypesMatch(true);
|
|
1080
1089
|
|
|
1081
1090
|
// lib/components/net.ts
|
|
1082
|
-
import { z as
|
|
1083
|
-
var netProps =
|
|
1084
|
-
name:
|
|
1085
|
-
connectsTo:
|
|
1086
|
-
highlightColor:
|
|
1087
|
-
isPowerNet:
|
|
1088
|
-
isGroundNet:
|
|
1091
|
+
import { z as z46 } from "zod";
|
|
1092
|
+
var netProps = z46.object({
|
|
1093
|
+
name: z46.string(),
|
|
1094
|
+
connectsTo: z46.string().or(z46.array(z46.string())).optional(),
|
|
1095
|
+
highlightColor: z46.string().optional(),
|
|
1096
|
+
isPowerNet: z46.boolean().optional(),
|
|
1097
|
+
isGroundNet: z46.boolean().optional()
|
|
1089
1098
|
});
|
|
1090
1099
|
expectTypesMatch(true);
|
|
1091
1100
|
|
|
1092
1101
|
// lib/components/constrainedlayout.ts
|
|
1093
|
-
import { z as
|
|
1094
|
-
var constrainedLayoutProps =
|
|
1095
|
-
name:
|
|
1096
|
-
pcbOnly:
|
|
1097
|
-
schOnly:
|
|
1102
|
+
import { z as z47 } from "zod";
|
|
1103
|
+
var constrainedLayoutProps = z47.object({
|
|
1104
|
+
name: z47.string().optional(),
|
|
1105
|
+
pcbOnly: z47.boolean().optional(),
|
|
1106
|
+
schOnly: z47.boolean().optional()
|
|
1098
1107
|
});
|
|
1099
1108
|
expectTypesMatch(true);
|
|
1100
1109
|
|
|
1101
1110
|
// lib/components/constraint.ts
|
|
1102
|
-
import { z as
|
|
1103
|
-
var pcbXDistConstraintProps =
|
|
1104
|
-
pcb:
|
|
1111
|
+
import { z as z48 } from "zod";
|
|
1112
|
+
var pcbXDistConstraintProps = z48.object({
|
|
1113
|
+
pcb: z48.literal(true).optional(),
|
|
1105
1114
|
xDist: distance,
|
|
1106
|
-
left:
|
|
1107
|
-
right:
|
|
1108
|
-
edgeToEdge:
|
|
1109
|
-
centerToCenter:
|
|
1115
|
+
left: z48.string(),
|
|
1116
|
+
right: z48.string(),
|
|
1117
|
+
edgeToEdge: z48.literal(true).optional(),
|
|
1118
|
+
centerToCenter: z48.literal(true).optional()
|
|
1110
1119
|
});
|
|
1111
1120
|
expectTypesMatch(
|
|
1112
1121
|
true
|
|
1113
1122
|
);
|
|
1114
|
-
var pcbYDistConstraintProps =
|
|
1115
|
-
pcb:
|
|
1123
|
+
var pcbYDistConstraintProps = z48.object({
|
|
1124
|
+
pcb: z48.literal(true).optional(),
|
|
1116
1125
|
yDist: distance,
|
|
1117
|
-
top:
|
|
1118
|
-
bottom:
|
|
1119
|
-
edgeToEdge:
|
|
1120
|
-
centerToCenter:
|
|
1126
|
+
top: z48.string(),
|
|
1127
|
+
bottom: z48.string(),
|
|
1128
|
+
edgeToEdge: z48.literal(true).optional(),
|
|
1129
|
+
centerToCenter: z48.literal(true).optional()
|
|
1121
1130
|
});
|
|
1122
1131
|
expectTypesMatch(
|
|
1123
1132
|
true
|
|
1124
1133
|
);
|
|
1125
|
-
var pcbSameYConstraintProps =
|
|
1126
|
-
pcb:
|
|
1127
|
-
sameY:
|
|
1128
|
-
for:
|
|
1134
|
+
var pcbSameYConstraintProps = z48.object({
|
|
1135
|
+
pcb: z48.literal(true).optional(),
|
|
1136
|
+
sameY: z48.literal(true).optional(),
|
|
1137
|
+
for: z48.array(z48.string())
|
|
1129
1138
|
});
|
|
1130
1139
|
expectTypesMatch(
|
|
1131
1140
|
true
|
|
1132
1141
|
);
|
|
1133
|
-
var pcbSameXConstraintProps =
|
|
1134
|
-
pcb:
|
|
1135
|
-
sameX:
|
|
1136
|
-
for:
|
|
1142
|
+
var pcbSameXConstraintProps = z48.object({
|
|
1143
|
+
pcb: z48.literal(true).optional(),
|
|
1144
|
+
sameX: z48.literal(true).optional(),
|
|
1145
|
+
for: z48.array(z48.string())
|
|
1137
1146
|
});
|
|
1138
1147
|
expectTypesMatch(
|
|
1139
1148
|
true
|
|
1140
1149
|
);
|
|
1141
|
-
var constraintProps =
|
|
1150
|
+
var constraintProps = z48.union([
|
|
1142
1151
|
pcbXDistConstraintProps,
|
|
1143
1152
|
pcbYDistConstraintProps,
|
|
1144
1153
|
pcbSameYConstraintProps,
|
|
@@ -1147,13 +1156,13 @@ var constraintProps = z47.union([
|
|
|
1147
1156
|
expectTypesMatch(true);
|
|
1148
1157
|
|
|
1149
1158
|
// lib/components/cutout.ts
|
|
1150
|
-
import { z as
|
|
1159
|
+
import { z as z49 } from "zod";
|
|
1151
1160
|
var rectCutoutProps = pcbLayoutProps.omit({
|
|
1152
1161
|
layer: true,
|
|
1153
1162
|
pcbRotation: true
|
|
1154
1163
|
}).extend({
|
|
1155
|
-
name:
|
|
1156
|
-
shape:
|
|
1164
|
+
name: z49.string().optional(),
|
|
1165
|
+
shape: z49.literal("rect"),
|
|
1157
1166
|
width: distance,
|
|
1158
1167
|
height: distance
|
|
1159
1168
|
});
|
|
@@ -1162,8 +1171,8 @@ var circleCutoutProps = pcbLayoutProps.omit({
|
|
|
1162
1171
|
layer: true,
|
|
1163
1172
|
pcbRotation: true
|
|
1164
1173
|
}).extend({
|
|
1165
|
-
name:
|
|
1166
|
-
shape:
|
|
1174
|
+
name: z49.string().optional(),
|
|
1175
|
+
shape: z49.literal("circle"),
|
|
1167
1176
|
radius: distance
|
|
1168
1177
|
});
|
|
1169
1178
|
expectTypesMatch(true);
|
|
@@ -1171,73 +1180,73 @@ var polygonCutoutProps = pcbLayoutProps.omit({
|
|
|
1171
1180
|
layer: true,
|
|
1172
1181
|
pcbRotation: true
|
|
1173
1182
|
}).extend({
|
|
1174
|
-
name:
|
|
1175
|
-
shape:
|
|
1176
|
-
points:
|
|
1183
|
+
name: z49.string().optional(),
|
|
1184
|
+
shape: z49.literal("polygon"),
|
|
1185
|
+
points: z49.array(point)
|
|
1177
1186
|
});
|
|
1178
1187
|
expectTypesMatch(true);
|
|
1179
|
-
var cutoutProps =
|
|
1188
|
+
var cutoutProps = z49.discriminatedUnion("shape", [
|
|
1180
1189
|
rectCutoutProps,
|
|
1181
1190
|
circleCutoutProps,
|
|
1182
1191
|
polygonCutoutProps
|
|
1183
1192
|
]);
|
|
1184
1193
|
|
|
1185
1194
|
// lib/components/smtpad.ts
|
|
1186
|
-
import { z as
|
|
1195
|
+
import { z as z50 } from "zod";
|
|
1187
1196
|
var rectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1188
|
-
name:
|
|
1189
|
-
shape:
|
|
1197
|
+
name: z50.string().optional(),
|
|
1198
|
+
shape: z50.literal("rect"),
|
|
1190
1199
|
width: distance,
|
|
1191
1200
|
height: distance,
|
|
1192
1201
|
rectBorderRadius: distance.optional(),
|
|
1193
1202
|
cornerRadius: distance.optional(),
|
|
1194
1203
|
portHints: portHints.optional(),
|
|
1195
|
-
coveredWithSolderMask:
|
|
1204
|
+
coveredWithSolderMask: z50.boolean().optional(),
|
|
1196
1205
|
solderMaskMargin: distance.optional()
|
|
1197
1206
|
});
|
|
1198
1207
|
expectTypesMatch(true);
|
|
1199
1208
|
var rotatedRectSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1200
|
-
name:
|
|
1201
|
-
shape:
|
|
1209
|
+
name: z50.string().optional(),
|
|
1210
|
+
shape: z50.literal("rotated_rect"),
|
|
1202
1211
|
width: distance,
|
|
1203
1212
|
height: distance,
|
|
1204
|
-
ccwRotation:
|
|
1213
|
+
ccwRotation: z50.number(),
|
|
1205
1214
|
cornerRadius: distance.optional(),
|
|
1206
1215
|
portHints: portHints.optional(),
|
|
1207
|
-
coveredWithSolderMask:
|
|
1216
|
+
coveredWithSolderMask: z50.boolean().optional(),
|
|
1208
1217
|
solderMaskMargin: distance.optional()
|
|
1209
1218
|
});
|
|
1210
1219
|
expectTypesMatch(true);
|
|
1211
1220
|
var circleSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1212
|
-
name:
|
|
1213
|
-
shape:
|
|
1221
|
+
name: z50.string().optional(),
|
|
1222
|
+
shape: z50.literal("circle"),
|
|
1214
1223
|
radius: distance,
|
|
1215
1224
|
portHints: portHints.optional(),
|
|
1216
|
-
coveredWithSolderMask:
|
|
1225
|
+
coveredWithSolderMask: z50.boolean().optional(),
|
|
1217
1226
|
solderMaskMargin: distance.optional()
|
|
1218
1227
|
});
|
|
1219
1228
|
expectTypesMatch(true);
|
|
1220
1229
|
var pillSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1221
|
-
name:
|
|
1222
|
-
shape:
|
|
1230
|
+
name: z50.string().optional(),
|
|
1231
|
+
shape: z50.literal("pill"),
|
|
1223
1232
|
width: distance,
|
|
1224
1233
|
height: distance,
|
|
1225
1234
|
radius: distance,
|
|
1226
1235
|
portHints: portHints.optional(),
|
|
1227
|
-
coveredWithSolderMask:
|
|
1236
|
+
coveredWithSolderMask: z50.boolean().optional(),
|
|
1228
1237
|
solderMaskMargin: distance.optional()
|
|
1229
1238
|
});
|
|
1230
1239
|
expectTypesMatch(true);
|
|
1231
1240
|
var polygonSmtPadProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1232
|
-
name:
|
|
1233
|
-
shape:
|
|
1234
|
-
points:
|
|
1241
|
+
name: z50.string().optional(),
|
|
1242
|
+
shape: z50.literal("polygon"),
|
|
1243
|
+
points: z50.array(point),
|
|
1235
1244
|
portHints: portHints.optional(),
|
|
1236
|
-
coveredWithSolderMask:
|
|
1245
|
+
coveredWithSolderMask: z50.boolean().optional(),
|
|
1237
1246
|
solderMaskMargin: distance.optional()
|
|
1238
1247
|
});
|
|
1239
1248
|
expectTypesMatch(true);
|
|
1240
|
-
var smtPadProps =
|
|
1249
|
+
var smtPadProps = z50.discriminatedUnion("shape", [
|
|
1241
1250
|
circleSmtPadProps,
|
|
1242
1251
|
rectSmtPadProps,
|
|
1243
1252
|
rotatedRectSmtPadProps,
|
|
@@ -1247,55 +1256,55 @@ var smtPadProps = z49.discriminatedUnion("shape", [
|
|
|
1247
1256
|
expectTypesMatch(true);
|
|
1248
1257
|
|
|
1249
1258
|
// lib/components/solderpaste.ts
|
|
1250
|
-
import { z as
|
|
1259
|
+
import { z as z51 } from "zod";
|
|
1251
1260
|
var rectSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1252
|
-
shape:
|
|
1261
|
+
shape: z51.literal("rect"),
|
|
1253
1262
|
width: distance,
|
|
1254
1263
|
height: distance
|
|
1255
1264
|
});
|
|
1256
1265
|
expectTypesMatch(true);
|
|
1257
1266
|
var circleSolderPasteProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1258
|
-
shape:
|
|
1267
|
+
shape: z51.literal("circle"),
|
|
1259
1268
|
radius: distance
|
|
1260
1269
|
});
|
|
1261
1270
|
expectTypesMatch(true);
|
|
1262
|
-
var solderPasteProps =
|
|
1271
|
+
var solderPasteProps = z51.union([
|
|
1263
1272
|
circleSolderPasteProps,
|
|
1264
1273
|
rectSolderPasteProps
|
|
1265
1274
|
]);
|
|
1266
1275
|
expectTypesMatch(true);
|
|
1267
1276
|
|
|
1268
1277
|
// lib/components/hole.ts
|
|
1269
|
-
import { z as
|
|
1278
|
+
import { z as z52 } from "zod";
|
|
1270
1279
|
var circleHoleProps = pcbLayoutProps.extend({
|
|
1271
|
-
name:
|
|
1272
|
-
shape:
|
|
1280
|
+
name: z52.string().optional(),
|
|
1281
|
+
shape: z52.literal("circle").optional(),
|
|
1273
1282
|
diameter: distance.optional(),
|
|
1274
1283
|
radius: distance.optional(),
|
|
1275
1284
|
solderMaskMargin: distance.optional(),
|
|
1276
|
-
coveredWithSolderMask:
|
|
1285
|
+
coveredWithSolderMask: z52.boolean().optional()
|
|
1277
1286
|
}).transform((d) => ({
|
|
1278
1287
|
...d,
|
|
1279
1288
|
diameter: d.diameter ?? 2 * d.radius,
|
|
1280
1289
|
radius: d.radius ?? d.diameter / 2
|
|
1281
1290
|
}));
|
|
1282
1291
|
var pillHoleProps = pcbLayoutProps.extend({
|
|
1283
|
-
name:
|
|
1284
|
-
shape:
|
|
1292
|
+
name: z52.string().optional(),
|
|
1293
|
+
shape: z52.literal("pill"),
|
|
1285
1294
|
width: distance,
|
|
1286
1295
|
height: distance,
|
|
1287
1296
|
solderMaskMargin: distance.optional(),
|
|
1288
|
-
coveredWithSolderMask:
|
|
1297
|
+
coveredWithSolderMask: z52.boolean().optional()
|
|
1289
1298
|
});
|
|
1290
1299
|
var rectHoleProps = pcbLayoutProps.extend({
|
|
1291
|
-
name:
|
|
1292
|
-
shape:
|
|
1300
|
+
name: z52.string().optional(),
|
|
1301
|
+
shape: z52.literal("rect"),
|
|
1293
1302
|
width: distance,
|
|
1294
1303
|
height: distance,
|
|
1295
1304
|
solderMaskMargin: distance.optional(),
|
|
1296
|
-
coveredWithSolderMask:
|
|
1305
|
+
coveredWithSolderMask: z52.boolean().optional()
|
|
1297
1306
|
});
|
|
1298
|
-
var holeProps =
|
|
1307
|
+
var holeProps = z52.union([
|
|
1299
1308
|
circleHoleProps,
|
|
1300
1309
|
pillHoleProps,
|
|
1301
1310
|
rectHoleProps
|
|
@@ -1303,31 +1312,31 @@ var holeProps = z51.union([
|
|
|
1303
1312
|
expectTypesMatch(true);
|
|
1304
1313
|
|
|
1305
1314
|
// lib/components/trace.ts
|
|
1306
|
-
import { distance as
|
|
1307
|
-
import { z as
|
|
1308
|
-
var portRef =
|
|
1309
|
-
|
|
1310
|
-
|
|
1315
|
+
import { distance as distance15, route_hint_point as route_hint_point2 } from "circuit-json";
|
|
1316
|
+
import { z as z53 } from "zod";
|
|
1317
|
+
var portRef = z53.union([
|
|
1318
|
+
z53.string(),
|
|
1319
|
+
z53.custom(
|
|
1311
1320
|
(v) => Boolean(v.getPortSelector)
|
|
1312
1321
|
)
|
|
1313
1322
|
]);
|
|
1314
|
-
var baseTraceProps =
|
|
1315
|
-
key:
|
|
1316
|
-
thickness:
|
|
1317
|
-
width:
|
|
1318
|
-
schematicRouteHints:
|
|
1319
|
-
pcbRouteHints:
|
|
1320
|
-
pcbPathRelativeTo:
|
|
1321
|
-
pcbPath:
|
|
1322
|
-
pcbStraightLine:
|
|
1323
|
-
schDisplayLabel:
|
|
1324
|
-
schStroke:
|
|
1325
|
-
highlightColor:
|
|
1326
|
-
maxLength:
|
|
1327
|
-
});
|
|
1328
|
-
var traceProps =
|
|
1323
|
+
var baseTraceProps = z53.object({
|
|
1324
|
+
key: z53.string().optional(),
|
|
1325
|
+
thickness: distance15.optional(),
|
|
1326
|
+
width: distance15.optional().describe("Alias for trace thickness"),
|
|
1327
|
+
schematicRouteHints: z53.array(point).optional(),
|
|
1328
|
+
pcbRouteHints: z53.array(route_hint_point2).optional(),
|
|
1329
|
+
pcbPathRelativeTo: z53.string().optional(),
|
|
1330
|
+
pcbPath: z53.array(z53.union([point, z53.string()])).optional(),
|
|
1331
|
+
pcbStraightLine: z53.boolean().optional().describe("Draw a straight pcb trace between the connected points"),
|
|
1332
|
+
schDisplayLabel: z53.string().optional(),
|
|
1333
|
+
schStroke: z53.string().optional(),
|
|
1334
|
+
highlightColor: z53.string().optional(),
|
|
1335
|
+
maxLength: distance15.optional()
|
|
1336
|
+
});
|
|
1337
|
+
var traceProps = z53.union([
|
|
1329
1338
|
baseTraceProps.extend({
|
|
1330
|
-
path:
|
|
1339
|
+
path: z53.array(portRef)
|
|
1331
1340
|
}),
|
|
1332
1341
|
baseTraceProps.extend({
|
|
1333
1342
|
from: portRef,
|
|
@@ -1337,25 +1346,25 @@ var traceProps = z52.union([
|
|
|
1337
1346
|
|
|
1338
1347
|
// lib/components/footprint.ts
|
|
1339
1348
|
import { layer_ref as layer_ref4 } from "circuit-json";
|
|
1340
|
-
import { z as
|
|
1341
|
-
var footprintProps =
|
|
1342
|
-
children:
|
|
1349
|
+
import { z as z54 } from "zod";
|
|
1350
|
+
var footprintProps = z54.object({
|
|
1351
|
+
children: z54.any().optional(),
|
|
1343
1352
|
originalLayer: layer_ref4.default("top").optional(),
|
|
1344
|
-
circuitJson:
|
|
1353
|
+
circuitJson: z54.array(z54.any()).optional()
|
|
1345
1354
|
});
|
|
1346
1355
|
expectTypesMatch(true);
|
|
1347
1356
|
|
|
1348
1357
|
// lib/components/symbol.ts
|
|
1349
|
-
import { z as
|
|
1350
|
-
var symbolProps =
|
|
1351
|
-
originalFacingDirection:
|
|
1358
|
+
import { z as z55 } from "zod";
|
|
1359
|
+
var symbolProps = z55.object({
|
|
1360
|
+
originalFacingDirection: z55.enum(["up", "down", "left", "right"]).default("right").optional()
|
|
1352
1361
|
});
|
|
1353
1362
|
expectTypesMatch(true);
|
|
1354
1363
|
|
|
1355
1364
|
// lib/components/battery.ts
|
|
1356
1365
|
import { voltage as voltage2 } from "circuit-json";
|
|
1357
|
-
import { z as
|
|
1358
|
-
var capacity =
|
|
1366
|
+
import { z as z56 } from "zod";
|
|
1367
|
+
var capacity = z56.number().or(z56.string().endsWith("mAh")).transform((v) => {
|
|
1359
1368
|
if (typeof v === "string") {
|
|
1360
1369
|
const valString = v.replace("mAh", "");
|
|
1361
1370
|
const num = Number.parseFloat(valString);
|
|
@@ -1369,71 +1378,71 @@ var capacity = z55.number().or(z55.string().endsWith("mAh")).transform((v) => {
|
|
|
1369
1378
|
var batteryProps = commonComponentProps.extend({
|
|
1370
1379
|
capacity: capacity.optional(),
|
|
1371
1380
|
voltage: voltage2.optional(),
|
|
1372
|
-
standard:
|
|
1381
|
+
standard: z56.enum(["AA", "AAA", "9V", "CR2032", "18650", "C"]).optional(),
|
|
1373
1382
|
schOrientation: schematicOrientation.optional()
|
|
1374
1383
|
});
|
|
1375
1384
|
var batteryPins = lrPolarPins;
|
|
1376
1385
|
expectTypesMatch(true);
|
|
1377
1386
|
|
|
1378
1387
|
// lib/components/pin-header.ts
|
|
1379
|
-
import { distance as
|
|
1388
|
+
import { distance as distance16 } from "circuit-json";
|
|
1380
1389
|
|
|
1381
1390
|
// lib/common/pcbOrientation.ts
|
|
1382
|
-
import { z as
|
|
1383
|
-
var pcbOrientation =
|
|
1391
|
+
import { z as z57 } from "zod";
|
|
1392
|
+
var pcbOrientation = z57.enum(["vertical", "horizontal"]).describe(
|
|
1384
1393
|
"vertical means pins go 1->2 downward and horizontal means pins go 1->2 rightward"
|
|
1385
1394
|
);
|
|
1386
1395
|
expectTypesMatch(true);
|
|
1387
1396
|
|
|
1388
1397
|
// lib/components/pin-header.ts
|
|
1389
|
-
import { z as
|
|
1398
|
+
import { z as z58 } from "zod";
|
|
1390
1399
|
var pinHeaderProps = commonComponentProps.extend({
|
|
1391
|
-
pinCount:
|
|
1392
|
-
pitch:
|
|
1393
|
-
schFacingDirection:
|
|
1394
|
-
gender:
|
|
1395
|
-
showSilkscreenPinLabels:
|
|
1396
|
-
pcbPinLabels:
|
|
1397
|
-
doubleRow:
|
|
1398
|
-
rightAngle:
|
|
1400
|
+
pinCount: z58.number(),
|
|
1401
|
+
pitch: distance16.optional(),
|
|
1402
|
+
schFacingDirection: z58.enum(["up", "down", "left", "right"]).optional(),
|
|
1403
|
+
gender: z58.enum(["male", "female", "unpopulated"]).optional().default("male"),
|
|
1404
|
+
showSilkscreenPinLabels: z58.boolean().optional(),
|
|
1405
|
+
pcbPinLabels: z58.record(z58.string(), z58.string()).optional(),
|
|
1406
|
+
doubleRow: z58.boolean().optional(),
|
|
1407
|
+
rightAngle: z58.boolean().optional(),
|
|
1399
1408
|
pcbOrientation: pcbOrientation.optional(),
|
|
1400
|
-
holeDiameter:
|
|
1401
|
-
platedDiameter:
|
|
1402
|
-
pinLabels:
|
|
1403
|
-
connections:
|
|
1404
|
-
facingDirection:
|
|
1409
|
+
holeDiameter: distance16.optional(),
|
|
1410
|
+
platedDiameter: distance16.optional(),
|
|
1411
|
+
pinLabels: z58.record(z58.string(), schematicPinLabel).or(z58.array(schematicPinLabel)).optional(),
|
|
1412
|
+
connections: z58.custom().pipe(z58.record(z58.string(), connectionTarget)).optional(),
|
|
1413
|
+
facingDirection: z58.enum(["left", "right"]).optional(),
|
|
1405
1414
|
schPinArrangement: schematicPinArrangement.optional(),
|
|
1406
1415
|
schPinStyle: schematicPinStyle.optional(),
|
|
1407
|
-
schPinSpacing:
|
|
1408
|
-
schWidth:
|
|
1409
|
-
schHeight:
|
|
1416
|
+
schPinSpacing: distance16.optional(),
|
|
1417
|
+
schWidth: distance16.optional(),
|
|
1418
|
+
schHeight: distance16.optional()
|
|
1410
1419
|
});
|
|
1411
1420
|
expectTypesMatch(true);
|
|
1412
1421
|
|
|
1413
1422
|
// lib/components/netalias.ts
|
|
1414
|
-
import { z as
|
|
1423
|
+
import { z as z59 } from "zod";
|
|
1415
1424
|
import { rotation as rotation2 } from "circuit-json";
|
|
1416
|
-
var netAliasProps =
|
|
1417
|
-
net:
|
|
1418
|
-
connection:
|
|
1425
|
+
var netAliasProps = z59.object({
|
|
1426
|
+
net: z59.string().optional(),
|
|
1427
|
+
connection: z59.string().optional(),
|
|
1419
1428
|
schX: distance.optional(),
|
|
1420
1429
|
schY: distance.optional(),
|
|
1421
1430
|
schRotation: rotation2.optional(),
|
|
1422
|
-
anchorSide:
|
|
1431
|
+
anchorSide: z59.enum(["left", "top", "right", "bottom"]).optional()
|
|
1423
1432
|
});
|
|
1424
1433
|
expectTypesMatch(true);
|
|
1425
1434
|
|
|
1426
1435
|
// lib/components/netlabel.ts
|
|
1427
|
-
import { z as
|
|
1436
|
+
import { z as z60 } from "zod";
|
|
1428
1437
|
import { rotation as rotation3 } from "circuit-json";
|
|
1429
|
-
var netLabelProps =
|
|
1430
|
-
net:
|
|
1431
|
-
connection:
|
|
1432
|
-
connectsTo:
|
|
1438
|
+
var netLabelProps = z60.object({
|
|
1439
|
+
net: z60.string().optional(),
|
|
1440
|
+
connection: z60.string().optional(),
|
|
1441
|
+
connectsTo: z60.string().or(z60.array(z60.string())).optional(),
|
|
1433
1442
|
schX: distance.optional(),
|
|
1434
1443
|
schY: distance.optional(),
|
|
1435
1444
|
schRotation: rotation3.optional(),
|
|
1436
|
-
anchorSide:
|
|
1445
|
+
anchorSide: z60.enum(["left", "top", "right", "bottom"]).optional()
|
|
1437
1446
|
});
|
|
1438
1447
|
expectTypesMatch(true);
|
|
1439
1448
|
|
|
@@ -1448,12 +1457,12 @@ expectTypesMatch(true);
|
|
|
1448
1457
|
|
|
1449
1458
|
// lib/components/analogsimulation.ts
|
|
1450
1459
|
import { ms } from "circuit-json";
|
|
1451
|
-
import { z as
|
|
1452
|
-
var spiceEngine =
|
|
1460
|
+
import { z as z62 } from "zod";
|
|
1461
|
+
var spiceEngine = z62.custom(
|
|
1453
1462
|
(value) => typeof value === "string"
|
|
1454
1463
|
);
|
|
1455
|
-
var analogSimulationProps =
|
|
1456
|
-
simulationType:
|
|
1464
|
+
var analogSimulationProps = z62.object({
|
|
1465
|
+
simulationType: z62.literal("spice_transient_analysis").default("spice_transient_analysis"),
|
|
1457
1466
|
duration: ms.optional(),
|
|
1458
1467
|
timePerStep: ms.optional(),
|
|
1459
1468
|
spiceEngine: spiceEngine.optional()
|
|
@@ -1463,7 +1472,7 @@ expectTypesMatch(
|
|
|
1463
1472
|
);
|
|
1464
1473
|
|
|
1465
1474
|
// lib/components/transistor.ts
|
|
1466
|
-
import { z as
|
|
1475
|
+
import { z as z63 } from "zod";
|
|
1467
1476
|
var transistorPinsLabels = [
|
|
1468
1477
|
"pin1",
|
|
1469
1478
|
"pin2",
|
|
@@ -1476,7 +1485,7 @@ var transistorPinsLabels = [
|
|
|
1476
1485
|
"drain"
|
|
1477
1486
|
];
|
|
1478
1487
|
var transistorProps = commonComponentProps.extend({
|
|
1479
|
-
type:
|
|
1488
|
+
type: z63.enum(["npn", "pnp", "bjt", "jfet", "mosfet", "igbt"]),
|
|
1480
1489
|
connections: createConnectionsProp(transistorPinsLabels).optional()
|
|
1481
1490
|
});
|
|
1482
1491
|
var transistorPins = [
|
|
@@ -1490,10 +1499,10 @@ var transistorPins = [
|
|
|
1490
1499
|
expectTypesMatch(true);
|
|
1491
1500
|
|
|
1492
1501
|
// lib/components/mosfet.ts
|
|
1493
|
-
import { z as
|
|
1502
|
+
import { z as z64 } from "zod";
|
|
1494
1503
|
var mosfetProps = commonComponentProps.extend({
|
|
1495
|
-
channelType:
|
|
1496
|
-
mosfetMode:
|
|
1504
|
+
channelType: z64.enum(["n", "p"]),
|
|
1505
|
+
mosfetMode: z64.enum(["enhancement", "depletion"])
|
|
1497
1506
|
});
|
|
1498
1507
|
var mosfetPins = [
|
|
1499
1508
|
"pin1",
|
|
@@ -1507,19 +1516,19 @@ expectTypesMatch(true);
|
|
|
1507
1516
|
|
|
1508
1517
|
// lib/components/inductor.ts
|
|
1509
1518
|
import { inductance } from "circuit-json";
|
|
1510
|
-
import { z as
|
|
1519
|
+
import { z as z65 } from "zod";
|
|
1511
1520
|
var inductorPins = lrPins;
|
|
1512
1521
|
var inductorProps = commonComponentProps.extend({
|
|
1513
1522
|
inductance,
|
|
1514
|
-
maxCurrentRating:
|
|
1523
|
+
maxCurrentRating: z65.union([z65.string(), z65.number()]).optional(),
|
|
1515
1524
|
schOrientation: schematicOrientation.optional(),
|
|
1516
1525
|
connections: createConnectionsProp(inductorPins).optional()
|
|
1517
1526
|
});
|
|
1518
1527
|
expectTypesMatch(true);
|
|
1519
1528
|
|
|
1520
1529
|
// lib/components/diode.ts
|
|
1521
|
-
import { z as
|
|
1522
|
-
var diodeConnectionKeys =
|
|
1530
|
+
import { z as z66 } from "zod";
|
|
1531
|
+
var diodeConnectionKeys = z66.enum([
|
|
1523
1532
|
"anode",
|
|
1524
1533
|
"cathode",
|
|
1525
1534
|
"pin1",
|
|
@@ -1527,9 +1536,9 @@ var diodeConnectionKeys = z65.enum([
|
|
|
1527
1536
|
"pos",
|
|
1528
1537
|
"neg"
|
|
1529
1538
|
]);
|
|
1530
|
-
var connectionTarget3 =
|
|
1531
|
-
var connectionsProp2 =
|
|
1532
|
-
var diodeVariant =
|
|
1539
|
+
var connectionTarget3 = z66.string().or(z66.array(z66.string()).readonly()).or(z66.array(z66.string()));
|
|
1540
|
+
var connectionsProp2 = z66.record(diodeConnectionKeys, connectionTarget3);
|
|
1541
|
+
var diodeVariant = z66.enum([
|
|
1533
1542
|
"standard",
|
|
1534
1543
|
"schottky",
|
|
1535
1544
|
"zener",
|
|
@@ -1540,12 +1549,12 @@ var diodeVariant = z65.enum([
|
|
|
1540
1549
|
var diodeProps = commonComponentProps.extend({
|
|
1541
1550
|
connections: connectionsProp2.optional(),
|
|
1542
1551
|
variant: diodeVariant.optional().default("standard"),
|
|
1543
|
-
standard:
|
|
1544
|
-
schottky:
|
|
1545
|
-
zener:
|
|
1546
|
-
avalanche:
|
|
1547
|
-
photo:
|
|
1548
|
-
tvs:
|
|
1552
|
+
standard: z66.boolean().optional(),
|
|
1553
|
+
schottky: z66.boolean().optional(),
|
|
1554
|
+
zener: z66.boolean().optional(),
|
|
1555
|
+
avalanche: z66.boolean().optional(),
|
|
1556
|
+
photo: z66.boolean().optional(),
|
|
1557
|
+
tvs: z66.boolean().optional(),
|
|
1549
1558
|
schOrientation: schematicOrientation.optional()
|
|
1550
1559
|
}).superRefine((data, ctx) => {
|
|
1551
1560
|
const enabledFlags = [
|
|
@@ -1558,11 +1567,11 @@ var diodeProps = commonComponentProps.extend({
|
|
|
1558
1567
|
].filter(Boolean).length;
|
|
1559
1568
|
if (enabledFlags > 1) {
|
|
1560
1569
|
ctx.addIssue({
|
|
1561
|
-
code:
|
|
1570
|
+
code: z66.ZodIssueCode.custom,
|
|
1562
1571
|
message: "Exactly one diode variant must be enabled",
|
|
1563
1572
|
path: []
|
|
1564
1573
|
});
|
|
1565
|
-
return
|
|
1574
|
+
return z66.INVALID;
|
|
1566
1575
|
}
|
|
1567
1576
|
}).transform((data) => {
|
|
1568
1577
|
const result = {
|
|
@@ -1609,33 +1618,33 @@ var diodePins = lrPolarPins;
|
|
|
1609
1618
|
expectTypesMatch(true);
|
|
1610
1619
|
|
|
1611
1620
|
// lib/components/led.ts
|
|
1612
|
-
import { z as
|
|
1621
|
+
import { z as z67 } from "zod";
|
|
1613
1622
|
var ledProps = commonComponentProps.extend({
|
|
1614
|
-
color:
|
|
1615
|
-
wavelength:
|
|
1616
|
-
schDisplayValue:
|
|
1623
|
+
color: z67.string().optional(),
|
|
1624
|
+
wavelength: z67.string().optional(),
|
|
1625
|
+
schDisplayValue: z67.string().optional(),
|
|
1617
1626
|
schOrientation: schematicOrientation.optional(),
|
|
1618
1627
|
connections: createConnectionsProp(lrPolarPins).optional(),
|
|
1619
|
-
laser:
|
|
1628
|
+
laser: z67.boolean().optional()
|
|
1620
1629
|
});
|
|
1621
1630
|
var ledPins = lrPolarPins;
|
|
1622
1631
|
|
|
1623
1632
|
// lib/components/switch.ts
|
|
1624
1633
|
import { ms as ms2, frequency as frequency3 } from "circuit-json";
|
|
1625
|
-
import { z as
|
|
1634
|
+
import { z as z68 } from "zod";
|
|
1626
1635
|
var switchProps = commonComponentProps.extend({
|
|
1627
|
-
type:
|
|
1628
|
-
isNormallyClosed:
|
|
1629
|
-
spst:
|
|
1630
|
-
spdt:
|
|
1631
|
-
dpst:
|
|
1632
|
-
dpdt:
|
|
1636
|
+
type: z68.enum(["spst", "spdt", "dpst", "dpdt"]).optional(),
|
|
1637
|
+
isNormallyClosed: z68.boolean().optional().default(false),
|
|
1638
|
+
spst: z68.boolean().optional(),
|
|
1639
|
+
spdt: z68.boolean().optional(),
|
|
1640
|
+
dpst: z68.boolean().optional(),
|
|
1641
|
+
dpdt: z68.boolean().optional(),
|
|
1633
1642
|
simSwitchFrequency: frequency3.optional(),
|
|
1634
1643
|
simCloseAt: ms2.optional(),
|
|
1635
1644
|
simOpenAt: ms2.optional(),
|
|
1636
|
-
simStartClosed:
|
|
1637
|
-
simStartOpen:
|
|
1638
|
-
connections:
|
|
1645
|
+
simStartClosed: z68.boolean().optional(),
|
|
1646
|
+
simStartOpen: z68.boolean().optional(),
|
|
1647
|
+
connections: z68.custom().pipe(z68.record(z68.string(), connectionTarget)).optional()
|
|
1639
1648
|
}).transform((props) => {
|
|
1640
1649
|
const updatedProps = { ...props };
|
|
1641
1650
|
if (updatedProps.dpdt) {
|
|
@@ -1667,33 +1676,33 @@ expectTypesMatch(true);
|
|
|
1667
1676
|
|
|
1668
1677
|
// lib/components/fabrication-note-text.ts
|
|
1669
1678
|
import { length as length3 } from "circuit-json";
|
|
1670
|
-
import { z as
|
|
1679
|
+
import { z as z69 } from "zod";
|
|
1671
1680
|
var fabricationNoteTextProps = pcbLayoutProps.extend({
|
|
1672
|
-
text:
|
|
1673
|
-
anchorAlignment:
|
|
1674
|
-
font:
|
|
1681
|
+
text: z69.string(),
|
|
1682
|
+
anchorAlignment: z69.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
1683
|
+
font: z69.enum(["tscircuit2024"]).optional(),
|
|
1675
1684
|
fontSize: length3.optional(),
|
|
1676
|
-
color:
|
|
1685
|
+
color: z69.string().optional()
|
|
1677
1686
|
});
|
|
1678
1687
|
expectTypesMatch(true);
|
|
1679
1688
|
|
|
1680
1689
|
// lib/components/fabrication-note-rect.ts
|
|
1681
|
-
import { distance as
|
|
1682
|
-
import { z as
|
|
1690
|
+
import { distance as distance17 } from "circuit-json";
|
|
1691
|
+
import { z as z70 } from "zod";
|
|
1683
1692
|
var fabricationNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1684
|
-
width:
|
|
1685
|
-
height:
|
|
1686
|
-
strokeWidth:
|
|
1687
|
-
isFilled:
|
|
1688
|
-
hasStroke:
|
|
1689
|
-
isStrokeDashed:
|
|
1690
|
-
color:
|
|
1691
|
-
cornerRadius:
|
|
1693
|
+
width: distance17,
|
|
1694
|
+
height: distance17,
|
|
1695
|
+
strokeWidth: distance17.optional(),
|
|
1696
|
+
isFilled: z70.boolean().optional(),
|
|
1697
|
+
hasStroke: z70.boolean().optional(),
|
|
1698
|
+
isStrokeDashed: z70.boolean().optional(),
|
|
1699
|
+
color: z70.string().optional(),
|
|
1700
|
+
cornerRadius: distance17.optional()
|
|
1692
1701
|
});
|
|
1693
1702
|
|
|
1694
1703
|
// lib/components/fabrication-note-path.ts
|
|
1695
1704
|
import { length as length4, route_hint_point as route_hint_point3 } from "circuit-json";
|
|
1696
|
-
import { z as
|
|
1705
|
+
import { z as z71 } from "zod";
|
|
1697
1706
|
var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
1698
1707
|
pcbX: true,
|
|
1699
1708
|
pcbY: true,
|
|
@@ -1701,15 +1710,15 @@ var fabricationNotePathProps = pcbLayoutProps.omit({
|
|
|
1701
1710
|
pcbOffsetY: true,
|
|
1702
1711
|
pcbRotation: true
|
|
1703
1712
|
}).extend({
|
|
1704
|
-
route:
|
|
1713
|
+
route: z71.array(route_hint_point3),
|
|
1705
1714
|
strokeWidth: length4.optional(),
|
|
1706
|
-
color:
|
|
1715
|
+
color: z71.string().optional()
|
|
1707
1716
|
});
|
|
1708
1717
|
|
|
1709
1718
|
// lib/components/fabrication-note-dimension.ts
|
|
1710
|
-
import { distance as
|
|
1711
|
-
import { z as
|
|
1712
|
-
var dimensionTarget =
|
|
1719
|
+
import { distance as distance18, length as length5 } from "circuit-json";
|
|
1720
|
+
import { z as z72 } from "zod";
|
|
1721
|
+
var dimensionTarget = z72.union([z72.string(), point]);
|
|
1713
1722
|
var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
1714
1723
|
pcbX: true,
|
|
1715
1724
|
pcbY: true,
|
|
@@ -1719,57 +1728,57 @@ var fabricationNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
1719
1728
|
}).extend({
|
|
1720
1729
|
from: dimensionTarget,
|
|
1721
1730
|
to: dimensionTarget,
|
|
1722
|
-
text:
|
|
1723
|
-
offset:
|
|
1724
|
-
font:
|
|
1731
|
+
text: z72.string().optional(),
|
|
1732
|
+
offset: distance18.optional(),
|
|
1733
|
+
font: z72.enum(["tscircuit2024"]).optional(),
|
|
1725
1734
|
fontSize: length5.optional(),
|
|
1726
|
-
color:
|
|
1727
|
-
arrowSize:
|
|
1728
|
-
units:
|
|
1729
|
-
outerEdgeToEdge:
|
|
1730
|
-
centerToCenter:
|
|
1731
|
-
innerEdgeToEdge:
|
|
1735
|
+
color: z72.string().optional(),
|
|
1736
|
+
arrowSize: distance18.optional(),
|
|
1737
|
+
units: z72.enum(["in", "mm"]).optional(),
|
|
1738
|
+
outerEdgeToEdge: z72.literal(true).optional(),
|
|
1739
|
+
centerToCenter: z72.literal(true).optional(),
|
|
1740
|
+
innerEdgeToEdge: z72.literal(true).optional()
|
|
1732
1741
|
});
|
|
1733
1742
|
expectTypesMatch(true);
|
|
1734
1743
|
|
|
1735
1744
|
// lib/components/pcb-trace.ts
|
|
1736
|
-
import { distance as
|
|
1737
|
-
import { z as
|
|
1738
|
-
var pcbTraceProps =
|
|
1739
|
-
layer:
|
|
1740
|
-
thickness:
|
|
1741
|
-
route:
|
|
1745
|
+
import { distance as distance19, route_hint_point as route_hint_point4 } from "circuit-json";
|
|
1746
|
+
import { z as z73 } from "zod";
|
|
1747
|
+
var pcbTraceProps = z73.object({
|
|
1748
|
+
layer: z73.string().optional(),
|
|
1749
|
+
thickness: distance19.optional(),
|
|
1750
|
+
route: z73.array(route_hint_point4)
|
|
1742
1751
|
});
|
|
1743
1752
|
|
|
1744
1753
|
// lib/components/via.ts
|
|
1745
|
-
import { distance as
|
|
1746
|
-
import { z as
|
|
1754
|
+
import { distance as distance20, layer_ref as layer_ref5 } from "circuit-json";
|
|
1755
|
+
import { z as z74 } from "zod";
|
|
1747
1756
|
var viaProps = commonLayoutProps.extend({
|
|
1748
|
-
name:
|
|
1757
|
+
name: z74.string().optional(),
|
|
1749
1758
|
fromLayer: layer_ref5,
|
|
1750
1759
|
toLayer: layer_ref5,
|
|
1751
|
-
holeDiameter:
|
|
1752
|
-
outerDiameter:
|
|
1753
|
-
connectsTo:
|
|
1754
|
-
netIsAssignable:
|
|
1760
|
+
holeDiameter: distance20.optional(),
|
|
1761
|
+
outerDiameter: distance20.optional(),
|
|
1762
|
+
connectsTo: z74.string().or(z74.array(z74.string())).optional(),
|
|
1763
|
+
netIsAssignable: z74.boolean().optional()
|
|
1755
1764
|
});
|
|
1756
1765
|
expectTypesMatch(true);
|
|
1757
1766
|
|
|
1758
1767
|
// lib/components/testpoint.ts
|
|
1759
|
-
import { distance as
|
|
1760
|
-
import { z as
|
|
1768
|
+
import { distance as distance21 } from "circuit-json";
|
|
1769
|
+
import { z as z75 } from "zod";
|
|
1761
1770
|
var testpointPins = ["pin1"];
|
|
1762
|
-
var testpointConnectionsProp =
|
|
1771
|
+
var testpointConnectionsProp = z75.object({
|
|
1763
1772
|
pin1: connectionTarget
|
|
1764
1773
|
}).strict();
|
|
1765
1774
|
var testpointProps = commonComponentProps.extend({
|
|
1766
1775
|
connections: testpointConnectionsProp.optional(),
|
|
1767
|
-
footprintVariant:
|
|
1768
|
-
padShape:
|
|
1769
|
-
padDiameter:
|
|
1770
|
-
holeDiameter:
|
|
1771
|
-
width:
|
|
1772
|
-
height:
|
|
1776
|
+
footprintVariant: z75.enum(["pad", "through_hole"]).optional(),
|
|
1777
|
+
padShape: z75.enum(["rect", "circle"]).optional().default("circle"),
|
|
1778
|
+
padDiameter: distance21.optional(),
|
|
1779
|
+
holeDiameter: distance21.optional(),
|
|
1780
|
+
width: distance21.optional(),
|
|
1781
|
+
height: distance21.optional()
|
|
1773
1782
|
}).refine(
|
|
1774
1783
|
(props) => props.footprintVariant !== "through_hole" || props.holeDiameter !== void 0,
|
|
1775
1784
|
{ message: "holeDiameter is required for through_hole testpoints" }
|
|
@@ -1777,43 +1786,43 @@ var testpointProps = commonComponentProps.extend({
|
|
|
1777
1786
|
expectTypesMatch(true);
|
|
1778
1787
|
|
|
1779
1788
|
// lib/components/breakoutpoint.ts
|
|
1780
|
-
import { z as
|
|
1789
|
+
import { z as z76 } from "zod";
|
|
1781
1790
|
var breakoutPointProps = pcbLayoutProps.omit({ pcbRotation: true, layer: true }).extend({
|
|
1782
|
-
connection:
|
|
1791
|
+
connection: z76.string()
|
|
1783
1792
|
});
|
|
1784
1793
|
expectTypesMatch(true);
|
|
1785
1794
|
|
|
1786
1795
|
// lib/components/pcb-keepout.ts
|
|
1787
|
-
import { distance as
|
|
1788
|
-
import { z as
|
|
1789
|
-
var pcbKeepoutProps =
|
|
1796
|
+
import { distance as distance22 } from "circuit-json";
|
|
1797
|
+
import { z as z77 } from "zod";
|
|
1798
|
+
var pcbKeepoutProps = z77.union([
|
|
1790
1799
|
pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1791
|
-
shape:
|
|
1792
|
-
radius:
|
|
1800
|
+
shape: z77.literal("circle"),
|
|
1801
|
+
radius: distance22
|
|
1793
1802
|
}),
|
|
1794
1803
|
pcbLayoutProps.extend({
|
|
1795
|
-
shape:
|
|
1796
|
-
width:
|
|
1797
|
-
height:
|
|
1804
|
+
shape: z77.literal("rect"),
|
|
1805
|
+
width: distance22,
|
|
1806
|
+
height: distance22
|
|
1798
1807
|
})
|
|
1799
1808
|
]);
|
|
1800
1809
|
|
|
1801
1810
|
// lib/components/courtyard-rect.ts
|
|
1802
|
-
import { distance as
|
|
1803
|
-
import { z as
|
|
1811
|
+
import { distance as distance23 } from "circuit-json";
|
|
1812
|
+
import { z as z78 } from "zod";
|
|
1804
1813
|
var courtyardRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
1805
|
-
width:
|
|
1806
|
-
height:
|
|
1807
|
-
strokeWidth:
|
|
1808
|
-
isFilled:
|
|
1809
|
-
hasStroke:
|
|
1810
|
-
isStrokeDashed:
|
|
1811
|
-
color:
|
|
1814
|
+
width: distance23,
|
|
1815
|
+
height: distance23,
|
|
1816
|
+
strokeWidth: distance23.optional(),
|
|
1817
|
+
isFilled: z78.boolean().optional(),
|
|
1818
|
+
hasStroke: z78.boolean().optional(),
|
|
1819
|
+
isStrokeDashed: z78.boolean().optional(),
|
|
1820
|
+
color: z78.string().optional()
|
|
1812
1821
|
});
|
|
1813
1822
|
|
|
1814
1823
|
// lib/components/courtyard-outline.ts
|
|
1815
1824
|
import { length as length6 } from "circuit-json";
|
|
1816
|
-
import { z as
|
|
1825
|
+
import { z as z79 } from "zod";
|
|
1817
1826
|
var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
1818
1827
|
pcbX: true,
|
|
1819
1828
|
pcbY: true,
|
|
@@ -1821,41 +1830,41 @@ var courtyardOutlineProps = pcbLayoutProps.omit({
|
|
|
1821
1830
|
pcbOffsetY: true,
|
|
1822
1831
|
pcbRotation: true
|
|
1823
1832
|
}).extend({
|
|
1824
|
-
outline:
|
|
1833
|
+
outline: z79.array(point),
|
|
1825
1834
|
strokeWidth: length6.optional(),
|
|
1826
|
-
isClosed:
|
|
1827
|
-
isStrokeDashed:
|
|
1828
|
-
color:
|
|
1835
|
+
isClosed: z79.boolean().optional(),
|
|
1836
|
+
isStrokeDashed: z79.boolean().optional(),
|
|
1837
|
+
color: z79.string().optional()
|
|
1829
1838
|
});
|
|
1830
1839
|
|
|
1831
1840
|
// lib/components/copper-pour.ts
|
|
1832
|
-
import { z as
|
|
1841
|
+
import { z as z80 } from "zod";
|
|
1833
1842
|
import { layer_ref as layer_ref6 } from "circuit-json";
|
|
1834
|
-
var copperPourProps =
|
|
1835
|
-
name:
|
|
1843
|
+
var copperPourProps = z80.object({
|
|
1844
|
+
name: z80.string().optional(),
|
|
1836
1845
|
layer: layer_ref6,
|
|
1837
|
-
connectsTo:
|
|
1846
|
+
connectsTo: z80.string(),
|
|
1838
1847
|
padMargin: distance.optional(),
|
|
1839
1848
|
traceMargin: distance.optional(),
|
|
1840
1849
|
clearance: distance.optional(),
|
|
1841
1850
|
boardEdgeMargin: distance.optional(),
|
|
1842
1851
|
cutoutMargin: distance.optional(),
|
|
1843
|
-
coveredWithSolderMask:
|
|
1852
|
+
coveredWithSolderMask: z80.boolean().optional().default(true)
|
|
1844
1853
|
});
|
|
1845
1854
|
expectTypesMatch(true);
|
|
1846
1855
|
|
|
1847
1856
|
// lib/components/cadassembly.ts
|
|
1848
1857
|
import { layer_ref as layer_ref7 } from "circuit-json";
|
|
1849
|
-
import { z as
|
|
1850
|
-
var cadassemblyProps =
|
|
1858
|
+
import { z as z81 } from "zod";
|
|
1859
|
+
var cadassemblyProps = z81.object({
|
|
1851
1860
|
originalLayer: layer_ref7.default("top").optional(),
|
|
1852
|
-
children:
|
|
1861
|
+
children: z81.any().optional()
|
|
1853
1862
|
});
|
|
1854
1863
|
expectTypesMatch(true);
|
|
1855
1864
|
|
|
1856
1865
|
// lib/components/cadmodel.ts
|
|
1857
|
-
import { z as
|
|
1858
|
-
var pcbPosition =
|
|
1866
|
+
import { z as z82 } from "zod";
|
|
1867
|
+
var pcbPosition = z82.object({
|
|
1859
1868
|
pcbX: distance.optional(),
|
|
1860
1869
|
pcbY: distance.optional(),
|
|
1861
1870
|
pcbOffsetX: distance.optional(),
|
|
@@ -1863,12 +1872,12 @@ var pcbPosition = z81.object({
|
|
|
1863
1872
|
pcbZ: distance.optional()
|
|
1864
1873
|
});
|
|
1865
1874
|
var cadModelBaseWithUrl = cadModelBase.extend({
|
|
1866
|
-
modelUrl:
|
|
1867
|
-
stepUrl:
|
|
1875
|
+
modelUrl: z82.string(),
|
|
1876
|
+
stepUrl: z82.string().optional()
|
|
1868
1877
|
});
|
|
1869
1878
|
var cadModelObject = cadModelBaseWithUrl.merge(pcbPosition);
|
|
1870
1879
|
expectTypesMatch(true);
|
|
1871
|
-
var cadmodelProps =
|
|
1880
|
+
var cadmodelProps = z82.union([z82.null(), z82.string(), cadModelObject]);
|
|
1872
1881
|
|
|
1873
1882
|
// lib/components/power-source.ts
|
|
1874
1883
|
import { voltage as voltage3 } from "circuit-json";
|
|
@@ -1878,9 +1887,9 @@ var powerSourceProps = commonComponentProps.extend({
|
|
|
1878
1887
|
|
|
1879
1888
|
// lib/components/voltagesource.ts
|
|
1880
1889
|
import { frequency as frequency4, rotation as rotation4, voltage as voltage4 } from "circuit-json";
|
|
1881
|
-
import { z as
|
|
1890
|
+
import { z as z83 } from "zod";
|
|
1882
1891
|
var voltageSourcePinLabels = ["pin1", "pin2", "pos", "neg"];
|
|
1883
|
-
var percentage =
|
|
1892
|
+
var percentage = z83.union([z83.string(), z83.number()]).transform((val) => {
|
|
1884
1893
|
if (typeof val === "string") {
|
|
1885
1894
|
if (val.endsWith("%")) {
|
|
1886
1895
|
return parseFloat(val.slice(0, -1)) / 100;
|
|
@@ -1889,13 +1898,13 @@ var percentage = z82.union([z82.string(), z82.number()]).transform((val) => {
|
|
|
1889
1898
|
}
|
|
1890
1899
|
return val;
|
|
1891
1900
|
}).pipe(
|
|
1892
|
-
|
|
1901
|
+
z83.number().min(0, "Duty cycle must be non-negative").max(1, "Duty cycle cannot be greater than 100%")
|
|
1893
1902
|
);
|
|
1894
1903
|
var voltageSourceProps = commonComponentProps.extend({
|
|
1895
1904
|
voltage: voltage4.optional(),
|
|
1896
1905
|
frequency: frequency4.optional(),
|
|
1897
1906
|
peakToPeakVoltage: voltage4.optional(),
|
|
1898
|
-
waveShape:
|
|
1907
|
+
waveShape: z83.enum(["sinewave", "square", "triangle", "sawtooth"]).optional(),
|
|
1899
1908
|
phase: rotation4.optional(),
|
|
1900
1909
|
dutyCycle: percentage.optional(),
|
|
1901
1910
|
connections: createConnectionsProp(voltageSourcePinLabels).optional()
|
|
@@ -1904,49 +1913,49 @@ var voltageSourcePins = lrPolarPins;
|
|
|
1904
1913
|
expectTypesMatch(true);
|
|
1905
1914
|
|
|
1906
1915
|
// lib/components/voltageprobe.ts
|
|
1907
|
-
import { z as
|
|
1916
|
+
import { z as z84 } from "zod";
|
|
1908
1917
|
var voltageProbeProps = commonComponentProps.omit({ name: true }).extend({
|
|
1909
|
-
name:
|
|
1910
|
-
connectsTo:
|
|
1911
|
-
referenceTo:
|
|
1912
|
-
color:
|
|
1918
|
+
name: z84.string().optional(),
|
|
1919
|
+
connectsTo: z84.string(),
|
|
1920
|
+
referenceTo: z84.string().optional(),
|
|
1921
|
+
color: z84.string().optional()
|
|
1913
1922
|
});
|
|
1914
1923
|
expectTypesMatch(true);
|
|
1915
1924
|
|
|
1916
1925
|
// lib/components/schematic-arc.ts
|
|
1917
|
-
import { distance as
|
|
1918
|
-
import { z as
|
|
1919
|
-
var schematicArcProps =
|
|
1926
|
+
import { distance as distance24, point as point5, rotation as rotation5 } from "circuit-json";
|
|
1927
|
+
import { z as z85 } from "zod";
|
|
1928
|
+
var schematicArcProps = z85.object({
|
|
1920
1929
|
center: point5,
|
|
1921
|
-
radius:
|
|
1930
|
+
radius: distance24,
|
|
1922
1931
|
startAngleDegrees: rotation5,
|
|
1923
1932
|
endAngleDegrees: rotation5,
|
|
1924
|
-
direction:
|
|
1925
|
-
strokeWidth:
|
|
1926
|
-
color:
|
|
1927
|
-
isDashed:
|
|
1933
|
+
direction: z85.enum(["clockwise", "counterclockwise"]).default("counterclockwise"),
|
|
1934
|
+
strokeWidth: distance24.optional(),
|
|
1935
|
+
color: z85.string().optional(),
|
|
1936
|
+
isDashed: z85.boolean().optional().default(false)
|
|
1928
1937
|
});
|
|
1929
1938
|
|
|
1930
1939
|
// lib/components/schematic-box.ts
|
|
1931
|
-
import { distance as
|
|
1932
|
-
import { z as
|
|
1933
|
-
var schematicBoxProps =
|
|
1934
|
-
schX:
|
|
1935
|
-
schY:
|
|
1936
|
-
width:
|
|
1937
|
-
height:
|
|
1938
|
-
overlay:
|
|
1939
|
-
padding:
|
|
1940
|
-
paddingLeft:
|
|
1941
|
-
paddingRight:
|
|
1942
|
-
paddingTop:
|
|
1943
|
-
paddingBottom:
|
|
1944
|
-
title:
|
|
1940
|
+
import { distance as distance25 } from "circuit-json";
|
|
1941
|
+
import { z as z86 } from "zod";
|
|
1942
|
+
var schematicBoxProps = z86.object({
|
|
1943
|
+
schX: distance25.optional(),
|
|
1944
|
+
schY: distance25.optional(),
|
|
1945
|
+
width: distance25.optional(),
|
|
1946
|
+
height: distance25.optional(),
|
|
1947
|
+
overlay: z86.array(z86.string()).optional(),
|
|
1948
|
+
padding: distance25.optional(),
|
|
1949
|
+
paddingLeft: distance25.optional(),
|
|
1950
|
+
paddingRight: distance25.optional(),
|
|
1951
|
+
paddingTop: distance25.optional(),
|
|
1952
|
+
paddingBottom: distance25.optional(),
|
|
1953
|
+
title: z86.string().optional(),
|
|
1945
1954
|
titleAlignment: ninePointAnchor.default("top_left"),
|
|
1946
|
-
titleColor:
|
|
1947
|
-
titleFontSize:
|
|
1948
|
-
titleInside:
|
|
1949
|
-
strokeStyle:
|
|
1955
|
+
titleColor: z86.string().optional(),
|
|
1956
|
+
titleFontSize: distance25.optional(),
|
|
1957
|
+
titleInside: z86.boolean().default(false),
|
|
1958
|
+
strokeStyle: z86.enum(["solid", "dashed"]).default("solid")
|
|
1950
1959
|
}).refine(
|
|
1951
1960
|
(elm) => elm.width !== void 0 && elm.height !== void 0 || Array.isArray(elm.overlay) && elm.overlay.length > 0,
|
|
1952
1961
|
{
|
|
@@ -1960,55 +1969,55 @@ var schematicBoxProps = z85.object({
|
|
|
1960
1969
|
);
|
|
1961
1970
|
|
|
1962
1971
|
// lib/components/schematic-circle.ts
|
|
1963
|
-
import { distance as
|
|
1964
|
-
import { z as z86 } from "zod";
|
|
1965
|
-
var schematicCircleProps = z86.object({
|
|
1966
|
-
center: point6,
|
|
1967
|
-
radius: distance25,
|
|
1968
|
-
strokeWidth: distance25.optional(),
|
|
1969
|
-
color: z86.string().optional(),
|
|
1970
|
-
isFilled: z86.boolean().optional().default(false),
|
|
1971
|
-
fillColor: z86.string().optional(),
|
|
1972
|
-
isDashed: z86.boolean().optional().default(false)
|
|
1973
|
-
});
|
|
1974
|
-
|
|
1975
|
-
// lib/components/schematic-rect.ts
|
|
1976
|
-
import { distance as distance26, rotation as rotation6 } from "circuit-json";
|
|
1972
|
+
import { distance as distance26, point as point6 } from "circuit-json";
|
|
1977
1973
|
import { z as z87 } from "zod";
|
|
1978
|
-
var
|
|
1979
|
-
|
|
1980
|
-
|
|
1981
|
-
width: distance26,
|
|
1982
|
-
height: distance26,
|
|
1983
|
-
rotation: rotation6.default(0),
|
|
1974
|
+
var schematicCircleProps = z87.object({
|
|
1975
|
+
center: point6,
|
|
1976
|
+
radius: distance26,
|
|
1984
1977
|
strokeWidth: distance26.optional(),
|
|
1985
1978
|
color: z87.string().optional(),
|
|
1986
1979
|
isFilled: z87.boolean().optional().default(false),
|
|
1987
1980
|
fillColor: z87.string().optional(),
|
|
1988
|
-
isDashed: z87.boolean().optional().default(false)
|
|
1989
|
-
cornerRadius: distance26.optional()
|
|
1981
|
+
isDashed: z87.boolean().optional().default(false)
|
|
1990
1982
|
});
|
|
1991
1983
|
|
|
1992
|
-
// lib/components/schematic-
|
|
1993
|
-
import { distance as distance27 } from "circuit-json";
|
|
1984
|
+
// lib/components/schematic-rect.ts
|
|
1985
|
+
import { distance as distance27, rotation as rotation6 } from "circuit-json";
|
|
1994
1986
|
import { z as z88 } from "zod";
|
|
1995
|
-
var
|
|
1996
|
-
|
|
1997
|
-
|
|
1998
|
-
|
|
1999
|
-
|
|
1987
|
+
var schematicRectProps = z88.object({
|
|
1988
|
+
schX: distance27.optional(),
|
|
1989
|
+
schY: distance27.optional(),
|
|
1990
|
+
width: distance27,
|
|
1991
|
+
height: distance27,
|
|
1992
|
+
rotation: rotation6.default(0),
|
|
2000
1993
|
strokeWidth: distance27.optional(),
|
|
2001
1994
|
color: z88.string().optional(),
|
|
2002
|
-
|
|
1995
|
+
isFilled: z88.boolean().optional().default(false),
|
|
1996
|
+
fillColor: z88.string().optional(),
|
|
1997
|
+
isDashed: z88.boolean().optional().default(false),
|
|
1998
|
+
cornerRadius: distance27.optional()
|
|
1999
|
+
});
|
|
2000
|
+
|
|
2001
|
+
// lib/components/schematic-line.ts
|
|
2002
|
+
import { distance as distance28 } from "circuit-json";
|
|
2003
|
+
import { z as z89 } from "zod";
|
|
2004
|
+
var schematicLineProps = z89.object({
|
|
2005
|
+
x1: distance28,
|
|
2006
|
+
y1: distance28,
|
|
2007
|
+
x2: distance28,
|
|
2008
|
+
y2: distance28,
|
|
2009
|
+
strokeWidth: distance28.optional(),
|
|
2010
|
+
color: z89.string().optional(),
|
|
2011
|
+
isDashed: z89.boolean().optional().default(false)
|
|
2003
2012
|
});
|
|
2004
2013
|
|
|
2005
2014
|
// lib/components/schematic-text.ts
|
|
2006
|
-
import { distance as
|
|
2007
|
-
import { z as
|
|
2015
|
+
import { distance as distance29, rotation as rotation7 } from "circuit-json";
|
|
2016
|
+
import { z as z91 } from "zod";
|
|
2008
2017
|
|
|
2009
2018
|
// lib/common/fivePointAnchor.ts
|
|
2010
|
-
import { z as
|
|
2011
|
-
var fivePointAnchor =
|
|
2019
|
+
import { z as z90 } from "zod";
|
|
2020
|
+
var fivePointAnchor = z90.enum([
|
|
2012
2021
|
"center",
|
|
2013
2022
|
"left",
|
|
2014
2023
|
"right",
|
|
@@ -2017,97 +2026,97 @@ var fivePointAnchor = z89.enum([
|
|
|
2017
2026
|
]);
|
|
2018
2027
|
|
|
2019
2028
|
// lib/components/schematic-text.ts
|
|
2020
|
-
var schematicTextProps =
|
|
2021
|
-
schX:
|
|
2022
|
-
schY:
|
|
2023
|
-
text:
|
|
2024
|
-
fontSize:
|
|
2025
|
-
anchor:
|
|
2026
|
-
color:
|
|
2029
|
+
var schematicTextProps = z91.object({
|
|
2030
|
+
schX: distance29.optional(),
|
|
2031
|
+
schY: distance29.optional(),
|
|
2032
|
+
text: z91.string(),
|
|
2033
|
+
fontSize: z91.number().default(1),
|
|
2034
|
+
anchor: z91.union([fivePointAnchor.describe("legacy"), ninePointAnchor]).default("center"),
|
|
2035
|
+
color: z91.string().default("#000000"),
|
|
2027
2036
|
schRotation: rotation7.default(0)
|
|
2028
2037
|
});
|
|
2029
2038
|
|
|
2030
2039
|
// lib/components/schematic-path.ts
|
|
2031
2040
|
import { point as point8 } from "circuit-json";
|
|
2032
|
-
import { z as
|
|
2033
|
-
var schematicPathProps =
|
|
2034
|
-
points:
|
|
2035
|
-
isFilled:
|
|
2036
|
-
fillColor:
|
|
2041
|
+
import { z as z92 } from "zod";
|
|
2042
|
+
var schematicPathProps = z92.object({
|
|
2043
|
+
points: z92.array(point8),
|
|
2044
|
+
isFilled: z92.boolean().optional().default(false),
|
|
2045
|
+
fillColor: z92.enum(["red", "blue"]).optional()
|
|
2037
2046
|
});
|
|
2038
2047
|
|
|
2039
2048
|
// lib/components/schematic-table.ts
|
|
2040
|
-
import { distance as
|
|
2041
|
-
import { z as
|
|
2042
|
-
var schematicTableProps =
|
|
2043
|
-
schX:
|
|
2044
|
-
schY:
|
|
2045
|
-
children:
|
|
2046
|
-
cellPadding:
|
|
2047
|
-
borderWidth:
|
|
2049
|
+
import { distance as distance30 } from "circuit-json";
|
|
2050
|
+
import { z as z93 } from "zod";
|
|
2051
|
+
var schematicTableProps = z93.object({
|
|
2052
|
+
schX: distance30.optional(),
|
|
2053
|
+
schY: distance30.optional(),
|
|
2054
|
+
children: z93.any().optional(),
|
|
2055
|
+
cellPadding: distance30.optional(),
|
|
2056
|
+
borderWidth: distance30.optional(),
|
|
2048
2057
|
anchor: ninePointAnchor.optional(),
|
|
2049
|
-
fontSize:
|
|
2058
|
+
fontSize: distance30.optional()
|
|
2050
2059
|
});
|
|
2051
2060
|
expectTypesMatch(true);
|
|
2052
2061
|
|
|
2053
2062
|
// lib/components/schematic-row.ts
|
|
2054
|
-
import { distance as
|
|
2055
|
-
import { z as
|
|
2056
|
-
var schematicRowProps =
|
|
2057
|
-
children:
|
|
2058
|
-
height:
|
|
2063
|
+
import { distance as distance31 } from "circuit-json";
|
|
2064
|
+
import { z as z94 } from "zod";
|
|
2065
|
+
var schematicRowProps = z94.object({
|
|
2066
|
+
children: z94.any().optional(),
|
|
2067
|
+
height: distance31.optional()
|
|
2059
2068
|
});
|
|
2060
2069
|
expectTypesMatch(true);
|
|
2061
2070
|
|
|
2062
2071
|
// lib/components/schematic-cell.ts
|
|
2063
|
-
import { distance as
|
|
2064
|
-
import { z as
|
|
2065
|
-
var schematicCellProps =
|
|
2066
|
-
children:
|
|
2067
|
-
horizontalAlign:
|
|
2068
|
-
verticalAlign:
|
|
2069
|
-
fontSize:
|
|
2070
|
-
rowSpan:
|
|
2071
|
-
colSpan:
|
|
2072
|
-
width:
|
|
2073
|
-
text:
|
|
2072
|
+
import { distance as distance32 } from "circuit-json";
|
|
2073
|
+
import { z as z95 } from "zod";
|
|
2074
|
+
var schematicCellProps = z95.object({
|
|
2075
|
+
children: z95.string().optional(),
|
|
2076
|
+
horizontalAlign: z95.enum(["left", "center", "right"]).optional(),
|
|
2077
|
+
verticalAlign: z95.enum(["top", "middle", "bottom"]).optional(),
|
|
2078
|
+
fontSize: distance32.optional(),
|
|
2079
|
+
rowSpan: z95.number().optional(),
|
|
2080
|
+
colSpan: z95.number().optional(),
|
|
2081
|
+
width: distance32.optional(),
|
|
2082
|
+
text: z95.string().optional()
|
|
2074
2083
|
});
|
|
2075
2084
|
expectTypesMatch(true);
|
|
2076
2085
|
|
|
2077
2086
|
// lib/components/copper-text.ts
|
|
2078
2087
|
import { layer_ref as layer_ref8, length as length7 } from "circuit-json";
|
|
2079
|
-
import { z as
|
|
2088
|
+
import { z as z96 } from "zod";
|
|
2080
2089
|
var copperTextProps = pcbLayoutProps.extend({
|
|
2081
|
-
text:
|
|
2090
|
+
text: z96.string(),
|
|
2082
2091
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2083
|
-
font:
|
|
2092
|
+
font: z96.enum(["tscircuit2024"]).optional(),
|
|
2084
2093
|
fontSize: length7.optional(),
|
|
2085
|
-
layers:
|
|
2094
|
+
layers: z96.array(layer_ref8).optional()
|
|
2086
2095
|
});
|
|
2087
2096
|
|
|
2088
2097
|
// lib/components/silkscreen-text.ts
|
|
2089
2098
|
import { layer_ref as layer_ref9, length as length8 } from "circuit-json";
|
|
2090
|
-
import { z as
|
|
2099
|
+
import { z as z97 } from "zod";
|
|
2091
2100
|
var silkscreenTextProps = pcbLayoutProps.extend({
|
|
2092
|
-
text:
|
|
2101
|
+
text: z97.string(),
|
|
2093
2102
|
anchorAlignment: ninePointAnchor.default("center"),
|
|
2094
|
-
font:
|
|
2103
|
+
font: z97.enum(["tscircuit2024"]).optional(),
|
|
2095
2104
|
fontSize: length8.optional(),
|
|
2096
2105
|
/**
|
|
2097
2106
|
* If true, text will knock out underlying silkscreen
|
|
2098
2107
|
*/
|
|
2099
|
-
isKnockout:
|
|
2108
|
+
isKnockout: z97.boolean().optional(),
|
|
2100
2109
|
knockoutPadding: length8.optional(),
|
|
2101
2110
|
knockoutPaddingLeft: length8.optional(),
|
|
2102
2111
|
knockoutPaddingRight: length8.optional(),
|
|
2103
2112
|
knockoutPaddingTop: length8.optional(),
|
|
2104
2113
|
knockoutPaddingBottom: length8.optional(),
|
|
2105
|
-
layers:
|
|
2114
|
+
layers: z97.array(layer_ref9).optional()
|
|
2106
2115
|
});
|
|
2107
2116
|
|
|
2108
2117
|
// lib/components/silkscreen-path.ts
|
|
2109
2118
|
import { length as length9, route_hint_point as route_hint_point5 } from "circuit-json";
|
|
2110
|
-
import { z as
|
|
2119
|
+
import { z as z98 } from "zod";
|
|
2111
2120
|
var silkscreenPathProps = pcbLayoutProps.omit({
|
|
2112
2121
|
pcbX: true,
|
|
2113
2122
|
pcbY: true,
|
|
@@ -2115,12 +2124,12 @@ var silkscreenPathProps = pcbLayoutProps.omit({
|
|
|
2115
2124
|
pcbOffsetY: true,
|
|
2116
2125
|
pcbRotation: true
|
|
2117
2126
|
}).extend({
|
|
2118
|
-
route:
|
|
2127
|
+
route: z98.array(route_hint_point5),
|
|
2119
2128
|
strokeWidth: length9.optional()
|
|
2120
2129
|
});
|
|
2121
2130
|
|
|
2122
2131
|
// lib/components/silkscreen-line.ts
|
|
2123
|
-
import { distance as
|
|
2132
|
+
import { distance as distance33 } from "circuit-json";
|
|
2124
2133
|
var silkscreenLineProps = pcbLayoutProps.omit({
|
|
2125
2134
|
pcbX: true,
|
|
2126
2135
|
pcbY: true,
|
|
@@ -2128,88 +2137,88 @@ var silkscreenLineProps = pcbLayoutProps.omit({
|
|
|
2128
2137
|
pcbOffsetY: true,
|
|
2129
2138
|
pcbRotation: true
|
|
2130
2139
|
}).extend({
|
|
2131
|
-
strokeWidth:
|
|
2132
|
-
x1:
|
|
2133
|
-
y1:
|
|
2134
|
-
x2:
|
|
2135
|
-
y2:
|
|
2140
|
+
strokeWidth: distance33,
|
|
2141
|
+
x1: distance33,
|
|
2142
|
+
y1: distance33,
|
|
2143
|
+
x2: distance33,
|
|
2144
|
+
y2: distance33
|
|
2136
2145
|
});
|
|
2137
2146
|
|
|
2138
2147
|
// lib/components/silkscreen-rect.ts
|
|
2139
|
-
import { distance as
|
|
2140
|
-
import { z as
|
|
2148
|
+
import { distance as distance34 } from "circuit-json";
|
|
2149
|
+
import { z as z99 } from "zod";
|
|
2141
2150
|
var silkscreenRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2142
|
-
filled:
|
|
2143
|
-
stroke:
|
|
2144
|
-
strokeWidth:
|
|
2145
|
-
width:
|
|
2146
|
-
height:
|
|
2147
|
-
cornerRadius:
|
|
2151
|
+
filled: z99.boolean().default(true).optional(),
|
|
2152
|
+
stroke: z99.enum(["dashed", "solid", "none"]).optional(),
|
|
2153
|
+
strokeWidth: distance34.optional(),
|
|
2154
|
+
width: distance34,
|
|
2155
|
+
height: distance34,
|
|
2156
|
+
cornerRadius: distance34.optional()
|
|
2148
2157
|
});
|
|
2149
2158
|
|
|
2150
2159
|
// lib/components/silkscreen-circle.ts
|
|
2151
|
-
import { distance as
|
|
2152
|
-
import { z as
|
|
2160
|
+
import { distance as distance35 } from "circuit-json";
|
|
2161
|
+
import { z as z100 } from "zod";
|
|
2153
2162
|
var silkscreenCircleProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2154
|
-
isFilled:
|
|
2155
|
-
isOutline:
|
|
2156
|
-
strokeWidth:
|
|
2157
|
-
radius:
|
|
2163
|
+
isFilled: z100.boolean().optional(),
|
|
2164
|
+
isOutline: z100.boolean().optional(),
|
|
2165
|
+
strokeWidth: distance35.optional(),
|
|
2166
|
+
radius: distance35
|
|
2158
2167
|
});
|
|
2159
2168
|
|
|
2160
2169
|
// lib/components/trace-hint.ts
|
|
2161
|
-
import { distance as
|
|
2162
|
-
import { z as
|
|
2163
|
-
var routeHintPointProps =
|
|
2164
|
-
x:
|
|
2165
|
-
y:
|
|
2166
|
-
via:
|
|
2170
|
+
import { distance as distance36, layer_ref as layer_ref10, route_hint_point as route_hint_point6 } from "circuit-json";
|
|
2171
|
+
import { z as z101 } from "zod";
|
|
2172
|
+
var routeHintPointProps = z101.object({
|
|
2173
|
+
x: distance36,
|
|
2174
|
+
y: distance36,
|
|
2175
|
+
via: z101.boolean().optional(),
|
|
2167
2176
|
toLayer: layer_ref10.optional()
|
|
2168
2177
|
});
|
|
2169
|
-
var traceHintProps =
|
|
2170
|
-
for:
|
|
2178
|
+
var traceHintProps = z101.object({
|
|
2179
|
+
for: z101.string().optional().describe(
|
|
2171
2180
|
"Selector for the port you're targeting, not required if you're inside a trace"
|
|
2172
2181
|
),
|
|
2173
|
-
order:
|
|
2182
|
+
order: z101.number().optional(),
|
|
2174
2183
|
offset: route_hint_point6.or(routeHintPointProps).optional(),
|
|
2175
|
-
offsets:
|
|
2176
|
-
traceWidth:
|
|
2184
|
+
offsets: z101.array(route_hint_point6).or(z101.array(routeHintPointProps)).optional(),
|
|
2185
|
+
traceWidth: z101.number().optional()
|
|
2177
2186
|
});
|
|
2178
2187
|
|
|
2179
2188
|
// lib/components/port.ts
|
|
2180
|
-
import { z as
|
|
2189
|
+
import { z as z102 } from "zod";
|
|
2181
2190
|
var portProps = commonLayoutProps.extend({
|
|
2182
|
-
name:
|
|
2183
|
-
pinNumber:
|
|
2184
|
-
aliases:
|
|
2191
|
+
name: z102.string(),
|
|
2192
|
+
pinNumber: z102.number().optional(),
|
|
2193
|
+
aliases: z102.array(z102.string()).optional(),
|
|
2185
2194
|
direction,
|
|
2186
|
-
connectsTo:
|
|
2195
|
+
connectsTo: z102.string().or(z102.array(z102.string())).optional()
|
|
2187
2196
|
});
|
|
2188
2197
|
|
|
2189
2198
|
// lib/components/pcb-note-text.ts
|
|
2190
2199
|
import { length as length10 } from "circuit-json";
|
|
2191
|
-
import { z as
|
|
2200
|
+
import { z as z103 } from "zod";
|
|
2192
2201
|
var pcbNoteTextProps = pcbLayoutProps.extend({
|
|
2193
|
-
text:
|
|
2194
|
-
anchorAlignment:
|
|
2195
|
-
font:
|
|
2202
|
+
text: z103.string(),
|
|
2203
|
+
anchorAlignment: z103.enum(["center", "top_left", "top_right", "bottom_left", "bottom_right"]).default("center"),
|
|
2204
|
+
font: z103.enum(["tscircuit2024"]).optional(),
|
|
2196
2205
|
fontSize: length10.optional(),
|
|
2197
|
-
color:
|
|
2206
|
+
color: z103.string().optional()
|
|
2198
2207
|
});
|
|
2199
2208
|
expectTypesMatch(true);
|
|
2200
2209
|
|
|
2201
2210
|
// lib/components/pcb-note-rect.ts
|
|
2202
|
-
import { distance as
|
|
2203
|
-
import { z as
|
|
2211
|
+
import { distance as distance37 } from "circuit-json";
|
|
2212
|
+
import { z as z104 } from "zod";
|
|
2204
2213
|
var pcbNoteRectProps = pcbLayoutProps.omit({ pcbRotation: true }).extend({
|
|
2205
|
-
width:
|
|
2206
|
-
height:
|
|
2207
|
-
strokeWidth:
|
|
2208
|
-
isFilled:
|
|
2209
|
-
hasStroke:
|
|
2210
|
-
isStrokeDashed:
|
|
2211
|
-
color:
|
|
2212
|
-
cornerRadius:
|
|
2214
|
+
width: distance37,
|
|
2215
|
+
height: distance37,
|
|
2216
|
+
strokeWidth: distance37.optional(),
|
|
2217
|
+
isFilled: z104.boolean().optional(),
|
|
2218
|
+
hasStroke: z104.boolean().optional(),
|
|
2219
|
+
isStrokeDashed: z104.boolean().optional(),
|
|
2220
|
+
color: z104.string().optional(),
|
|
2221
|
+
cornerRadius: distance37.optional()
|
|
2213
2222
|
});
|
|
2214
2223
|
expectTypesMatch(true);
|
|
2215
2224
|
|
|
@@ -2218,7 +2227,7 @@ import {
|
|
|
2218
2227
|
length as length11,
|
|
2219
2228
|
route_hint_point as route_hint_point7
|
|
2220
2229
|
} from "circuit-json";
|
|
2221
|
-
import { z as
|
|
2230
|
+
import { z as z105 } from "zod";
|
|
2222
2231
|
var pcbNotePathProps = pcbLayoutProps.omit({
|
|
2223
2232
|
pcbX: true,
|
|
2224
2233
|
pcbY: true,
|
|
@@ -2226,15 +2235,15 @@ var pcbNotePathProps = pcbLayoutProps.omit({
|
|
|
2226
2235
|
pcbOffsetY: true,
|
|
2227
2236
|
pcbRotation: true
|
|
2228
2237
|
}).extend({
|
|
2229
|
-
route:
|
|
2238
|
+
route: z105.array(route_hint_point7),
|
|
2230
2239
|
strokeWidth: length11.optional(),
|
|
2231
|
-
color:
|
|
2240
|
+
color: z105.string().optional()
|
|
2232
2241
|
});
|
|
2233
2242
|
expectTypesMatch(true);
|
|
2234
2243
|
|
|
2235
2244
|
// lib/components/pcb-note-line.ts
|
|
2236
|
-
import { distance as
|
|
2237
|
-
import { z as
|
|
2245
|
+
import { distance as distance38 } from "circuit-json";
|
|
2246
|
+
import { z as z106 } from "zod";
|
|
2238
2247
|
var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
2239
2248
|
pcbX: true,
|
|
2240
2249
|
pcbY: true,
|
|
@@ -2242,20 +2251,20 @@ var pcbNoteLineProps = pcbLayoutProps.omit({
|
|
|
2242
2251
|
pcbOffsetY: true,
|
|
2243
2252
|
pcbRotation: true
|
|
2244
2253
|
}).extend({
|
|
2245
|
-
x1:
|
|
2246
|
-
y1:
|
|
2247
|
-
x2:
|
|
2248
|
-
y2:
|
|
2249
|
-
strokeWidth:
|
|
2250
|
-
color:
|
|
2251
|
-
isDashed:
|
|
2254
|
+
x1: distance38,
|
|
2255
|
+
y1: distance38,
|
|
2256
|
+
x2: distance38,
|
|
2257
|
+
y2: distance38,
|
|
2258
|
+
strokeWidth: distance38.optional(),
|
|
2259
|
+
color: z106.string().optional(),
|
|
2260
|
+
isDashed: z106.boolean().optional()
|
|
2252
2261
|
});
|
|
2253
2262
|
expectTypesMatch(true);
|
|
2254
2263
|
|
|
2255
2264
|
// lib/components/pcb-note-dimension.ts
|
|
2256
|
-
import { distance as
|
|
2257
|
-
import { z as
|
|
2258
|
-
var dimensionTarget2 =
|
|
2265
|
+
import { distance as distance39, length as length12 } from "circuit-json";
|
|
2266
|
+
import { z as z107 } from "zod";
|
|
2267
|
+
var dimensionTarget2 = z107.union([z107.string(), point]);
|
|
2259
2268
|
var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
2260
2269
|
pcbX: true,
|
|
2261
2270
|
pcbY: true,
|
|
@@ -2265,93 +2274,93 @@ var pcbNoteDimensionProps = pcbLayoutProps.omit({
|
|
|
2265
2274
|
}).extend({
|
|
2266
2275
|
from: dimensionTarget2,
|
|
2267
2276
|
to: dimensionTarget2,
|
|
2268
|
-
text:
|
|
2269
|
-
offset:
|
|
2270
|
-
font:
|
|
2277
|
+
text: z107.string().optional(),
|
|
2278
|
+
offset: distance39.optional(),
|
|
2279
|
+
font: z107.enum(["tscircuit2024"]).optional(),
|
|
2271
2280
|
fontSize: length12.optional(),
|
|
2272
|
-
color:
|
|
2273
|
-
arrowSize:
|
|
2274
|
-
units:
|
|
2275
|
-
outerEdgeToEdge:
|
|
2276
|
-
centerToCenter:
|
|
2277
|
-
innerEdgeToEdge:
|
|
2281
|
+
color: z107.string().optional(),
|
|
2282
|
+
arrowSize: distance39.optional(),
|
|
2283
|
+
units: z107.enum(["in", "mm"]).optional(),
|
|
2284
|
+
outerEdgeToEdge: z107.literal(true).optional(),
|
|
2285
|
+
centerToCenter: z107.literal(true).optional(),
|
|
2286
|
+
innerEdgeToEdge: z107.literal(true).optional()
|
|
2278
2287
|
});
|
|
2279
2288
|
expectTypesMatch(
|
|
2280
2289
|
true
|
|
2281
2290
|
);
|
|
2282
2291
|
|
|
2283
2292
|
// lib/platformConfig.ts
|
|
2284
|
-
import { z as
|
|
2285
|
-
var unvalidatedCircuitJson =
|
|
2286
|
-
var footprintLibraryResult =
|
|
2287
|
-
footprintCircuitJson:
|
|
2293
|
+
import { z as z108 } from "zod";
|
|
2294
|
+
var unvalidatedCircuitJson = z108.array(z108.any()).describe("Circuit JSON");
|
|
2295
|
+
var footprintLibraryResult = z108.object({
|
|
2296
|
+
footprintCircuitJson: z108.array(z108.any()),
|
|
2288
2297
|
cadModel: cadModelProp.optional()
|
|
2289
2298
|
});
|
|
2290
|
-
var pathToCircuitJsonFn =
|
|
2291
|
-
|
|
2292
|
-
|
|
2293
|
-
|
|
2294
|
-
).returns(
|
|
2299
|
+
var pathToCircuitJsonFn = z108.function().args(z108.string()).returns(z108.promise(footprintLibraryResult)).or(
|
|
2300
|
+
z108.function().args(
|
|
2301
|
+
z108.string(),
|
|
2302
|
+
z108.object({ resolvedPcbStyle: pcbStyle.optional() }).optional()
|
|
2303
|
+
).returns(z108.promise(footprintLibraryResult))
|
|
2295
2304
|
).describe("A function that takes a path and returns Circuit JSON");
|
|
2296
|
-
var footprintFileParserEntry =
|
|
2297
|
-
loadFromUrl:
|
|
2305
|
+
var footprintFileParserEntry = z108.object({
|
|
2306
|
+
loadFromUrl: z108.function().args(z108.string()).returns(z108.promise(footprintLibraryResult)).describe(
|
|
2298
2307
|
"A function that takes a footprint file URL and returns Circuit JSON"
|
|
2299
2308
|
)
|
|
2300
2309
|
});
|
|
2301
|
-
var spiceEngineSimulationResult =
|
|
2302
|
-
engineVersionString:
|
|
2310
|
+
var spiceEngineSimulationResult = z108.object({
|
|
2311
|
+
engineVersionString: z108.string().optional(),
|
|
2303
2312
|
simulationResultCircuitJson: unvalidatedCircuitJson
|
|
2304
2313
|
});
|
|
2305
|
-
var spiceEngineZod =
|
|
2306
|
-
simulate:
|
|
2314
|
+
var spiceEngineZod = z108.object({
|
|
2315
|
+
simulate: z108.function().args(z108.string()).returns(z108.promise(spiceEngineSimulationResult)).describe(
|
|
2307
2316
|
"A function that takes a SPICE string and returns a simulation result"
|
|
2308
2317
|
)
|
|
2309
2318
|
});
|
|
2310
|
-
var defaultSpiceEngine =
|
|
2319
|
+
var defaultSpiceEngine = z108.custom(
|
|
2311
2320
|
(value) => typeof value === "string"
|
|
2312
2321
|
);
|
|
2313
|
-
var autorouterInstance =
|
|
2314
|
-
run:
|
|
2315
|
-
getOutputSimpleRouteJson:
|
|
2322
|
+
var autorouterInstance = z108.object({
|
|
2323
|
+
run: z108.function().args().returns(z108.promise(z108.unknown())).describe("Run the autorouter"),
|
|
2324
|
+
getOutputSimpleRouteJson: z108.function().args().returns(z108.promise(z108.any())).describe("Get the resulting SimpleRouteJson")
|
|
2316
2325
|
});
|
|
2317
|
-
var autorouterDefinition =
|
|
2318
|
-
createAutorouter:
|
|
2326
|
+
var autorouterDefinition = z108.object({
|
|
2327
|
+
createAutorouter: z108.function().args(z108.any(), z108.any().optional()).returns(z108.union([autorouterInstance, z108.promise(autorouterInstance)])).describe("Create an autorouter instance")
|
|
2319
2328
|
});
|
|
2320
|
-
var platformConfig =
|
|
2329
|
+
var platformConfig = z108.object({
|
|
2321
2330
|
partsEngine: partsEngine.optional(),
|
|
2322
2331
|
autorouter: autorouterProp.optional(),
|
|
2323
|
-
autorouterMap:
|
|
2324
|
-
registryApiUrl:
|
|
2325
|
-
cloudAutorouterUrl:
|
|
2326
|
-
projectName:
|
|
2327
|
-
projectBaseUrl:
|
|
2328
|
-
version:
|
|
2329
|
-
url:
|
|
2330
|
-
printBoardInformationToSilkscreen:
|
|
2331
|
-
includeBoardFiles:
|
|
2332
|
+
autorouterMap: z108.record(z108.string(), autorouterDefinition).optional(),
|
|
2333
|
+
registryApiUrl: z108.string().optional(),
|
|
2334
|
+
cloudAutorouterUrl: z108.string().optional(),
|
|
2335
|
+
projectName: z108.string().optional(),
|
|
2336
|
+
projectBaseUrl: z108.string().optional(),
|
|
2337
|
+
version: z108.string().optional(),
|
|
2338
|
+
url: z108.string().optional(),
|
|
2339
|
+
printBoardInformationToSilkscreen: z108.boolean().optional(),
|
|
2340
|
+
includeBoardFiles: z108.array(z108.string()).describe(
|
|
2332
2341
|
'The board files to automatically build with "tsci build", defaults to ["**/*.circuit.tsx"]. Can be an array of files or globs'
|
|
2333
2342
|
).optional(),
|
|
2334
|
-
snapshotsDir:
|
|
2343
|
+
snapshotsDir: z108.string().describe(
|
|
2335
2344
|
'The directory where snapshots are stored for "tsci snapshot", defaults to "tests/__snapshots__"'
|
|
2336
2345
|
).optional(),
|
|
2337
2346
|
defaultSpiceEngine: defaultSpiceEngine.optional(),
|
|
2338
|
-
localCacheEngine:
|
|
2339
|
-
pcbDisabled:
|
|
2340
|
-
schematicDisabled:
|
|
2341
|
-
partsEngineDisabled:
|
|
2342
|
-
spiceEngineMap:
|
|
2343
|
-
footprintLibraryMap:
|
|
2344
|
-
|
|
2345
|
-
|
|
2347
|
+
localCacheEngine: z108.any().optional(),
|
|
2348
|
+
pcbDisabled: z108.boolean().optional(),
|
|
2349
|
+
schematicDisabled: z108.boolean().optional(),
|
|
2350
|
+
partsEngineDisabled: z108.boolean().optional(),
|
|
2351
|
+
spiceEngineMap: z108.record(z108.string(), spiceEngineZod).optional(),
|
|
2352
|
+
footprintLibraryMap: z108.record(
|
|
2353
|
+
z108.string(),
|
|
2354
|
+
z108.union([
|
|
2346
2355
|
pathToCircuitJsonFn,
|
|
2347
|
-
|
|
2348
|
-
|
|
2349
|
-
|
|
2356
|
+
z108.record(
|
|
2357
|
+
z108.string(),
|
|
2358
|
+
z108.union([unvalidatedCircuitJson, pathToCircuitJsonFn])
|
|
2350
2359
|
)
|
|
2351
2360
|
])
|
|
2352
2361
|
).optional(),
|
|
2353
|
-
footprintFileParserMap:
|
|
2354
|
-
resolveProjectStaticFileImportUrl:
|
|
2362
|
+
footprintFileParserMap: z108.record(z108.string(), footprintFileParserEntry).optional(),
|
|
2363
|
+
resolveProjectStaticFileImportUrl: z108.function().args(z108.string()).returns(z108.promise(z108.string())).describe(
|
|
2355
2364
|
"A function that returns a string URL for static files for the project"
|
|
2356
2365
|
).optional()
|
|
2357
2366
|
});
|
|
@@ -2515,6 +2524,7 @@ export {
|
|
|
2515
2524
|
schematicPortArrangement,
|
|
2516
2525
|
schematicRectProps,
|
|
2517
2526
|
schematicRowProps,
|
|
2527
|
+
schematicSymbolSize,
|
|
2518
2528
|
schematicTableProps,
|
|
2519
2529
|
schematicTextProps,
|
|
2520
2530
|
silkscreenCircleProps,
|