/**
 * 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 { LexicalEditor, LexicalNode } from 'lexical';
import { CodeNode } from '@lexical/code-core';
type TokenContent = string | Token | (string | Token)[];
export interface Token {
    type: string;
    alias: string | string[];
    content: TokenContent;
}
export interface Tokenizer {
    /**
     * Language to fall back to when a {@link CodeNode} doesn't carry one.
     * Set to `null` to opt out of the implicit fallback — code blocks
     * without a language stay untouched (no `data-language` attribute, no
     * syntax highlighting) so a markdown round-trip can preserve ``` with
     * no info string.
     */
    defaultLanguage: string | null;
    tokenize(code: string, language?: string): (string | Token)[];
    $tokenize(codeNode: CodeNode, language?: string): LexicalNode[];
}
export declare const PrismTokenizer: Tokenizer;
/**
 * @internal
 * Register only the Prism highlighting transforms and the gutter
 * mutation listener. No keyboard / indent handlers — those are the
 * responsibility of
 * {@link "@lexical/code-core".registerCodeIndentation} /
 * {@link "@lexical/code-core".CodeIndentExtension}.
 *
 * Used by {@link CodePrismExtension}, whose `CodeIndentExtension`
 * dependency handles the indent side. The legacy
 * {@link registerCodeHighlighting} wrapper combines this helper with
 * `registerCodeIndentation` for direct callers that want the original
 * single-call setup.
 *
 * Exported for use by the package's own unit tests; not re-exported
 * from the package entry point.
 */
export declare function registerHighlightingOnly(editor: LexicalEditor, tokenizer: Tokenizer): () => void;
/**
 * Register the Prism tokenizer-driven highlighting on the editor along
 * with the indent / Tab / arrow-key keyboard handlers. This function
 * is provided for legacy code that has not upgraded to using
 * {@link CodePrismExtension}.
 */
export declare function registerCodeHighlighting(editor: LexicalEditor, tokenizer?: Tokenizer): () => void;
export interface CodePrismConfig {
    /**
     * When true, the Prism code highlighter is not registered on the editor.
     * This signal can be flipped at runtime to enable or disable the
     * highlighter, for example to switch between the Prism and Shiki
     * highlighters without rebuilding the editor.
     */
    disabled: boolean;
    tokenizer: Tokenizer;
}
/**
 * Add code highlighting support for code blocks with Prism.
 *
 * {@link CodeExtension} is a dependency, so the required `CodeNode` and
 * `CodeHighlightNode` nodes are registered automatically.
 * {@link CodeIndentExtension} is also a dependency, so Tab / Shift+Tab
 * and the related keyboard handlers are activated automatically. Set
 * `tabSize` on `CodeIndentExtension` to enable space-indent outdent.
 */
export declare const CodePrismExtension: import("lexical").LexicalExtension<CodePrismConfig, "@lexical/code-prism", import("@lexical/extension").NamedSignalsOutput<CodePrismConfig>, unknown>;
export {};
