/**
 * `typescript-interfaces` adapter — entity-shape extraction from raw
 * TypeScript class / interface / type declarations. Designed for
 * adapter-free codebases (no decorators, no schema.prisma, no JPA
 * annotations) where the only source signal is the declared types
 * themselves.
 *
 * Phase C of the 2026-05-04-ANALYSE-VIA-FAITHFUL-SKELETON-AND-MICROCALLS
 * plan. Closes the empirical gap surfaced when comparing the giant-call
 * idle-meta output (20 LLM-fabricated models, faithfully translated
 * from TS interfaces) vs the microcall idle-meta output (0 models,
 * because no adapter detected entities).
 *
 * Design principle: faithful mirror of source, no fabrication. Promotes
 * an interface/class to an entity ONLY when its shape suggests
 * persistence. Non-entity types (DTOs, request/response shapes, internal
 * computation aids) are recorded separately in `declaredTypes` but NOT
 * promoted to `facts.entities`. The future `types:` schema slot is
 * deferred to TODO #49.
 *
 * Heuristics (configurable):
 *   - liberal (default): has an `id` field of any type → entity
 *   - conservative: has `id` AND at least one of {createdAt, updatedAt, _id} → entity
 *
 * Relationships are inferred by cross-referencing field types:
 *   - `field: T[]` where T is a detected entity → hasMany
 *   - `field: T` where T is a detected entity → belongsTo (or hasOne)
 *   - bidirectional pairs: hasMany + belongsTo when both sides exist
 *
 * Lifecycles are NOT inferred here — that requires method-body analysis
 * (the existing method-body-walker already covers that path via the
 * lifecycleField hint, separate from this walker).
 */
import type { StructuralPrepass } from '../interface.js';
export interface TypeScriptInterfaceField {
    name: string;
    declaredType: string;
    isOptional: boolean;
    isArray: boolean;
}
export interface TypeScriptDeclaredType {
    name: string;
    filePath: string;
    startLine: number;
    endLine: number;
    /** class | interface | type-alias */
    kind: 'class' | 'interface' | 'type';
    fields: TypeScriptInterfaceField[];
    /** Classified shape: persistent entity vs DTO vs utility. */
    shape: 'entity' | 'dto-shape' | 'utility' | 'unknown';
}
export interface TypeScriptInterfaceFacts {
    /** Types that look like persistent entities (per the heuristic). */
    entities: TypeScriptDeclaredType[];
    /** Inferred relationships between entities via field cross-reference. */
    relationships: Array<{
        from: string;
        to: string;
        type: 'hasMany' | 'hasOne' | 'belongsTo';
        fieldName: string;
    }>;
    /** Inferred lifecycles from literal-union type aliases (engines 6.27.6+).
     *  Symmetry with the typescript-decorators adapter, which derives
     *  lifecycles from `@Column({ enum: ... })` shapes. Adapter-free
     *  codebases declare states as `type Status = "a" | "b" | "c"` and
     *  reference them in entity fields; we surface those as state machines.
     *  Transitions intentionally empty here — recovering transitions
     *  needs method-body analysis (see method-body-walker for the
     *  `this.<field> = <enumMember>` path). */
    lifecycles: Array<{
        model: string;
        field: string;
        states: string[];
        transitions: Array<{
            action: string;
            from: string[];
            to: string;
        }>;
    }>;
    /** Non-entity declared types — DTOs, request/response shapes, etc.
     *  Captured for future use (TODO #49 — `types:` schema slot) but NOT
     *  promoted to facts.entities. */
    declaredTypes: TypeScriptDeclaredType[];
}
export interface TypeScriptInterfaceOptions {
    /** Default 'liberal'. Liberal: has `id` field. Conservative: has `id`
     *  AND timestamp field (createdAt | updatedAt | _id). */
    entityShapeHeuristic?: 'liberal' | 'conservative';
}
export declare function extractTypeScriptInterfaces(prepass: StructuralPrepass, options?: TypeScriptInterfaceOptions): Promise<TypeScriptInterfaceFacts>;
//# sourceMappingURL=typescript-interfaces.d.ts.map