UNPKG

@uiw/react-markdown-editor

Version:

A markdown editor with preview, implemented with React.js and TypeScript.

32 lines (31 loc) 989 B
import { ReactCodeMirrorRef } from '@uiw/react-codemirror'; import { IMarkdownEditor, ToolBarProps } from '../'; export declare type ButtonHandle = (command: ICommand, props: IMarkdownEditor, options: ToolBarProps) => JSX.Element; export declare type ICommand = { icon?: React.ReactElement; name?: string; keyCommand?: string; button?: ButtonHandle | React.ButtonHTMLAttributes<HTMLButtonElement>; execute?: (editor: ReactCodeMirrorRef) => void; }; export declare const defaultCommands: { undo: ICommand; redo: ICommand; bold: ICommand; italic: ICommand; header: ICommand; strike: ICommand; underline: ICommand; quote: ICommand; olist: ICommand; ulist: ICommand; todo: ICommand; link: ICommand; image: ICommand; code: ICommand; codeBlock: ICommand; fullscreen: ICommand; preview: ICommand; }; export declare const getCommands: () => ICommand[]; export declare const getModeCommands: () => ICommand[];