@tscircuit/core 0.0.332 → 0.0.334
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 +30 -2
- package/dist/index.js +8 -0
- package/package.json +1 -1
package/dist/index.d.ts
CHANGED
|
@@ -10,6 +10,7 @@ import { Matrix } from 'transformation-matrix';
|
|
|
10
10
|
import { SoupUtilObjects } from '@tscircuit/soup-util';
|
|
11
11
|
import * as _tscircuit_layout from '@tscircuit/layout';
|
|
12
12
|
import { ConnectivityMap } from 'circuit-json-to-connectivity-map';
|
|
13
|
+
import { GraphicsObject } from 'graphics-debug';
|
|
13
14
|
|
|
14
15
|
declare const orderedRenderPhases: readonly ["ReactSubtreesRender", "InitializePortsFromChildren", "CreateNetsFromProps", "CreateTracesFromProps", "CreateTraceHintsFromProps", "SourceRender", "SourceParentAttachment", "PortMatching", "SourceTraceRender", "SourceAddConnectivityMapKey", "SchematicComponentRender", "SchematicPortRender", "SchematicLayout", "SchematicTraceRender", "PcbComponentRender", "PcbPrimitiveRender", "PcbFootprintLayout", "PcbPortRender", "PcbPortAttachment", "PcbLayout", "PcbComponentSizeCalculation", "PcbBoardAutoSize", "PcbTraceRender", "PcbTraceHintRender", "PcbRouteNetIslands", "CadModelRender", "PartsEngineRender"];
|
|
15
16
|
type RenderPhase = (typeof orderedRenderPhases)[number];
|
|
@@ -104,7 +105,7 @@ interface SchematicBoxDimensions {
|
|
|
104
105
|
};
|
|
105
106
|
}
|
|
106
107
|
|
|
107
|
-
type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:progress";
|
|
108
|
+
type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:progress" | "renderComplete";
|
|
108
109
|
declare class RootCircuit {
|
|
109
110
|
firstChild: PrimitiveComponent | null;
|
|
110
111
|
children: PrimitiveComponent[];
|
|
@@ -10787,6 +10788,33 @@ type SelWithoutSubcircuit = NonPolarizedSel & PolarizedSel & TransistorSel & Jum
|
|
|
10787
10788
|
type Sel = SubcircuitSel & SelWithoutSubcircuit;
|
|
10788
10789
|
declare const sel: Sel;
|
|
10789
10790
|
|
|
10791
|
+
type AutorouterCompleteEvent = {
|
|
10792
|
+
type: "complete";
|
|
10793
|
+
traces: SimplifiedPcbTrace[];
|
|
10794
|
+
};
|
|
10795
|
+
type AutorouterErrorEvent = {
|
|
10796
|
+
type: "error";
|
|
10797
|
+
error: Error;
|
|
10798
|
+
};
|
|
10799
|
+
type AutorouterProgressEvent = {
|
|
10800
|
+
type: "progress";
|
|
10801
|
+
steps: number;
|
|
10802
|
+
progress: number;
|
|
10803
|
+
phase?: string;
|
|
10804
|
+
debugGraphics?: GraphicsObject;
|
|
10805
|
+
};
|
|
10806
|
+
type AutorouterEvent = AutorouterCompleteEvent | AutorouterErrorEvent | AutorouterProgressEvent;
|
|
10807
|
+
interface GenericLocalAutorouter {
|
|
10808
|
+
input: SimpleRouteJson;
|
|
10809
|
+
isRouting: boolean;
|
|
10810
|
+
start(): void;
|
|
10811
|
+
stop(): void;
|
|
10812
|
+
on(event: "complete", callback: (ev: AutorouterCompleteEvent) => void): void;
|
|
10813
|
+
on(event: "error", callback: (ev: AutorouterErrorEvent) => void): void;
|
|
10814
|
+
on(event: "progress", callback: (ev: AutorouterProgressEvent) => void): void;
|
|
10815
|
+
solveSync(): SimplifiedPcbTrace[];
|
|
10816
|
+
}
|
|
10817
|
+
|
|
10790
10818
|
interface TscircuitElements {
|
|
10791
10819
|
resistor: _tscircuit_props.ResistorProps;
|
|
10792
10820
|
capacitor: _tscircuit_props.CapacitorProps;
|
|
@@ -10852,4 +10880,4 @@ declare module "react/jsx-runtime" {
|
|
|
10852
10880
|
}
|
|
10853
10881
|
}
|
|
10854
10882
|
|
|
10855
|
-
export { type AsyncEffect, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
|
10883
|
+
export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, Battery, Board, Capacitor, Chip, Circuit, type ComponentWithPins, Constraint, Crystal, Diode, FabricationNotePath, FabricationNoteText, Footprint, type GenericLocalAutorouter, Group, Hole, type IRenderable, Inductor, Jumper, Keepout, Led, Mosfet, Net, NetAlias, NormalComponent, PinHeader, type PinLabelSpec, PlatedHole, Port, Potentiometer, PowerSource, PrimitiveComponent, Project, PushButton, type RenderPhase, type RenderPhaseFn, type RenderPhaseFunctions, type RenderPhaseStates, Renderable, Resistor, Resonator, RootCircuit, type RootCircuitEventName, type Sel, SilkscreenCircle, SilkscreenLine, SilkscreenPath, SilkscreenRect, SilkscreenText, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
|
package/dist/index.js
CHANGED
|
@@ -5836,6 +5836,13 @@ var Group = class extends NormalComponent {
|
|
|
5836
5836
|
});
|
|
5837
5837
|
}
|
|
5838
5838
|
);
|
|
5839
|
+
autorouter.on("progress", (event) => {
|
|
5840
|
+
this.root?.emit("autorouting:progress", {
|
|
5841
|
+
subcircuit_id: this.subcircuit_id,
|
|
5842
|
+
componentDisplayName: this.getString(),
|
|
5843
|
+
...event
|
|
5844
|
+
});
|
|
5845
|
+
});
|
|
5839
5846
|
autorouter.start();
|
|
5840
5847
|
try {
|
|
5841
5848
|
const traces = await routingPromise;
|
|
@@ -7276,6 +7283,7 @@ var RootCircuit = class {
|
|
|
7276
7283
|
await new Promise((resolve) => setTimeout(resolve, 100));
|
|
7277
7284
|
this.render();
|
|
7278
7285
|
}
|
|
7286
|
+
this.emit("renderComplete");
|
|
7279
7287
|
}
|
|
7280
7288
|
_hasIncompleteAsyncEffects() {
|
|
7281
7289
|
return this.children.some((child) => {
|