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.

15 lines (14 loc) 817 B
import type { LexicalEditor } from 'lexical'; import { DataSource } from "../../../editor-kernel"; import type { IWriteOptions } from "../../../editor-kernel/data-source"; import type { IServiceID } from "../../../types"; import type { MarkdownShortCutService } from '../service/shortcut'; export default class MarkdownDataSource extends DataSource { protected dataType: string; protected markdownService: MarkdownShortCutService; protected getService?: (<T>(serviceId: IServiceID<T>) => T | null) | undefined; private formatMarkdown; constructor(dataType: string, markdownService: MarkdownShortCutService, getService?: (<T>(serviceId: IServiceID<T>) => T | null) | undefined); read(editor: LexicalEditor, data: string): void; write(editor: LexicalEditor, options?: IWriteOptions): any; }