@lobehub/editor
Version:
A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.
21 lines (20 loc) • 677 B
TypeScript
/**
* Language detection utility for code snippets
* Uses pattern matching and heuristics to identify programming languages
*/
interface LanguageDetectionResult {
confidence: number;
language: string;
}
/**
* Detect the programming language of a code snippet
* @param code - The code snippet to analyze
* @returns Language detection result with confidence score
*/
export declare function detectLanguage(code: string): LanguageDetectionResult | null;
/**
* Simple detection for common formats with high confidence
* Falls back to detectLanguage for more complex detection
*/
export declare function detectCodeLanguage(code: string): string | null;
export {};