/** * @angular-modernizer/plugin-angular - Missing Output Transform Orchestrator * * Transforms presentational component methods that call services directly into * event-emitting methods by adding modern output() signals. * * Philosophy: "Thin Rule, Thick Orchestrator" * * Detection supports both Angular writing styles: * - Constructor injection: constructor(private svc: MyService) {} * - inject() function: private svc = inject(MyService); * * Existing output detection supports both styles: * - Decorator: @Output() click = new EventEmitter() * - Signal: click = output() * * Three guarantees: * - Idempotent: skips methods that already have a corresponding output signal * - Atomic: rollback on any error * - Reversible: stores originalText in metadata */ import type { TransformContext, TransformResult } from '@angular-modernizer/plugin-system'; import type { PublicApi } from '@angular-modernizer/api'; export declare class MissingOutputTransformOrchestrator { readonly ruleId = "angular:missing-output-transform"; run(context: TransformContext): TransformResult; private findComponent; /** * Collect service field names from BOTH injection styles: * 1. Constructor injection: constructor(private svc: MyService) {} * 2. inject() function: private svc = inject(MyService); */ private collectServiceFieldNames; private isServiceType; /** * Collect existing output names from BOTH Angular writing styles: * 1. Decorator: @Output() clickEvent = new EventEmitter() * 2. Signal: clickEvent = output() * * Returns lowercased names for convention-based matching. */ private collectOutputNames; /** * Find methods that call service fields and lack a corresponding output signal. * * Convention-based matching (same as PresentationalComponentViolationRule): * - `delete` → looks for: deleteClick, deleteEvent, deleteChange, onDelete, etc. */ private findMethodsToTransform; /** * Convention-based: `delete` matches deleteClick, deleteEvent, deleteChange, onDelete. * Same logic as PresentationalComponentViolationRule to stay consistent. */ private hasCorrespondingOutput; /** * Infer the event payload from the method: * 1. If method has exactly 1 parameter → use its type as the output type * 2. Otherwise extract the first arg to the service call: * - `this.svc.method()` → void * - `this.svc.method(this.user.id)` → unknown (type not resolvable without full project) */ private inferPayload; /** * Insert the output signal property before the first method in the class. * Handles both styles by always generating modern output() signal. */ private addOutputProperty; /** * Replace the method body with a single emit call. * The original service interaction is fully delegated to the parent container. */ private replaceMethodBody; /** * Ensure `output` is imported from `@angular/core`. * Adds to existing `@angular/core` import if present, otherwise creates one. */ private ensureOutputImport; } //# sourceMappingURL=missing-output-transform.orchestrator.d.ts.map