import { type ClassDeclaration, type MethodDeclaration, Scope } from 'ts-morph'; import { type PropertyDependencyAnalyzer } from './property-dependency-analyzer.js'; /** * Metadata about a property shared across multiple responsibilities. */ export interface SharedProperty { name: string; type: string; scope: Scope; usedByResponsibilities: string[]; initializer?: string; } /** * Specification for generating a state service. */ export interface StateServiceSpec { serviceName: string; sharedProperties: SharedProperty[]; originalClassName: string; } /** * Responsibility group with methods. */ export interface ResponsibilityGroup { responsibility: string; methods: MethodDeclaration[]; } /** * Detects properties used by multiple responsibility groups. * * Generates state service specifications for shared properties. * * @example * ```typescript * const detector = new SharedStateDetector(); * const spec = detector.detectSharedState(classDecl, groups, propertyAnalyzer); * if (spec) { * const code = detector.generateStateServiceCode(spec); * } * ``` */ export declare class SharedStateDetector { /** * Detects properties used by >1 responsibility group. * * Algorithm: * 1. Track property usage per responsibility group * 2. Find properties used by >1 group * 3. Generate state service specification * * @param classDecl - The class declaration * @param responsibilityGroups - Groups of methods by responsibility * @param propertyAnalyzer - Property dependency analyzer * @returns State service specification or null if no shared properties */ detectSharedState(classDecl: ClassDeclaration, responsibilityGroups: ResponsibilityGroup[], propertyAnalyzer: PropertyDependencyAnalyzer): StateServiceSpec | null; /** * Generates state service source code. * Creates getter/setter methods for shared properties. * * @param spec - State service specification * @returns Generated source code */ generateStateServiceCode(spec: StateServiceSpec): string; } //# sourceMappingURL=shared-state-detector.d.ts.map