Added typings for new option

pull/100/head
Jeroen Akkerman 5 years ago
parent 71170a7eef
commit 7cfeb37257

@ -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();

@ -100,6 +100,7 @@ declare namespace EasyMDE {
lineWrapping?: boolean;
parsingConfig?: ParsingOptions;
placeholder?: string;
previewClass?: string | ReadonlyArray<string>;
previewRender?: (markdownPlaintext: string, previewElement: HTMLElement) => string;
promptURLs?: boolean;
renderingConfig?: RenderingOptions;

Loading…
Cancel
Save