@mui/internal-docs-infra
Version:
MUI Infra - internal documentation creation tools.
24 lines • 1.01 kB
text/typescript
/**
* Maps file extensions to language names.
* These are user-friendly names that can be used in the `language` prop.
*/
export declare const languageMap: Record<string, string>;
/**
* Maps language aliases to canonical language names.
* Used to normalize short language names (e.g., from className like 'language-js')
* to their full names.
*/
export declare const languageAliasMap: Record<string, string>;
/**
* Gets the language name from a file extension.
* @param extension - The file extension (e.g., '.tsx', '.css')
* @returns The language name or undefined if not recognized
*/
export declare function getLanguageFromExtension(extension: string): string | undefined;
/**
* Normalizes a language name to its canonical form.
* This handles aliases like 'js' -> 'javascript', 'ts' -> 'typescript'.
* @param language - The language name or alias
* @returns The canonical language name, or the input if not a known alias
*/
export declare function normalizeLanguage(language: string): string;