/** * Copyright (c) Meta Platforms, Inc. and affiliates. * * This source code is licensed under the MIT license found in the * LICENSE file in the root directory of this source tree. * */ import { type CodeNode } from '@lexical/code-core'; import { type LexicalEditor, type LexicalNode, type NodeKey } from 'lexical'; export declare function isCodeLanguageLoaded(language: string): boolean; /** * Loads a syntax highlighting grammar for the given language via Shiki. * If the language is already loaded or is not supported, the call is a no-op. * * When both `editor` and `codeNodeKey` are passed, the corresponding * {@link CodeNode} is updated to enable syntax highlighting once the * language becomes available * @param language language identifier (e.g. `"typescript"`, `"diff-js"`) * @param editor - Lexical editor instance to update after the language loads. * @param codeNodeKey - Key of the {@link CodeNode} to mark as syntax-highlight-supported. * @returns A Promise that resolves when the language is ready, * or `undefined` if the `language` was already loaded or is not supported. */ export declare function loadCodeLanguage(language: string, editor?: LexicalEditor, codeNodeKey?: NodeKey): Promise | undefined; export declare function isCodeThemeLoaded(theme: string): boolean; export declare function loadCodeTheme(theme: string, editor?: LexicalEditor, codeNodeKey?: NodeKey): Promise | undefined; export declare function getCodeLanguageOptions(): [string, string][]; export declare function getCodeThemeOptions(): [string, string][]; export declare function normalizeCodeLanguage(language: string): string; export declare function $getHighlightNodes(codeNode: CodeNode, language: string): LexicalNode[];