import ParserFromPackage from 'web-tree-sitter'; import { FileCache } from './cache/fileCache.js'; import { CodeMapGeneratorConfig } from './types.js'; import { GrammarManager } from './cache/grammarManager.js'; import { MemoryCache } from './cache/memoryCache.js'; import { MemoryManager } from './cache/memoryManager.js'; import { MemoryLeakDetector } from './cache/memoryLeakDetector.js'; import { ProcessLifecycleManager } from './cache/processLifecycleManager.js'; export type SyntaxNode = ParserFromPackage.SyntaxNode; export declare let grammarManager: GrammarManager | null; export declare let memoryManager: MemoryManager | null; export declare let astMemoryCache: MemoryCache | null; export declare let sourceCodeMemoryCache: MemoryCache | null; export declare let memoryLeakDetector: MemoryLeakDetector | null; export declare let processLifecycleManager: ProcessLifecycleManager | null; export interface LanguageConfig { name: string; wasmPath: string; parserCreateQuery?: (language: ParserFromPackage.Language) => ((text: string) => ParserFromPackage.Query); } export declare const languageConfigurations: Record; export declare function initializeParser(): Promise; export declare function initializeCaches(config: CodeMapGeneratorConfig): Promise; export declare function clearCaches(): Promise; export declare function loadLanguageGrammar(extension: string, langConfig: LanguageConfig): Promise; export declare function getParserForFileExtension(fileExtension: string): Promise; export declare function getCachedValue(key: string, fileCache: FileCache | null, memoryCache: MemoryCache | null): Promise; export declare function setCachedValue(key: string, value: T, fileCache: FileCache | null, memoryCache: MemoryCache | null): Promise; export declare function parseCode(sourceCode: string, fileExtension: string, filePath?: string, config?: CodeMapGeneratorConfig): Promise; export declare function readAndParseFile(filePath: string, fileExtension: string, config: CodeMapGeneratorConfig): Promise<{ tree: ParserFromPackage.Tree | null; sourceCode: string; }>; export declare function shouldUseMemoryCache(config?: CodeMapGeneratorConfig): boolean; export declare function getSourceCodeFromCache(filePath: string, allowedDir?: string): Promise; export declare function getAllSourceCodeFromCache(): Map; export declare function parseSourceCode(sourceCode: string, fileExtension: string): Promise<{ ast: SyntaxNode; language: string; }>; export declare function cleanupParser(): void; export declare function getMemoryManager(): MemoryManager | null; export declare function formatBytes(bytes: number): string; export declare function getMemoryStats(): { heapUsed: number; heapTotal: number; rss: number; systemTotal: number; memoryUsagePercentage: number; formatted: { heapUsed: string; heapTotal: string; rss: string; systemTotal: string; }; }; export type Tree = ParserFromPackage.Tree; export type Language = ParserFromPackage.Language; export type Point = ParserFromPackage.Point; export { ParserFromPackage as Parser }; //# sourceMappingURL=parser.d.ts.map