@tscircuit/eval 0.0.299 → 0.0.301
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/blob-url.js +1 -1
- package/dist/eval/index.d.ts +184 -5
- package/dist/eval/index.js +19 -4
- package/dist/lib/index.d.ts +185 -5
- package/dist/lib/index.js +25 -4
- package/dist/webworker/entrypoint.js +363 -454
- package/dist/worker.d.ts +3 -1
- package/dist/worker.js +7 -1
- package/lib/runner/CircuitRunner.ts +12 -0
- package/lib/shared/types.ts +5 -1
- package/lib/worker.ts +7 -1
- package/package.json +11 -10
- package/tests/features/enable-debug.test.ts +33 -0
- package/webworker/entrypoint.ts +12 -0
- package/webworker/execution-context.ts +6 -0
package/dist/eval/index.d.ts
CHANGED
|
@@ -1,7 +1,8 @@
|
|
|
1
1
|
import { AnyCircuitElement } from 'circuit-json';
|
|
2
|
-
import { RootCircuitEventName, RootCircuit } from '@tscircuit/core';
|
|
2
|
+
import { RootCircuitEventName as RootCircuitEventName$1, RootCircuit } from '@tscircuit/core';
|
|
3
3
|
import { PlatformConfig } from '@tscircuit/props';
|
|
4
4
|
|
|
5
|
+
type RootCircuitEventName = RootCircuitEventName$1 | "debug:logOutput";
|
|
5
6
|
interface CircuitRunnerConfiguration {
|
|
6
7
|
snippetsApiBaseUrl: string;
|
|
7
8
|
cjsRegistryUrl: string;
|
|
@@ -41,6 +42,7 @@ interface CircuitRunnerApi {
|
|
|
41
42
|
getCircuitJson: () => Promise<AnyCircuitElement[]>;
|
|
42
43
|
setSnippetsApiBaseUrl: (baseUrl: string) => Promise<void>;
|
|
43
44
|
setPlatformConfig: (platform: PlatformConfig) => Promise<void>;
|
|
45
|
+
enableDebug: (namespace: string) => Promise<void>;
|
|
44
46
|
on: (event: RootCircuitEventName, callback: (...args: any[]) => void) => void;
|
|
45
47
|
clearEventListeners: () => void;
|
|
46
48
|
kill: () => Promise<void>;
|
|
@@ -55,12 +57,14 @@ interface ExecutionContext extends WebWorkerConfiguration {
|
|
|
55
57
|
declare function createExecutionContext(webWorkerConfiguration: WebWorkerConfiguration, opts?: {
|
|
56
58
|
name?: string;
|
|
57
59
|
platform?: PlatformConfig;
|
|
60
|
+
debugNamespace?: string;
|
|
58
61
|
}): ExecutionContext;
|
|
59
62
|
|
|
60
63
|
declare class CircuitRunner implements CircuitRunnerApi {
|
|
61
64
|
_executionContext: ReturnType<typeof createExecutionContext> | null;
|
|
62
65
|
_circuitRunnerConfiguration: CircuitRunnerConfiguration;
|
|
63
66
|
_eventListeners: Record<string, ((...args: any[]) => void)[]>;
|
|
67
|
+
_debugNamespace: string | undefined;
|
|
64
68
|
constructor(configuration?: Partial<CircuitRunnerConfiguration>);
|
|
65
69
|
version(): Promise<string>;
|
|
66
70
|
executeWithFsMap(ogOpts: {
|
|
@@ -84,6 +88,7 @@ declare class CircuitRunner implements CircuitRunnerApi {
|
|
|
84
88
|
kill(): Promise<void>;
|
|
85
89
|
setSnippetsApiBaseUrl(baseUrl: string): Promise<void>;
|
|
86
90
|
setPlatformConfig(platform: PlatformConfig): Promise<void>;
|
|
91
|
+
enableDebug(namespace: string): Promise<void>;
|
|
87
92
|
private _bindEventListeners;
|
|
88
93
|
}
|
|
89
94
|
|
|
@@ -104,8 +109,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
104
109
|
source_port_id: string;
|
|
105
110
|
subcircuit_id?: string | undefined;
|
|
106
111
|
port_hints?: string[] | undefined;
|
|
107
|
-
pin_number?: number | undefined;
|
|
108
112
|
subcircuit_connectivity_map_key?: string | undefined;
|
|
113
|
+
pin_number?: number | undefined;
|
|
109
114
|
} | {
|
|
110
115
|
type: "source_component";
|
|
111
116
|
name: string;
|
|
@@ -279,6 +284,18 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
279
284
|
display_value?: string | undefined;
|
|
280
285
|
are_pins_interchangeable?: boolean | undefined;
|
|
281
286
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
287
|
+
} | {
|
|
288
|
+
type: "source_component";
|
|
289
|
+
name: string;
|
|
290
|
+
source_component_id: string;
|
|
291
|
+
ftype: "simple_pinout";
|
|
292
|
+
subcircuit_id?: string | undefined;
|
|
293
|
+
source_group_id?: string | undefined;
|
|
294
|
+
manufacturer_part_number?: string | undefined;
|
|
295
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
296
|
+
display_value?: string | undefined;
|
|
297
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
298
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
282
299
|
} | {
|
|
283
300
|
type: "source_component";
|
|
284
301
|
name: string;
|
|
@@ -433,6 +450,7 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
433
450
|
is_ground?: boolean | undefined;
|
|
434
451
|
is_digital_signal?: boolean | undefined;
|
|
435
452
|
is_analog_signal?: boolean | undefined;
|
|
453
|
+
is_positive_voltage_source?: boolean | undefined;
|
|
436
454
|
} | {
|
|
437
455
|
type: "source_group";
|
|
438
456
|
source_group_id: string;
|
|
@@ -563,6 +581,18 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
563
581
|
display_value?: string | undefined;
|
|
564
582
|
are_pins_interchangeable?: boolean | undefined;
|
|
565
583
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
584
|
+
} | {
|
|
585
|
+
type: "source_component";
|
|
586
|
+
name: string;
|
|
587
|
+
source_component_id: string;
|
|
588
|
+
ftype: "simple_pinout";
|
|
589
|
+
subcircuit_id?: string | undefined;
|
|
590
|
+
source_group_id?: string | undefined;
|
|
591
|
+
manufacturer_part_number?: string | undefined;
|
|
592
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
593
|
+
display_value?: string | undefined;
|
|
594
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
595
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
566
596
|
} | {
|
|
567
597
|
type: "source_component";
|
|
568
598
|
name: string;
|
|
@@ -666,6 +696,13 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
666
696
|
source_net_id: string;
|
|
667
697
|
source_pcb_ground_plane_id: string;
|
|
668
698
|
subcircuit_id?: string | undefined;
|
|
699
|
+
} | {
|
|
700
|
+
type: "source_manually_placed_via";
|
|
701
|
+
source_group_id: string;
|
|
702
|
+
source_net_id: string;
|
|
703
|
+
source_manually_placed_via_id: string;
|
|
704
|
+
subcircuit_id?: string | undefined;
|
|
705
|
+
source_trace_id?: string | undefined;
|
|
669
706
|
} | {
|
|
670
707
|
type: "source_project_metadata";
|
|
671
708
|
name?: string | undefined;
|
|
@@ -1370,6 +1407,57 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1370
1407
|
spoke_outer_diameter: number;
|
|
1371
1408
|
subcircuit_id?: string | undefined;
|
|
1372
1409
|
pcb_plated_hole_id?: string | undefined;
|
|
1410
|
+
} | {
|
|
1411
|
+
type: "pcb_copper_pour";
|
|
1412
|
+
width: number;
|
|
1413
|
+
height: number;
|
|
1414
|
+
center: {
|
|
1415
|
+
x: number;
|
|
1416
|
+
y: number;
|
|
1417
|
+
};
|
|
1418
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1419
|
+
shape: "rect";
|
|
1420
|
+
pcb_copper_pour_id: string;
|
|
1421
|
+
rotation?: number | undefined;
|
|
1422
|
+
subcircuit_id?: string | undefined;
|
|
1423
|
+
pcb_group_id?: string | undefined;
|
|
1424
|
+
source_net_id?: string | undefined;
|
|
1425
|
+
} | {
|
|
1426
|
+
type: "pcb_copper_pour";
|
|
1427
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1428
|
+
shape: "brep";
|
|
1429
|
+
pcb_copper_pour_id: string;
|
|
1430
|
+
brep_shape: {
|
|
1431
|
+
outer_ring: {
|
|
1432
|
+
vertices: {
|
|
1433
|
+
x: number;
|
|
1434
|
+
y: number;
|
|
1435
|
+
bulge?: number | undefined;
|
|
1436
|
+
}[];
|
|
1437
|
+
};
|
|
1438
|
+
inner_rings: {
|
|
1439
|
+
vertices: {
|
|
1440
|
+
x: number;
|
|
1441
|
+
y: number;
|
|
1442
|
+
bulge?: number | undefined;
|
|
1443
|
+
}[];
|
|
1444
|
+
}[];
|
|
1445
|
+
};
|
|
1446
|
+
subcircuit_id?: string | undefined;
|
|
1447
|
+
pcb_group_id?: string | undefined;
|
|
1448
|
+
source_net_id?: string | undefined;
|
|
1449
|
+
} | {
|
|
1450
|
+
type: "pcb_copper_pour";
|
|
1451
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
1452
|
+
shape: "polygon";
|
|
1453
|
+
points: {
|
|
1454
|
+
x: number;
|
|
1455
|
+
y: number;
|
|
1456
|
+
}[];
|
|
1457
|
+
pcb_copper_pour_id: string;
|
|
1458
|
+
subcircuit_id?: string | undefined;
|
|
1459
|
+
pcb_group_id?: string | undefined;
|
|
1460
|
+
source_net_id?: string | undefined;
|
|
1373
1461
|
} | {
|
|
1374
1462
|
x: number;
|
|
1375
1463
|
y: number;
|
|
@@ -1470,7 +1558,6 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1470
1558
|
has_output_arrow?: boolean | undefined;
|
|
1471
1559
|
} | {
|
|
1472
1560
|
type: "schematic_trace";
|
|
1473
|
-
source_trace_id: string;
|
|
1474
1561
|
schematic_trace_id: string;
|
|
1475
1562
|
junctions: {
|
|
1476
1563
|
x: number;
|
|
@@ -1490,6 +1577,8 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1490
1577
|
to_schematic_port_id?: string | undefined;
|
|
1491
1578
|
}[];
|
|
1492
1579
|
subcircuit_id?: string | undefined;
|
|
1580
|
+
source_trace_id?: string | undefined;
|
|
1581
|
+
subcircuit_connectivity_map_key?: string | undefined;
|
|
1493
1582
|
} | {
|
|
1494
1583
|
type: "schematic_path";
|
|
1495
1584
|
points: {
|
|
@@ -1661,6 +1750,9 @@ declare function runTscircuitCode(filesystemOrCodeString: Record<string, string>
|
|
|
1661
1750
|
model_obj_url?: string | undefined;
|
|
1662
1751
|
model_stl_url?: string | undefined;
|
|
1663
1752
|
model_3mf_url?: string | undefined;
|
|
1753
|
+
model_gltf_url?: string | undefined;
|
|
1754
|
+
model_glb_url?: string | undefined;
|
|
1755
|
+
model_step_url?: string | undefined;
|
|
1664
1756
|
model_jscad?: any;
|
|
1665
1757
|
} | {
|
|
1666
1758
|
type: "simulation_voltage_source";
|
|
@@ -1707,8 +1799,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
1707
1799
|
source_port_id: string;
|
|
1708
1800
|
subcircuit_id?: string | undefined;
|
|
1709
1801
|
port_hints?: string[] | undefined;
|
|
1710
|
-
pin_number?: number | undefined;
|
|
1711
1802
|
subcircuit_connectivity_map_key?: string | undefined;
|
|
1803
|
+
pin_number?: number | undefined;
|
|
1712
1804
|
} | {
|
|
1713
1805
|
type: "source_component";
|
|
1714
1806
|
name: string;
|
|
@@ -1882,6 +1974,18 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
1882
1974
|
display_value?: string | undefined;
|
|
1883
1975
|
are_pins_interchangeable?: boolean | undefined;
|
|
1884
1976
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
1977
|
+
} | {
|
|
1978
|
+
type: "source_component";
|
|
1979
|
+
name: string;
|
|
1980
|
+
source_component_id: string;
|
|
1981
|
+
ftype: "simple_pinout";
|
|
1982
|
+
subcircuit_id?: string | undefined;
|
|
1983
|
+
source_group_id?: string | undefined;
|
|
1984
|
+
manufacturer_part_number?: string | undefined;
|
|
1985
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
1986
|
+
display_value?: string | undefined;
|
|
1987
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
1988
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
1885
1989
|
} | {
|
|
1886
1990
|
type: "source_component";
|
|
1887
1991
|
name: string;
|
|
@@ -2036,6 +2140,7 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2036
2140
|
is_ground?: boolean | undefined;
|
|
2037
2141
|
is_digital_signal?: boolean | undefined;
|
|
2038
2142
|
is_analog_signal?: boolean | undefined;
|
|
2143
|
+
is_positive_voltage_source?: boolean | undefined;
|
|
2039
2144
|
} | {
|
|
2040
2145
|
type: "source_group";
|
|
2041
2146
|
source_group_id: string;
|
|
@@ -2166,6 +2271,18 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2166
2271
|
display_value?: string | undefined;
|
|
2167
2272
|
are_pins_interchangeable?: boolean | undefined;
|
|
2168
2273
|
internally_connected_source_port_ids?: string[][] | undefined;
|
|
2274
|
+
} | {
|
|
2275
|
+
type: "source_component";
|
|
2276
|
+
name: string;
|
|
2277
|
+
source_component_id: string;
|
|
2278
|
+
ftype: "simple_pinout";
|
|
2279
|
+
subcircuit_id?: string | undefined;
|
|
2280
|
+
source_group_id?: string | undefined;
|
|
2281
|
+
manufacturer_part_number?: string | undefined;
|
|
2282
|
+
supplier_part_numbers?: Partial<Record<"jlcpcb" | "macrofab" | "pcbway" | "digikey" | "mouser" | "lcsc", string[]>> | undefined;
|
|
2283
|
+
display_value?: string | undefined;
|
|
2284
|
+
are_pins_interchangeable?: boolean | undefined;
|
|
2285
|
+
internally_connected_source_port_ids?: string[][] | undefined;
|
|
2169
2286
|
} | {
|
|
2170
2287
|
type: "source_component";
|
|
2171
2288
|
name: string;
|
|
@@ -2269,6 +2386,13 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2269
2386
|
source_net_id: string;
|
|
2270
2387
|
source_pcb_ground_plane_id: string;
|
|
2271
2388
|
subcircuit_id?: string | undefined;
|
|
2389
|
+
} | {
|
|
2390
|
+
type: "source_manually_placed_via";
|
|
2391
|
+
source_group_id: string;
|
|
2392
|
+
source_net_id: string;
|
|
2393
|
+
source_manually_placed_via_id: string;
|
|
2394
|
+
subcircuit_id?: string | undefined;
|
|
2395
|
+
source_trace_id?: string | undefined;
|
|
2272
2396
|
} | {
|
|
2273
2397
|
type: "source_project_metadata";
|
|
2274
2398
|
name?: string | undefined;
|
|
@@ -2973,6 +3097,57 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
2973
3097
|
spoke_outer_diameter: number;
|
|
2974
3098
|
subcircuit_id?: string | undefined;
|
|
2975
3099
|
pcb_plated_hole_id?: string | undefined;
|
|
3100
|
+
} | {
|
|
3101
|
+
type: "pcb_copper_pour";
|
|
3102
|
+
width: number;
|
|
3103
|
+
height: number;
|
|
3104
|
+
center: {
|
|
3105
|
+
x: number;
|
|
3106
|
+
y: number;
|
|
3107
|
+
};
|
|
3108
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3109
|
+
shape: "rect";
|
|
3110
|
+
pcb_copper_pour_id: string;
|
|
3111
|
+
rotation?: number | undefined;
|
|
3112
|
+
subcircuit_id?: string | undefined;
|
|
3113
|
+
pcb_group_id?: string | undefined;
|
|
3114
|
+
source_net_id?: string | undefined;
|
|
3115
|
+
} | {
|
|
3116
|
+
type: "pcb_copper_pour";
|
|
3117
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3118
|
+
shape: "brep";
|
|
3119
|
+
pcb_copper_pour_id: string;
|
|
3120
|
+
brep_shape: {
|
|
3121
|
+
outer_ring: {
|
|
3122
|
+
vertices: {
|
|
3123
|
+
x: number;
|
|
3124
|
+
y: number;
|
|
3125
|
+
bulge?: number | undefined;
|
|
3126
|
+
}[];
|
|
3127
|
+
};
|
|
3128
|
+
inner_rings: {
|
|
3129
|
+
vertices: {
|
|
3130
|
+
x: number;
|
|
3131
|
+
y: number;
|
|
3132
|
+
bulge?: number | undefined;
|
|
3133
|
+
}[];
|
|
3134
|
+
}[];
|
|
3135
|
+
};
|
|
3136
|
+
subcircuit_id?: string | undefined;
|
|
3137
|
+
pcb_group_id?: string | undefined;
|
|
3138
|
+
source_net_id?: string | undefined;
|
|
3139
|
+
} | {
|
|
3140
|
+
type: "pcb_copper_pour";
|
|
3141
|
+
layer: "top" | "bottom" | "inner1" | "inner2" | "inner3" | "inner4" | "inner5" | "inner6";
|
|
3142
|
+
shape: "polygon";
|
|
3143
|
+
points: {
|
|
3144
|
+
x: number;
|
|
3145
|
+
y: number;
|
|
3146
|
+
}[];
|
|
3147
|
+
pcb_copper_pour_id: string;
|
|
3148
|
+
subcircuit_id?: string | undefined;
|
|
3149
|
+
pcb_group_id?: string | undefined;
|
|
3150
|
+
source_net_id?: string | undefined;
|
|
2976
3151
|
} | {
|
|
2977
3152
|
x: number;
|
|
2978
3153
|
y: number;
|
|
@@ -3073,7 +3248,6 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3073
3248
|
has_output_arrow?: boolean | undefined;
|
|
3074
3249
|
} | {
|
|
3075
3250
|
type: "schematic_trace";
|
|
3076
|
-
source_trace_id: string;
|
|
3077
3251
|
schematic_trace_id: string;
|
|
3078
3252
|
junctions: {
|
|
3079
3253
|
x: number;
|
|
@@ -3093,6 +3267,8 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3093
3267
|
to_schematic_port_id?: string | undefined;
|
|
3094
3268
|
}[];
|
|
3095
3269
|
subcircuit_id?: string | undefined;
|
|
3270
|
+
source_trace_id?: string | undefined;
|
|
3271
|
+
subcircuit_connectivity_map_key?: string | undefined;
|
|
3096
3272
|
} | {
|
|
3097
3273
|
type: "schematic_path";
|
|
3098
3274
|
points: {
|
|
@@ -3264,6 +3440,9 @@ declare const runTscircuitModule: (module: string, opts?: {
|
|
|
3264
3440
|
model_obj_url?: string | undefined;
|
|
3265
3441
|
model_stl_url?: string | undefined;
|
|
3266
3442
|
model_3mf_url?: string | undefined;
|
|
3443
|
+
model_gltf_url?: string | undefined;
|
|
3444
|
+
model_glb_url?: string | undefined;
|
|
3445
|
+
model_step_url?: string | undefined;
|
|
3267
3446
|
model_jscad?: any;
|
|
3268
3447
|
} | {
|
|
3269
3448
|
type: "simulation_voltage_source";
|