index.d.ts•3.1 kB
/* tslint:disable */
/* eslint-disable */
/* auto-generated by NAPI-RS */
export interface SemanticConcept {
id: string
name: string
conceptType: string
confidence: number
filePath: string
lineRange: LineRange
relationships: Record<string, string>
metadata: Record<string, string>
}
export interface LineRange {
start: number
end: number
}
export interface CodebaseAnalysisResult {
languages: Array<string>
frameworks: Array<string>
complexity: ComplexityMetrics
concepts: Array<SemanticConcept>
}
export interface ComplexityMetrics {
cyclomatic: number
cognitive: number
lines: number
}
export interface Pattern {
id: string
patternType: string
description: string
frequency: number
confidence: number
examples: Array<PatternExample>
contexts: Array<string>
}
export interface PatternExample {
code: string
filePath: string
lineRange: LineRange
}
export interface PatternAnalysisResult {
detected: Array<string>
violations: Array<string>
recommendations: Array<string>
learned?: Array<Pattern>
}
export interface ApproachPrediction {
approach: string
confidence: number
reasoning: string
patterns: Array<string>
complexity: string
}
export interface AstNode {
nodeType: string
text: string
startLine: number
endLine: number
startColumn: number
endColumn: number
children: Array<AstNode>
}
export interface ParseResult {
language: string
tree: AstNode
errors: Array<string>
symbols: Array<symbol>
}
export interface Symbol {
name: string
symbolType: string
line: number
column: number
scope: string
}
export declare function initCore(): string
export declare class SemanticAnalyzer {
constructor()
analyzeCodebase(path: string): Promise<CodebaseAnalysisResult>
analyzeFileContent(filePath: string, content: string): Promise<Array<SemanticConcept>>
learnFromCodebase(path: string): Promise<Array<SemanticConcept>>
updateFromAnalysis(analysisData: string): Promise<boolean>
getConceptRelationships(conceptId: string): Array<string>
}
export declare class PatternLearner {
constructor()
learnFromCodebase(path: string): Promise<Array<Pattern>>
extractPatterns(path: string): Promise<Array<Pattern>>
analyzeFileChange(changeData: string): Promise<PatternAnalysisResult>
findRelevantPatterns(problemDescription: string, currentFile?: string | undefined | null, selectedCode?: string | undefined | null): Promise<Array<Pattern>>
predictApproach(problemDescription: string, context: Record<string, string>): Promise<ApproachPrediction>
learnFromAnalysis(analysisData: string): Promise<boolean>
updateFromChange(changeData: string): Promise<boolean>
}
export declare class AstParser {
constructor()
parseCode(code: string, language: string): ParseResult
queryAst(code: string, language: string, queryString: string): Array<AstNode>
getSymbols(code: string, language: string): Array<symbol>
getNodeAtPosition(code: string, language: string, line: number, column: number): AstNode | null
analyzeComplexity(code: string, language: string): Record<string, number>
}