Add typings for features added in #143 and #139

pull/145/head
Jeroen Akkerman 4 years ago
parent bb3c5cd539
commit 95b177e25c

@ -5,6 +5,7 @@ const editor = new EasyMDE({
autoDownloadFontAwesome: false,
element: document.getElementById('mdEditor')!,
hideIcons: ['side-by-side', 'fullscreen'],
inputStyle: 'textarea',
shortcuts: {
drawTable: 'Cmd-Alt-T',
toggleFullScreen: null
@ -36,6 +37,8 @@ EasyMDE.toggleItalic = (editor: EasyMDE) => {
const editor2 = new EasyMDE({
autoDownloadFontAwesome: undefined,
previewClass: ['my-custom-class', 'some-other-class'],
nativeSpellcheck: true,
inputStyle: 'contenteditable',
toolbar: [
{
name: 'bold',
@ -136,3 +139,12 @@ const editorImagesCustom = new EasyMDE({
},
syncSideBySidePreviewScroll: true
});
const editorAutosave = new EasyMDE({
autosave: {
enabled: true,
delay: 2000,
submit_delay: 10000,
uniqueId: 'abc',
}
});

@ -26,6 +26,7 @@ declare namespace EasyMDE {
interface AutoSaveOptions {
enabled?: boolean;
delay?: number;
submit_delay?: number;
uniqueId: string;
}
@ -132,10 +133,12 @@ declare namespace EasyMDE {
shortcuts?: Shortcuts;
showIcons?: ReadonlyArray<string>;
spellChecker?: boolean;
inputStyle?: 'textarea' | 'contenteditable';
nativeSpellcheck?: boolean;
status?: boolean | ReadonlyArray<string | StatusBarItem>;
styleSelectedText?: boolean;
tabSize?: number;
toolbar?: boolean | ReadonlyArray<string | ToolbarIcon>;
toolbar?: boolean | ReadonlyArray<'|' | ToolbarIcon>;
toolbarTips?: boolean;
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
theme?: string;

Loading…
Cancel
Save