UNPKG

@lobehub/editor

Version:

A powerful and extensible rich text editor built on Meta's Lexical framework, providing a modern editing experience with React integration.

26 lines (25 loc) 920 B
/** * 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 { CodeNode } from '@lexical/code'; import type { LexicalEditor, LexicalNode } from 'lexical'; import { INode } from "../../../editor-kernel/inode"; export interface Tokenizer { $tokenize(codeNode: CodeNode, language?: string): LexicalNode[]; $tokenizeSerialized(code: string, language?: string, theme?: string | { dark: string; light: string; }): INode[]; defaultLanguage: string; defaultTheme: string | { dark: string; light: string; }; } export declare const ShikiTokenizer: Tokenizer; export declare function toCodeTheme(tokenizer: Tokenizer): string; export declare function registerCodeHighlighting(editor: LexicalEditor, tokenizer?: Tokenizer): () => void;