@tscircuit/circuit-json-util 0.0.88 → 0.0.90
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/dist/index.d.ts +136 -4
- package/dist/index.js +29 -1
- package/dist/index.js.map +1 -1
- package/package.json +3 -3
package/dist/index.d.ts
CHANGED
|
@@ -546,6 +546,17 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
546
546
|
property_name: string;
|
|
547
547
|
subcircuit_id?: string | undefined;
|
|
548
548
|
is_fatal?: boolean | undefined;
|
|
549
|
+
} | {
|
|
550
|
+
message: string;
|
|
551
|
+
type: "source_invalid_component_property_error";
|
|
552
|
+
source_component_id: string;
|
|
553
|
+
error_type: "source_invalid_component_property_error";
|
|
554
|
+
property_name: string;
|
|
555
|
+
source_invalid_component_property_error_id: string;
|
|
556
|
+
subcircuit_id?: string | undefined;
|
|
557
|
+
is_fatal?: boolean | undefined;
|
|
558
|
+
property_value?: unknown;
|
|
559
|
+
expected_format?: string | undefined;
|
|
549
560
|
} | {
|
|
550
561
|
message: string;
|
|
551
562
|
type: "source_failed_to_create_component_error";
|
|
@@ -906,6 +917,17 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
906
917
|
software_used_string?: string | undefined;
|
|
907
918
|
project_url?: string | undefined;
|
|
908
919
|
created_at?: string | undefined;
|
|
920
|
+
} | {
|
|
921
|
+
message: string;
|
|
922
|
+
type: "source_invalid_component_property_error";
|
|
923
|
+
source_component_id: string;
|
|
924
|
+
error_type: "source_invalid_component_property_error";
|
|
925
|
+
property_name: string;
|
|
926
|
+
source_invalid_component_property_error_id: string;
|
|
927
|
+
subcircuit_id?: string | undefined;
|
|
928
|
+
is_fatal?: boolean | undefined;
|
|
929
|
+
property_value?: unknown;
|
|
930
|
+
expected_format?: string | undefined;
|
|
909
931
|
} | {
|
|
910
932
|
message: string;
|
|
911
933
|
type: "source_trace_not_connected_error";
|
|
@@ -1472,6 +1494,8 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
1472
1494
|
width: number;
|
|
1473
1495
|
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1474
1496
|
route_type: "wire";
|
|
1497
|
+
copper_pour_id?: string | undefined;
|
|
1498
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
1475
1499
|
start_pcb_port_id?: string | undefined;
|
|
1476
1500
|
end_pcb_port_id?: string | undefined;
|
|
1477
1501
|
} | {
|
|
@@ -1482,6 +1506,8 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
1482
1506
|
from_layer: string;
|
|
1483
1507
|
hole_diameter?: number | undefined;
|
|
1484
1508
|
outer_diameter?: number | undefined;
|
|
1509
|
+
copper_pour_id?: string | undefined;
|
|
1510
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
1485
1511
|
})[];
|
|
1486
1512
|
pcb_component_id?: string | undefined;
|
|
1487
1513
|
subcircuit_id?: string | undefined;
|
|
@@ -2164,6 +2190,13 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
2164
2190
|
pcb_plated_hole_ids?: string[] | undefined;
|
|
2165
2191
|
pcb_hole_ids?: string[] | undefined;
|
|
2166
2192
|
pcb_keepout_ids?: string[] | undefined;
|
|
2193
|
+
} | {
|
|
2194
|
+
message: string;
|
|
2195
|
+
type: "pcb_courtyard_overlap_error";
|
|
2196
|
+
error_type: "pcb_courtyard_overlap_error";
|
|
2197
|
+
pcb_component_ids: [string, string];
|
|
2198
|
+
pcb_error_id: string;
|
|
2199
|
+
is_fatal?: boolean | undefined;
|
|
2167
2200
|
} | {
|
|
2168
2201
|
x: number;
|
|
2169
2202
|
y: number;
|
|
@@ -4154,7 +4187,7 @@ declare const transformSchematicElement: (elm: AnyCircuitElement, matrix: Matrix
|
|
|
4154
4187
|
mimetype: string;
|
|
4155
4188
|
} | undefined;
|
|
4156
4189
|
model_unit_to_mm_scale_factor?: number | undefined;
|
|
4157
|
-
model_board_normal_direction?: "y+" | "z+" | undefined;
|
|
4190
|
+
model_board_normal_direction?: "x-" | "x+" | "y+" | "y-" | "z+" | "z-" | undefined;
|
|
4158
4191
|
model_origin_position?: {
|
|
4159
4192
|
x: number;
|
|
4160
4193
|
y: number;
|
|
@@ -4743,6 +4776,17 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
4743
4776
|
property_name: string;
|
|
4744
4777
|
subcircuit_id?: string | undefined;
|
|
4745
4778
|
is_fatal?: boolean | undefined;
|
|
4779
|
+
} | {
|
|
4780
|
+
message: string;
|
|
4781
|
+
type: "source_invalid_component_property_error";
|
|
4782
|
+
source_component_id: string;
|
|
4783
|
+
error_type: "source_invalid_component_property_error";
|
|
4784
|
+
property_name: string;
|
|
4785
|
+
source_invalid_component_property_error_id: string;
|
|
4786
|
+
subcircuit_id?: string | undefined;
|
|
4787
|
+
is_fatal?: boolean | undefined;
|
|
4788
|
+
property_value?: unknown;
|
|
4789
|
+
expected_format?: string | undefined;
|
|
4746
4790
|
} | {
|
|
4747
4791
|
message: string;
|
|
4748
4792
|
type: "source_failed_to_create_component_error";
|
|
@@ -5103,6 +5147,17 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
5103
5147
|
software_used_string?: string | undefined;
|
|
5104
5148
|
project_url?: string | undefined;
|
|
5105
5149
|
created_at?: string | undefined;
|
|
5150
|
+
} | {
|
|
5151
|
+
message: string;
|
|
5152
|
+
type: "source_invalid_component_property_error";
|
|
5153
|
+
source_component_id: string;
|
|
5154
|
+
error_type: "source_invalid_component_property_error";
|
|
5155
|
+
property_name: string;
|
|
5156
|
+
source_invalid_component_property_error_id: string;
|
|
5157
|
+
subcircuit_id?: string | undefined;
|
|
5158
|
+
is_fatal?: boolean | undefined;
|
|
5159
|
+
property_value?: unknown;
|
|
5160
|
+
expected_format?: string | undefined;
|
|
5106
5161
|
} | {
|
|
5107
5162
|
message: string;
|
|
5108
5163
|
type: "source_trace_not_connected_error";
|
|
@@ -5669,6 +5724,8 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
5669
5724
|
width: number;
|
|
5670
5725
|
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
5671
5726
|
route_type: "wire";
|
|
5727
|
+
copper_pour_id?: string | undefined;
|
|
5728
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
5672
5729
|
start_pcb_port_id?: string | undefined;
|
|
5673
5730
|
end_pcb_port_id?: string | undefined;
|
|
5674
5731
|
} | {
|
|
@@ -5679,6 +5736,8 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
5679
5736
|
from_layer: string;
|
|
5680
5737
|
hole_diameter?: number | undefined;
|
|
5681
5738
|
outer_diameter?: number | undefined;
|
|
5739
|
+
copper_pour_id?: string | undefined;
|
|
5740
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
5682
5741
|
})[];
|
|
5683
5742
|
pcb_component_id?: string | undefined;
|
|
5684
5743
|
subcircuit_id?: string | undefined;
|
|
@@ -6361,6 +6420,13 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
6361
6420
|
pcb_plated_hole_ids?: string[] | undefined;
|
|
6362
6421
|
pcb_hole_ids?: string[] | undefined;
|
|
6363
6422
|
pcb_keepout_ids?: string[] | undefined;
|
|
6423
|
+
} | {
|
|
6424
|
+
message: string;
|
|
6425
|
+
type: "pcb_courtyard_overlap_error";
|
|
6426
|
+
error_type: "pcb_courtyard_overlap_error";
|
|
6427
|
+
pcb_component_ids: [string, string];
|
|
6428
|
+
pcb_error_id: string;
|
|
6429
|
+
is_fatal?: boolean | undefined;
|
|
6364
6430
|
} | {
|
|
6365
6431
|
x: number;
|
|
6366
6432
|
y: number;
|
|
@@ -8351,7 +8417,7 @@ declare const transformSchematicElements: (elms: AnyCircuitElement[], matrix: Ma
|
|
|
8351
8417
|
mimetype: string;
|
|
8352
8418
|
} | undefined;
|
|
8353
8419
|
model_unit_to_mm_scale_factor?: number | undefined;
|
|
8354
|
-
model_board_normal_direction?: "y+" | "z+" | undefined;
|
|
8420
|
+
model_board_normal_direction?: "x-" | "x+" | "y+" | "y-" | "z+" | "z-" | undefined;
|
|
8355
8421
|
model_origin_position?: {
|
|
8356
8422
|
x: number;
|
|
8357
8423
|
y: number;
|
|
@@ -8940,6 +9006,17 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
8940
9006
|
property_name: string;
|
|
8941
9007
|
subcircuit_id?: string | undefined;
|
|
8942
9008
|
is_fatal?: boolean | undefined;
|
|
9009
|
+
} | {
|
|
9010
|
+
message: string;
|
|
9011
|
+
type: "source_invalid_component_property_error";
|
|
9012
|
+
source_component_id: string;
|
|
9013
|
+
error_type: "source_invalid_component_property_error";
|
|
9014
|
+
property_name: string;
|
|
9015
|
+
source_invalid_component_property_error_id: string;
|
|
9016
|
+
subcircuit_id?: string | undefined;
|
|
9017
|
+
is_fatal?: boolean | undefined;
|
|
9018
|
+
property_value?: unknown;
|
|
9019
|
+
expected_format?: string | undefined;
|
|
8943
9020
|
} | {
|
|
8944
9021
|
message: string;
|
|
8945
9022
|
type: "source_failed_to_create_component_error";
|
|
@@ -9300,6 +9377,17 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
9300
9377
|
software_used_string?: string | undefined;
|
|
9301
9378
|
project_url?: string | undefined;
|
|
9302
9379
|
created_at?: string | undefined;
|
|
9380
|
+
} | {
|
|
9381
|
+
message: string;
|
|
9382
|
+
type: "source_invalid_component_property_error";
|
|
9383
|
+
source_component_id: string;
|
|
9384
|
+
error_type: "source_invalid_component_property_error";
|
|
9385
|
+
property_name: string;
|
|
9386
|
+
source_invalid_component_property_error_id: string;
|
|
9387
|
+
subcircuit_id?: string | undefined;
|
|
9388
|
+
is_fatal?: boolean | undefined;
|
|
9389
|
+
property_value?: unknown;
|
|
9390
|
+
expected_format?: string | undefined;
|
|
9303
9391
|
} | {
|
|
9304
9392
|
message: string;
|
|
9305
9393
|
type: "source_trace_not_connected_error";
|
|
@@ -9866,6 +9954,8 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
9866
9954
|
width: number;
|
|
9867
9955
|
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
9868
9956
|
route_type: "wire";
|
|
9957
|
+
copper_pour_id?: string | undefined;
|
|
9958
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
9869
9959
|
start_pcb_port_id?: string | undefined;
|
|
9870
9960
|
end_pcb_port_id?: string | undefined;
|
|
9871
9961
|
} | {
|
|
@@ -9876,6 +9966,8 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
9876
9966
|
from_layer: string;
|
|
9877
9967
|
hole_diameter?: number | undefined;
|
|
9878
9968
|
outer_diameter?: number | undefined;
|
|
9969
|
+
copper_pour_id?: string | undefined;
|
|
9970
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
9879
9971
|
})[];
|
|
9880
9972
|
pcb_component_id?: string | undefined;
|
|
9881
9973
|
subcircuit_id?: string | undefined;
|
|
@@ -10558,6 +10650,13 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
10558
10650
|
pcb_plated_hole_ids?: string[] | undefined;
|
|
10559
10651
|
pcb_hole_ids?: string[] | undefined;
|
|
10560
10652
|
pcb_keepout_ids?: string[] | undefined;
|
|
10653
|
+
} | {
|
|
10654
|
+
message: string;
|
|
10655
|
+
type: "pcb_courtyard_overlap_error";
|
|
10656
|
+
error_type: "pcb_courtyard_overlap_error";
|
|
10657
|
+
pcb_component_ids: [string, string];
|
|
10658
|
+
pcb_error_id: string;
|
|
10659
|
+
is_fatal?: boolean | undefined;
|
|
10561
10660
|
} | {
|
|
10562
10661
|
x: number;
|
|
10563
10662
|
y: number;
|
|
@@ -12548,7 +12647,7 @@ declare const transformPCBElement: (elm: AnyCircuitElement, matrix: Matrix) => {
|
|
|
12548
12647
|
mimetype: string;
|
|
12549
12648
|
} | undefined;
|
|
12550
12649
|
model_unit_to_mm_scale_factor?: number | undefined;
|
|
12551
|
-
model_board_normal_direction?: "y+" | "z+" | undefined;
|
|
12650
|
+
model_board_normal_direction?: "x-" | "x+" | "y+" | "y-" | "z+" | "z-" | undefined;
|
|
12552
12651
|
model_origin_position?: {
|
|
12553
12652
|
x: number;
|
|
12554
12653
|
y: number;
|
|
@@ -13137,6 +13236,17 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
13137
13236
|
property_name: string;
|
|
13138
13237
|
subcircuit_id?: string | undefined;
|
|
13139
13238
|
is_fatal?: boolean | undefined;
|
|
13239
|
+
} | {
|
|
13240
|
+
message: string;
|
|
13241
|
+
type: "source_invalid_component_property_error";
|
|
13242
|
+
source_component_id: string;
|
|
13243
|
+
error_type: "source_invalid_component_property_error";
|
|
13244
|
+
property_name: string;
|
|
13245
|
+
source_invalid_component_property_error_id: string;
|
|
13246
|
+
subcircuit_id?: string | undefined;
|
|
13247
|
+
is_fatal?: boolean | undefined;
|
|
13248
|
+
property_value?: unknown;
|
|
13249
|
+
expected_format?: string | undefined;
|
|
13140
13250
|
} | {
|
|
13141
13251
|
message: string;
|
|
13142
13252
|
type: "source_failed_to_create_component_error";
|
|
@@ -13497,6 +13607,17 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
13497
13607
|
software_used_string?: string | undefined;
|
|
13498
13608
|
project_url?: string | undefined;
|
|
13499
13609
|
created_at?: string | undefined;
|
|
13610
|
+
} | {
|
|
13611
|
+
message: string;
|
|
13612
|
+
type: "source_invalid_component_property_error";
|
|
13613
|
+
source_component_id: string;
|
|
13614
|
+
error_type: "source_invalid_component_property_error";
|
|
13615
|
+
property_name: string;
|
|
13616
|
+
source_invalid_component_property_error_id: string;
|
|
13617
|
+
subcircuit_id?: string | undefined;
|
|
13618
|
+
is_fatal?: boolean | undefined;
|
|
13619
|
+
property_value?: unknown;
|
|
13620
|
+
expected_format?: string | undefined;
|
|
13500
13621
|
} | {
|
|
13501
13622
|
message: string;
|
|
13502
13623
|
type: "source_trace_not_connected_error";
|
|
@@ -14063,6 +14184,8 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
14063
14184
|
width: number;
|
|
14064
14185
|
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
14065
14186
|
route_type: "wire";
|
|
14187
|
+
copper_pour_id?: string | undefined;
|
|
14188
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
14066
14189
|
start_pcb_port_id?: string | undefined;
|
|
14067
14190
|
end_pcb_port_id?: string | undefined;
|
|
14068
14191
|
} | {
|
|
@@ -14073,6 +14196,8 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
14073
14196
|
from_layer: string;
|
|
14074
14197
|
hole_diameter?: number | undefined;
|
|
14075
14198
|
outer_diameter?: number | undefined;
|
|
14199
|
+
copper_pour_id?: string | undefined;
|
|
14200
|
+
is_inside_copper_pour?: boolean | undefined;
|
|
14076
14201
|
})[];
|
|
14077
14202
|
pcb_component_id?: string | undefined;
|
|
14078
14203
|
subcircuit_id?: string | undefined;
|
|
@@ -14755,6 +14880,13 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
14755
14880
|
pcb_plated_hole_ids?: string[] | undefined;
|
|
14756
14881
|
pcb_hole_ids?: string[] | undefined;
|
|
14757
14882
|
pcb_keepout_ids?: string[] | undefined;
|
|
14883
|
+
} | {
|
|
14884
|
+
message: string;
|
|
14885
|
+
type: "pcb_courtyard_overlap_error";
|
|
14886
|
+
error_type: "pcb_courtyard_overlap_error";
|
|
14887
|
+
pcb_component_ids: [string, string];
|
|
14888
|
+
pcb_error_id: string;
|
|
14889
|
+
is_fatal?: boolean | undefined;
|
|
14758
14890
|
} | {
|
|
14759
14891
|
x: number;
|
|
14760
14892
|
y: number;
|
|
@@ -16745,7 +16877,7 @@ declare const transformPCBElements: (elms: AnyCircuitElement[], matrix: Matrix)
|
|
|
16745
16877
|
mimetype: string;
|
|
16746
16878
|
} | undefined;
|
|
16747
16879
|
model_unit_to_mm_scale_factor?: number | undefined;
|
|
16748
|
-
model_board_normal_direction?: "y+" | "z+" | undefined;
|
|
16880
|
+
model_board_normal_direction?: "x-" | "x+" | "y+" | "y-" | "z+" | "z-" | undefined;
|
|
16749
16881
|
model_origin_position?: {
|
|
16750
16882
|
x: number;
|
|
16751
16883
|
y: number;
|
package/dist/index.js
CHANGED
|
@@ -953,7 +953,7 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
953
953
|
elm.center = applyToPoint(matrix, elm.center);
|
|
954
954
|
} else if (elm.type === "pcb_silkscreen_text" || elm.type === "pcb_fabrication_note_text" || elm.type === "pcb_note_text") {
|
|
955
955
|
elm.anchor_position = applyToPoint(matrix, elm.anchor_position);
|
|
956
|
-
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect") {
|
|
956
|
+
} else if (elm.type === "pcb_silkscreen_circle" || elm.type === "pcb_silkscreen_rect" || elm.type === "pcb_note_rect" || elm.type === "pcb_courtyard_rect" || elm.type === "pcb_courtyard_circle") {
|
|
957
957
|
elm.center = applyToPoint(matrix, elm.center);
|
|
958
958
|
} else if (elm.type === "pcb_component") {
|
|
959
959
|
elm.center = applyToPoint(matrix, elm.center);
|
|
@@ -963,6 +963,20 @@ var transformPCBElement = (elm, matrix) => {
|
|
|
963
963
|
;
|
|
964
964
|
[elm.width, elm.height] = [elm.height, elm.width];
|
|
965
965
|
}
|
|
966
|
+
} else if (elm.type === "pcb_courtyard_outline") {
|
|
967
|
+
elm.outline = elm.outline.map((p) => {
|
|
968
|
+
const tp = applyToPoint(matrix, p);
|
|
969
|
+
p.x = tp.x;
|
|
970
|
+
p.y = tp.y;
|
|
971
|
+
return p;
|
|
972
|
+
});
|
|
973
|
+
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
974
|
+
elm.points = elm.points.map((p) => {
|
|
975
|
+
const tp = applyToPoint(matrix, p);
|
|
976
|
+
p.x = tp.x;
|
|
977
|
+
p.y = tp.y;
|
|
978
|
+
return p;
|
|
979
|
+
});
|
|
966
980
|
} else if (elm.type === "pcb_silkscreen_path" || elm.type === "pcb_trace" || elm.type === "pcb_fabrication_note_path" || elm.type === "pcb_note_path") {
|
|
967
981
|
elm.route = elm.route.map((rp) => {
|
|
968
982
|
const tp = applyToPoint(matrix, rp);
|
|
@@ -1355,6 +1369,20 @@ var getBoundsOfPcbElements = (elements) => {
|
|
|
1355
1369
|
maxX = Math.max(maxX, point.x);
|
|
1356
1370
|
maxY = Math.max(maxY, point.y);
|
|
1357
1371
|
}
|
|
1372
|
+
} else if (elm.type === "pcb_courtyard_outline") {
|
|
1373
|
+
for (const point of elm.outline) {
|
|
1374
|
+
minX = Math.min(minX, point.x);
|
|
1375
|
+
minY = Math.min(minY, point.y);
|
|
1376
|
+
maxX = Math.max(maxX, point.x);
|
|
1377
|
+
maxY = Math.max(maxY, point.y);
|
|
1378
|
+
}
|
|
1379
|
+
} else if (elm.type === "pcb_courtyard_polygon") {
|
|
1380
|
+
for (const point of elm.points) {
|
|
1381
|
+
minX = Math.min(minX, point.x);
|
|
1382
|
+
minY = Math.min(minY, point.y);
|
|
1383
|
+
maxX = Math.max(maxX, point.x);
|
|
1384
|
+
maxY = Math.max(maxY, point.y);
|
|
1385
|
+
}
|
|
1358
1386
|
}
|
|
1359
1387
|
}
|
|
1360
1388
|
return { minX, minY, maxX, maxY };
|