@tscircuit/schematic-trace-solver 0.0.159 → 0.0.160

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
@@ -152,10 +152,11 @@ interface InputNetConnection {
152
152
  anchoredNetLabelWidth?: number;
153
153
  netLabelHeight?: number;
154
154
  /**
155
- * When true, a named one- or two-pin net may use inline labels. A single-pin
156
- * net gets an outward stub. A routed two-pin net gets one label along its
157
- * trace; when that route is intentionally skipped, both endpoints get
158
- * outward stubs. Nets with more than two pins retain anchored labels.
155
+ * When true, a named net may use inline labels. Each routed connected
156
+ * component gets a label along its representative trace, while each
157
+ * disconnected endpoint gets an outward inline-label stub. Conversion is
158
+ * atomic for the whole net so inline and anchored representations are not
159
+ * mixed when any label cannot be placed.
159
160
  */
160
161
  allowInlineNetLabel?: boolean;
161
162
  /** Extent of the inline text along the generated trace stub. */
@@ -1282,11 +1283,16 @@ interface InlineNetLabelOutput {
1282
1283
  netLabelPlacements: NetLabelPlacement[];
1283
1284
  inlineNetLabelPlacements: InlineNetLabelPlacement[];
1284
1285
  }
1285
- type InlineEligibleConnection = InputDirectConnection | InputNetConnection;
1286
+ type QueuedInlineConnection = {
1287
+ kind: "direct_connection";
1288
+ connection: InputDirectConnection;
1289
+ } | {
1290
+ kind: "net_connection";
1291
+ connection: InputNetConnection;
1292
+ };
1286
1293
  /**
1287
1294
  * Places "inline net labels" - net names drawn alongside the trace they belong
1288
- * to - for one- or two-pin connections that opted in via
1289
- * `allowInlineNetLabel`.
1295
+ * to - for connections that opted in via `allowInlineNetLabel`.
1290
1296
  *
1291
1297
  * Any regular (anchored) net label placement for the same net is dropped, so a
1292
1298
  * net is never labeled twice.
@@ -1296,14 +1302,38 @@ declare class InlineNetLabelSolver extends BaseSolver {
1296
1302
  traces: SolvedTracePath[];
1297
1303
  inputNetLabelPlacements: NetLabelPlacement[];
1298
1304
  inlineNetLabelPlacements: InlineNetLabelPlacement[];
1299
- /** Eligible one- or two-pin connections still waiting to be processed. */
1300
- queuedConnections: InlineEligibleConnection[];
1305
+ /** Eligible connections still waiting to be processed. */
1306
+ queuedConnections: QueuedInlineConnection[];
1301
1307
  private tracesByPinPairKey;
1308
+ private globalConnMap;
1309
+ private supersededTraceIdsByGlobalConnNetId;
1302
1310
  private hasAlignedPortOnlyStubs;
1303
1311
  private postProcessedOutput?;
1304
1312
  constructor(input: InlineNetLabelSolverInput);
1305
1313
  getConstructorParams(): [InlineNetLabelSolverInput];
1306
1314
  _step(): void;
1315
+ /**
1316
+ * Plans all opted-in multi-pin nets together. Short routed components can
1317
+ * mutually block the outward endpoint stubs that replace them, so tentative
1318
+ * replacements are ignored as obstacles only while their owning net still
1319
+ * converts successfully. Failed conversions retain both their traces and
1320
+ * their conventional labels, and the remaining conversions are retried.
1321
+ */
1322
+ private computeNetConnectionInlineConversions;
1323
+ /**
1324
+ * Splits an input net into the connected components created by its solved
1325
+ * traces. This intentionally does not depend on anchored-label placement:
1326
+ * a group whose anchored label failed still has the same routing topology.
1327
+ */
1328
+ private getNetConnectionComponents;
1329
+ private getGlobalConnNetId;
1330
+ /**
1331
+ * Converts every conventional label representation for an opted-in named
1332
+ * net. Routed connected components become labels on their representative
1333
+ * trace; disconnected pins become outward terminal stubs. The conversion is
1334
+ * atomic so one blocked candidate cannot leave mixed label styles on a net.
1335
+ */
1336
+ private computeNetConnectionInlinePlacements;
1307
1337
  /**
1308
1338
  * Converts one conventional endpoint placement into an inline label on a
1309
1339
  * generated outward stub. The stub follows the pin's true facing direction;
@@ -1330,6 +1360,7 @@ declare class InlineNetLabelSolver extends BaseSolver {
1330
1360
  */
1331
1361
  private getSupersededNetLabelKeys;
1332
1362
  private getOutputTraces;
1363
+ private getInlineGlobalsOverlappingAnchoredLabels;
1333
1364
  private buildPostProcessedOutput;
1334
1365
  getOutput(): {
1335
1366
  traces: SolvedTracePath[];