import { Registry, IRawTheme, IGrammar } from 'monaco-textmate'; export interface ILanguageRegistryConfig { /** * Absolute UNIX like path that should lead to root of this package * * Required to compute path of grammar files * * Examples: * `node_modules/monaco-textmate-languages` OR * `static/third-party/libs/monaco-textmate-languages` OR * `https://cdn.example.com/dist/monaco-textmate-languages` * * Remember, the path you provide will be used to load a language, * so think about all the things that could go wrong in your setup * when this library suffixes the path you provide with a relative * path to a grammar file and calls `jsonFetcher` or `textFetcher` * with a complete URI */ basePath: string; theme?: IRawTheme; jsonFetcher?: (uri: string) => object | Promise; textFetcher?: (uri: string) => string | Promise; } export declare class LanguageRegistry extends Registry { constructor(config: ILanguageRegistryConfig); /** * Returns Grammar by language ID * @param langId Language ID (Example: `html`, `typescript`) */ getLanguageGrammar(langId: string): Promise; /** * Returns Grammar by file extension * @param ext File extension (Example: `.tsx`, `.css`) */ getLanguageGrammarByExtension(ext: string): Promise; /** * Return Grammar by MIME type * @param mime Mime type (Example: `application/javascript`, `text/html`) */ getLanguageGrammarByMimeType(mime: string): Promise; }