import { type ClassDeclaration, type MethodDeclaration } from 'ts-morph'; /** * Represents a cross-service method call detected in a method body. */ export interface CrossServiceCall { /** Method name being called (e.g., 'sortUsers') */ methodName: string; /** Target service that contains the method (e.g., 'TransformationService') */ targetService: string; /** Source method that makes the call */ sourceMethod: MethodDeclaration; /** Full call expression text (e.g., 'this.sortUsers(users)') */ callExpression: string; } /** * Detects cross-service method calls in focused service methods. * * When methods are split across focused services, a method in one service * may call another method that was moved to a different service. * * This detector: * 1. Scans method bodies for `this.methodName()` calls * 2. Checks if methodName exists in the current service * 3. If not, finds which focused service contains it * 4. Returns cross-service call information for injection/rewriting */ export declare class CrossServiceCallDetector { /** * Detects all cross-service calls in a focused service. * * @param focusedServiceClass - The focused service class to analyze * @param allFocusedServices - Map of all focused services (serviceName → methods) * @returns Array of detected cross-service calls */ detectCrossServiceCalls(focusedServiceClass: ClassDeclaration, allFocusedServices: Map): CrossServiceCall[]; /** * Finds all `this.methodName()` calls in a method body. * * Uses AST traversal to find PropertyAccessExpression nodes where: * - Expression is `this` * - Name is a method name * - Parent is a CallExpression * * @param methodBody - Method body node to analyze * @returns Array of method calls with name and full expression */ private findThisMethodCalls; /** * Finds which focused service contains a given method. * * @param methodName - Method name to find * @param allFocusedServices - Map of all focused services * @returns Service name that contains the method, or undefined */ private findTargetService; } //# sourceMappingURL=cross-service-call-detector.d.ts.map