@tscircuit/capacity-autorouter 0.0.279 → 0.0.280

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
@@ -2085,19 +2085,33 @@ declare class MultiSectionPortPointOptimizer extends BaseSolver {
2085
2085
  }
2086
2086
 
2087
2087
  type Side = "left" | "right" | "top" | "bottom";
2088
+ type OwnerPair = [string, string];
2089
+ type OwnerPairKey = string;
2090
+ type EdgeOrientation = "vertical" | "horizontal";
2088
2091
  type Bounds = {
2089
2092
  minX: number;
2090
2093
  maxX: number;
2091
2094
  minY: number;
2092
2095
  maxY: number;
2093
2096
  };
2094
- interface NodeAndSide {
2095
- nodeId: string;
2096
- side: Side;
2097
- }
2098
- type PortPointWithSide = PortPoint & {
2099
- side: Side;
2100
- ownerNodeId: string;
2097
+ type PortPointWithOwnerPair = PortPoint & {
2098
+ ownerNodeIds: OwnerPair;
2099
+ ownerPairKey: OwnerPairKey;
2100
+ };
2101
+ type SharedEdge = {
2102
+ ownerNodeIds: OwnerPair;
2103
+ ownerPairKey: OwnerPairKey;
2104
+ orientation: EdgeOrientation;
2105
+ x1: number;
2106
+ y1: number;
2107
+ x2: number;
2108
+ y2: number;
2109
+ center: {
2110
+ x: number;
2111
+ y: number;
2112
+ };
2113
+ length: number;
2114
+ nodeSideByOwnerId: Record<string, Side>;
2101
2115
  };
2102
2116
 
2103
2117
  interface UniformPortDistributionSolverInput {
@@ -2110,20 +2124,19 @@ interface UniformPortDistributionSolverInput {
2110
2124
  * routing density and prevent congestion.
2111
2125
  *
2112
2126
  * This solver:
2113
- * 1. Classifies which side of a node each port point belongs to.
2114
- * 2. Determines the "owner" node for port points shared between nodes.
2115
- * 3. Evenly spaces port points along their assigned side.
2127
+ * 1. Determines an owner pair of capacity nodes for each port point.
2128
+ * 2. Precomputes the shared edge for each owner pair.
2129
+ * 3. Evenly spaces "family" port points along their shared edge.
2116
2130
  */
2117
2131
  declare class UniformPortDistributionSolver extends BaseSolver$1 {
2118
2132
  private input;
2119
2133
  getSolverName(): string;
2120
- mapOfNodeIdToLengthOfEachSide: Map<string, Record<Side, number>>;
2121
- sidesToProcess: NodeAndSide[];
2122
2134
  mapOfNodeIdToBounds: Map<string, Bounds>;
2123
- mapOfNodeAndSideToPortPoints: Map<string, PortPointWithSide[]>;
2124
- currentSideBeingProcessed: NodeAndSide | null;
2135
+ mapOfOwnerPairToPortPoints: Map<string, PortPointWithOwnerPair[]>;
2136
+ mapOfOwnerPairToSharedEdge: Map<string, SharedEdge>;
2137
+ ownerPairsToProcess: OwnerPairKey[];
2138
+ currentOwnerPairBeingProcessed: OwnerPairKey | null;
2125
2139
  redistributedNodes: NodeWithPortPoints[];
2126
- private getNodeAndSideKey;
2127
2140
  constructor(input: UniformPortDistributionSolverInput);
2128
2141
  step(): void;
2129
2142
  rebuildNodes(): void;