forked from pi22by7/In-Memoria
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.d.ts
More file actions
106 lines (104 loc) · 3.03 KB
/
index.d.ts
File metadata and controls
106 lines (104 loc) · 3.03 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
/* 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>
}