/**
 * Codebase Semantic Map Types
 *
 * Defines types for building and querying a semantic understanding
 * of a codebase including structure, relationships, and concepts.
 *
 * Based on research:
 * - Program comprehension
 * - Code knowledge graphs
 * - Software architecture recovery
 */
/**
 * Types of code elements
 */
export type CodeElementType = "file" | "directory" | "module" | "class" | "interface" | "type" | "function" | "method" | "variable" | "constant" | "enum" | "import" | "export" | "component" | "hook" | "test" | "config";
/**
 * A code element in the semantic map
 */
export interface CodeElement {
    id: string;
    type: CodeElementType;
    name: string;
    qualifiedName: string;
    filePath: string;
    location: ElementLocation;
    description?: string;
    language: string;
    visibility: "public" | "private" | "protected" | "internal";
    metadata: Record<string, unknown>;
    signature?: string;
    docstring?: string;
}
/**
 * Location of an element in source code
 */
export interface ElementLocation {
    startLine: number;
    endLine: number;
    startColumn?: number;
    endColumn?: number;
}
/**
 * Types of relationships between code elements
 */
export type RelationshipType = "imports" | "exports" | "calls" | "implements" | "extends" | "uses" | "defines" | "contains" | "tests" | "depends_on" | "similar_to" | "overrides" | "references" | "instantiates";
/**
 * A relationship between two code elements
 */
export interface CodeRelationship {
    id: string;
    type: RelationshipType;
    sourceId: string;
    targetId: string;
    strength: number;
    metadata: Record<string, unknown>;
}
/**
 * A semantic cluster of related elements
 */
export interface SemanticCluster {
    id: string;
    name: string;
    description: string;
    category: ClusterCategory;
    elements: string[];
    centroid?: number[];
    coherence: number;
    keywords: string[];
}
/**
 * Categories for semantic clusters
 */
export type ClusterCategory = "feature" | "module" | "layer" | "utility" | "data_model" | "api" | "ui" | "business_logic" | "infrastructure" | "testing" | "configuration" | "unknown";
/**
 * Architectural layer
 */
export interface ArchitecturalLayer {
    id: string;
    name: string;
    description: string;
    level: number;
    elements: string[];
    dependencies: string[];
}
/**
 * A concept or topic in the codebase
 */
export interface CodeConcept {
    id: string;
    name: string;
    description: string;
    keywords: string[];
    relatedElements: string[];
    frequency: number;
    importance: number;
}
/**
 * The complete semantic map of a codebase
 */
export interface SemanticMap {
    id: string;
    rootPath: string;
    createdAt: Date;
    updatedAt: Date;
    elements: Map<string, CodeElement>;
    relationships: Map<string, CodeRelationship>;
    clusters: Map<string, SemanticCluster>;
    layers: ArchitecturalLayer[];
    concepts: Map<string, CodeConcept>;
    stats: MapStatistics;
    metadata: Record<string, unknown>;
}
/**
 * Statistics about the semantic map
 */
export interface MapStatistics {
    totalFiles: number;
    totalElements: number;
    totalRelationships: number;
    totalClusters: number;
    elementsByType: Map<CodeElementType, number>;
    relationshipsByType: Map<RelationshipType, number>;
    averageClusterSize: number;
    coveragePercent: number;
}
/**
 * Configuration for building the semantic map
 */
export interface SemanticMapConfig {
    includePaths: string[];
    excludePaths: string[];
    languages: string[];
    analyzeImports: boolean;
    analyzeCalls: boolean;
    analyzeTypes: boolean;
    buildClusters: boolean;
    minClusterSize: number;
    maxClusterCount: number;
    similarityThreshold: number;
    useEmbeddings: boolean;
    cacheEnabled: boolean;
}
/**
 * Default configuration
 */
export declare const DEFAULT_MAP_CONFIG: SemanticMapConfig;
/**
 * Query for searching the semantic map
 */
export interface SemanticQuery {
    text?: string;
    elementTypes?: CodeElementType[];
    relationshipTypes?: RelationshipType[];
    clusters?: string[];
    concepts?: string[];
    filePaths?: string[];
    maxResults?: number;
    includeRelated?: boolean;
    relatedDepth?: number;
}
/**
 * Result of a semantic query
 */
export interface SemanticQueryResult {
    elements: CodeElement[];
    relationships: CodeRelationship[];
    clusters: SemanticCluster[];
    concepts: CodeConcept[];
    relevanceScores: Map<string, number>;
    queryTime: number;
}
/**
 * Impact analysis result
 */
export interface ImpactAnalysis {
    changedElement: CodeElement;
    directlyAffected: CodeElement[];
    transitivelyAffected: CodeElement[];
    affectedTests: CodeElement[];
    riskLevel: "low" | "medium" | "high" | "critical";
    recommendations: string[];
}
/**
 * Navigation suggestion
 */
export interface NavigationSuggestion {
    from: CodeElement;
    to: CodeElement;
    reason: string;
    relevance: number;
    relationship?: RelationshipType;
}
/**
 * Events emitted during map building
 */
export interface MapBuildingEvents {
    "map:start": {
        config: SemanticMapConfig;
    };
    "map:file": {
        path: string;
        elements: number;
    };
    "map:relationships": {
        count: number;
    };
    "map:clusters": {
        count: number;
    };
    "map:complete": {
        stats: MapStatistics;
    };
    "map:error": {
        error: string;
        path?: string;
    };
}
/**
 * Function for reading files
 */
export type FileReader = (path: string) => Promise<string>;
/**
 * Function for listing files
 */
export type FileLister = (pattern: string) => Promise<string[]>;
/**
 * AST node (simplified)
 */
export interface ASTNode {
    type: string;
    name?: string;
    start: number;
    end: number;
    children?: ASTNode[];
    properties?: Record<string, unknown>;
}
