@tscircuit/core 0.0.341 → 0.0.342

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 CHANGED
@@ -105,7 +105,86 @@ interface SchematicBoxDimensions {
105
105
  };
106
106
  }
107
107
 
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
+ type SimplifiedPcbTrace = {
109
+ type: "pcb_trace";
110
+ pcb_trace_id: string;
111
+ connection_name?: string;
112
+ route: Array<{
113
+ route_type: "wire";
114
+ x: number;
115
+ y: number;
116
+ width: number;
117
+ layer: string;
118
+ } | {
119
+ route_type: "via";
120
+ x: number;
121
+ y: number;
122
+ to_layer: string;
123
+ from_layer: string;
124
+ }>;
125
+ };
126
+ type Obstacle = {
127
+ type: "rect";
128
+ layers: string[];
129
+ center: {
130
+ x: number;
131
+ y: number;
132
+ };
133
+ width: number;
134
+ height: number;
135
+ connectedTo: string[];
136
+ };
137
+ interface SimpleRouteConnection {
138
+ name: string;
139
+ pointsToConnect: Array<{
140
+ x: number;
141
+ y: number;
142
+ layer: string;
143
+ }>;
144
+ }
145
+ interface SimpleRouteJson {
146
+ layerCount: number;
147
+ minTraceWidth: number;
148
+ obstacles: Obstacle[];
149
+ connections: Array<SimpleRouteConnection>;
150
+ bounds: {
151
+ minX: number;
152
+ maxX: number;
153
+ minY: number;
154
+ maxY: number;
155
+ };
156
+ traces?: SimplifiedPcbTrace[];
157
+ }
158
+
159
+ type RootCircuitEventName = "asyncEffect:start" | "asyncEffect:end" | "renderable:renderLifecycle:anyEvent" | `renderable:renderLifecycle:${RenderPhase}:start` | `renderable:renderLifecycle:${RenderPhase}:end` | "external:evalError" | "autorouting:start" | "autorouting:end" | "autorouting:error" | "autorouting:progress" | "renderComplete";
160
+ interface AutoroutingStartEvent {
161
+ type: "autorouting:start";
162
+ subcircuit_id: string;
163
+ componentDisplayName: string;
164
+ simpleRouteJson: SimpleRouteJson;
165
+ }
166
+ interface AutoroutingErrorEvent {
167
+ type: "autorouting:error";
168
+ subcircuit_id: string;
169
+ componentDisplayName: string;
170
+ error?: {
171
+ message: string;
172
+ stack?: string;
173
+ };
174
+ simpleRouteJson?: SimpleRouteJson;
175
+ debugGraphics?: any;
176
+ }
177
+ interface AutoroutingProgressEvent {
178
+ type: "autorouting:progress";
179
+ subcircuit_id: string;
180
+ componentDisplayName: string;
181
+ progress: number;
182
+ debugGraphics?: any;
183
+ }
184
+ interface AutoroutingEndEvent {
185
+ type: "autorouting:end";
186
+ }
187
+
109
188
  declare class RootCircuit {
110
189
  firstChild: PrimitiveComponent | null;
111
190
  children: PrimitiveComponent[];
@@ -915,57 +994,6 @@ declare class NormalComponent<ZodProps extends ZodType = any, PortNames extends
915
994
  _createTracesFromConnectionsProp(): void;
916
995
  }
917
996
 
918
- type SimplifiedPcbTrace = {
919
- type: "pcb_trace";
920
- pcb_trace_id: string;
921
- connection_name?: string;
922
- route: Array<{
923
- route_type: "wire";
924
- x: number;
925
- y: number;
926
- width: number;
927
- layer: string;
928
- } | {
929
- route_type: "via";
930
- x: number;
931
- y: number;
932
- to_layer: string;
933
- from_layer: string;
934
- }>;
935
- };
936
- type Obstacle = {
937
- type: "rect";
938
- layers: string[];
939
- center: {
940
- x: number;
941
- y: number;
942
- };
943
- width: number;
944
- height: number;
945
- connectedTo: string[];
946
- };
947
- interface SimpleRouteConnection {
948
- name: string;
949
- pointsToConnect: Array<{
950
- x: number;
951
- y: number;
952
- layer: string;
953
- }>;
954
- }
955
- interface SimpleRouteJson {
956
- layerCount: number;
957
- minTraceWidth: number;
958
- obstacles: Obstacle[];
959
- connections: Array<SimpleRouteConnection>;
960
- bounds: {
961
- minX: number;
962
- maxX: number;
963
- minY: number;
964
- maxY: number;
965
- };
966
- traces?: SimplifiedPcbTrace[];
967
- }
968
-
969
997
  declare class Group<Props extends z.ZodType<any, any, any> = typeof groupProps> extends NormalComponent<Props> implements ISubcircuit {
970
998
  pcb_group_id: string | null;
971
999
  subcircuit_id: string | null;
@@ -11190,4 +11218,4 @@ declare module "react/jsx-runtime" {
11190
11218
  }
11191
11219
  }
