diff --git a/types/easymde-test.ts b/types/easymde-test.ts index 2d5f5b7..f240ee9 100644 --- a/types/easymde-test.ts +++ b/types/easymde-test.ts @@ -7,6 +7,7 @@ const editor = new EasyMDE({ drawTable: 'Cmd-Alt-T', toggleFullScreen: null }, + previewClass: 'my-custom-class', spellChecker: false, onToggleFullScreen: (full: boolean) => { console.log('FullscreenToggled', full); @@ -28,3 +29,33 @@ editor.codemirror.setOption('readOnly', true); EasyMDE.toggleItalic = (editor: EasyMDE) => { console.log('SomeButtonOverride'); }; + +const editor2 = new EasyMDE({ + autoDownloadFontAwesome: undefined, + previewClass: ['my-custom-class', 'some-other-class'], + toolbar: [{ + name: 'bold', + action: EasyMDE.toggleBold, + className: 'fa fa-bolt', + title: 'Bold', + }, '|', { // Separator + name: 'alert', + action: (editor) => { + alert('This is from a custom button action!'); + // Custom functions have access to the `editor` instance. + }, + className: 'fa fa-star', + title: 'A Custom Button', + noDisable: undefined, + noMobile: false, + }, '|', { + name: 'link', + action: 'https://github.com/Ionaru/easy-markdown-editor', + className: 'fa fab fa-github', + title: 'A Custom Link', + noDisable: true, + noMobile: true, + }] +}); + +editor2.clearAutosavedValue(); diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 07e9d4c..d5ce507 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -100,6 +100,7 @@ declare namespace EasyMDE { lineWrapping?: boolean; parsingConfig?: ParsingOptions; placeholder?: string; + previewClass?: string | ReadonlyArray; previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string; promptURLs?: boolean; renderingConfig?: RenderingOptions;