File size: 2,226 Bytes
40d7073 | 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 | /**
* Pattern Extraction Module - Consolidated code pattern detection
*
* Single source of truth for extracting functions, imports, exports, etc.
* Used by native-worker.ts and parallel-workers.ts
*/
export interface PatternMatch {
type: 'function' | 'class' | 'import' | 'export' | 'todo' | 'variable' | 'type';
match: string;
file: string;
line?: number;
}
export interface FilePatterns {
file: string;
language: string;
functions: string[];
classes: string[];
imports: string[];
exports: string[];
todos: string[];
variables: string[];
}
/**
* Detect language from file extension
*/
export declare function detectLanguage(file: string): string;
/**
* Extract function names from content
*/
export declare function extractFunctions(content: string): string[];
/**
* Extract class names from content
*/
export declare function extractClasses(content: string): string[];
/**
* Extract import statements from content
*/
export declare function extractImports(content: string): string[];
/**
* Extract export statements from content
*/
export declare function extractExports(content: string): string[];
/**
* Extract TODO/FIXME comments from content
*/
export declare function extractTodos(content: string): string[];
/**
* Extract all patterns from a file
*/
export declare function extractAllPatterns(filePath: string, content?: string): FilePatterns;
/**
* Extract patterns from multiple files
*/
export declare function extractFromFiles(files: string[], maxFiles?: number): FilePatterns[];
/**
* Convert FilePatterns to PatternMatch array (for native-worker compatibility)
*/
export declare function toPatternMatches(patterns: FilePatterns): PatternMatch[];
declare const _default: {
detectLanguage: typeof detectLanguage;
extractFunctions: typeof extractFunctions;
extractClasses: typeof extractClasses;
extractImports: typeof extractImports;
extractExports: typeof extractExports;
extractTodos: typeof extractTodos;
extractAllPatterns: typeof extractAllPatterns;
extractFromFiles: typeof extractFromFiles;
toPatternMatches: typeof toPatternMatches;
};
export default _default;
//# sourceMappingURL=patterns.d.ts.map |