11192
11220
 
11193
- 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, type Obstacle, 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, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
11221
+ export { type AsyncEffect, type AutorouterCompleteEvent, type AutorouterErrorEvent, type AutorouterEvent, type AutorouterProgressEvent, type AutoroutingEndEvent, type AutoroutingErrorEvent, type AutoroutingProgressEvent, type AutoroutingStartEvent, 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, type Obstacle, 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, type SimpleRouteConnection, type SimpleRouteJson, type SimplifiedPcbTrace, SmtPad, Subcircuit, Switch, Trace, TraceHint, Transistor, Via, applyEditEventsToManualEditsFile, createUseComponent, getPhaseTimingsFromRenderEvents, getSimpleRouteJsonFromCircuitJson, orderedRenderPhases, sel, useCapacitor, useChip, useDiode, useLed, useRenderedCircuit, useResistor };
package/dist/index.js CHANGED
@@ -5886,9 +5886,17 @@ var Group = class extends NormalComponent {
5886
5886
  } catch (error) {
5887
5887
  const { db: db2 } = this.root;
5888
5888
  db2.pcb_autorouting_error.insert({
5889
- pcb_error_id: `local_${this.subcircuit_id}`,
5889
+ pcb_error_id: `pcb_autorouter_error_subcircuit_${this.subcircuit_id}`,
5890
5890
  message: error instanceof Error ? error.message : String(error)
5891
5891
  });
5892
+ this.root?.emit("autorouting:error", {
5893
+ subcircuit_id: this.subcircuit_id,
5894
+ componentDisplayName: this.getString(),
5895
+ error: {
5896
+ message: error instanceof Error ? error.message : String(error)
5897
+ },
5898
+ simpleRouteJson
5899
+ });
5892
5900
  throw error;
5893
5901
  } finally {
5894
5902
  autorouter.stop();
@@ -7245,7 +7253,7 @@ import { identity as identity4 } from "transformation-matrix";
7245
7253
  var package_default = {
7246
7254
  name: "@tscircuit/core",
7247
7255
  type: "module",
7248
- version: "0.0.340",
7256
+ version: "0.0.341",
7249
7257
  types: "dist/index.d.ts",
7250
7258
  main: "dist/index.js",
7251
7259
  module: "dist/index.js",
@@ -7297,7 +7305,7 @@ var package_default = {
7297
7305
  },
7298
7306
  dependencies: {
7299
7307
  "@lume/kiwi": "^0.4.3",
7300
- "@tscircuit/capacity-autorouter": "^0.0.13",
7308
+ "@tscircuit/capacity-autorouter": "^0.0.15",
7301
7309
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
7302
7310
  "@tscircuit/math-utils": "^0.0.9",
7303
7311
  "@tscircuit/props": "^0.0.159",
package/package.json CHANGED
@@ -1,7 +1,7 @@
1
1
  {
2
2
  "name": "@tscircuit/core",
3
3
  "type": "module",
4
- "version": "0.0.341",
4
+ "version": "0.0.342",
5
5
  "types": "dist/index.d.ts",
6
6
  "main": "dist/index.js",
7
7
  "module": "dist/index.js",
@@ -53,7 +53,7 @@
53
53
  },
54
54
  "dependencies": {
55
55
  "@lume/kiwi": "^0.4.3",
56
- "@tscircuit/capacity-autorouter": "^0.0.13",
56
+ "@tscircuit/capacity-autorouter": "^0.0.15",
57
57
  "@tscircuit/infgrid-ijump-astar": "^0.0.33",
58
58
  "@tscircuit/math-utils": "^0.0.9",
59
59
  "@tscircuit/props": "^0.0.159",