| 76 | } |
| 77 | |
| 78 | export interface MarkdownEditorProps { |
| 79 | /** The markdown source. Treated as the controlled value. */ |
| 80 | value: string; |
| 81 | /** Called with the updated markdown after each transaction. */ |
| 82 | onChange?: (markdown: string) => void; |
| 83 | /** Placeholder shown when the document is empty. */ |
| 84 | placeholder?: string; |
| 85 | /** Read-only mode (no edits accepted). */ |
| 86 | readOnly?: boolean; |
| 87 | /** Autofocus on mount. */ |
| 88 | autoFocus?: boolean; |
| 89 | /** Extra class on the outer wrapper. Inner ProseMirror surface gets a fixed class for styling. */ |
| 90 | className?: string; |
| 91 | /** Notified once when the editor instance is created. Useful for parent toolbars. */ |
| 92 | onReady?: (editor: Editor) => void; |
| 93 | /** Called when the user clicks an http(s) link inside the editor. */ |
| 94 | onLinkClick?: (url: string) => void; |
| 95 | /** Called when the user clicks a non-http link (relative path, file://, etc). */ |
| 96 | onLocalLinkClick?: (href: string) => void; |
| 97 | } |
| 98 | |
| 99 | export interface MarkdownEditorRef { |
| 100 | /** Returns the current markdown source. */ |
nothing calls this directly
no outgoing calls
no test coverage detected