import type { ContentModelCodeFormat, EditorPlugin, IEditor, PluginEvent } from 'roosterjs-content-model-types'; /** * * Options for Markdown plugin * - strikethrough: If true text between ~ will receive strikethrough format. * - bold: If true text between * will receive bold format. * - italic: If true text between _ will receive italic format. * - codeFormat: If provided, text between ` will receive code format. If equal to {}, it will set the default code format. */ export interface MarkdownOptions { strikethrough?: boolean; bold?: boolean; italic?: boolean; codeFormat?: ContentModelCodeFormat; } /** * Markdown plugin handles markdown formatting, such as transforming * characters into bold text. */ export declare class MarkdownPlugin implements EditorPlugin { private options; private editor; private shouldBold; private shouldItalic; private shouldStrikethrough; private shouldCode; private lastKeyTyped; /** * @param options An optional parameter that takes in an object of type MarkdownOptions, which includes the following properties: * - strikethrough: If true text between ~ will receive strikethrough format. Defaults to false. * - bold: If true text between * will receive bold format. Defaults to false. * - italic: If true text between _ will receive italic format. Defaults to false. * - codeFormat: If provided, text between ` will receive code format. Defaults to undefined. */ constructor(options?: MarkdownOptions); /** * Get name of this plugin */ getName(): string; /** * The first method that editor will call to a plugin when editor is initializing. * It will pass in the editor instance, plugin should take this chance to save the * editor reference so that it can call to any editor method or format API later. * @param editor The editor object */ initialize(editor: IEditor): void; /** * The last method that editor will call to a plugin before it is disposed. * Plugin can take this chance to clear the reference to editor. After this method is * called, plugin should not call to any editor method since it will result in error. */ dispose(): void; /** * Core method for a plugin. Once an event happens in editor, editor will call this * method of each plugin to handle the event as long as the event is not handled * exclusively by another plugin. * @param event The event to handle: */ onPluginEvent(event: PluginEvent): void; private handleEditorInputEvent; private handleKeyDownEvent; private handleBackspaceEvent; private handleContentChangedEvent; private disableAllFeatures; }