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.

24 lines (23 loc) 808 B
import type { IEditorPluginConstructor } from "../../../types"; import { ISlashOption, SlashOptions } from '../service/i-slash-service'; export interface ITriggerContext { getRect: () => DOMRect; items: Array<ISlashOption> | ((search: { leadOffset: number; matchingString: string; replaceableString: string; } | null) => Promise<Array<ISlashOption>>); lastIndex: number; match?: { leadOffset: number; matchingString: string; replaceableString: string; } | null; trigger: SlashOptions['trigger']; } export interface SlashPluginOptions { slashOptions?: SlashOptions[]; triggerClose: () => void; triggerOpen: (ctx: ITriggerContext) => void; } export declare const SlashPlugin: IEditorPluginConstructor<SlashPluginOptions>;