Auto-format of `types` folder.

pull/67/head
Jeroen Akkerman 5 years ago
parent df530cf465
commit c1a695af51

@ -1,14 +1,16 @@
// Create new instance // Create new instance
const editor = new EasyMDE({ const editor = new EasyMDE({
autoDownloadFontAwesome: false, autoDownloadFontAwesome: false,
element: document.getElementById("mdEditor")!, element: document.getElementById('mdEditor')!,
hideIcons: ["side-by-side", "fullscreen"], hideIcons: ['side-by-side', 'fullscreen'],
shortcuts: { shortcuts: {
drawTable: "Cmd-Alt-T", drawTable: 'Cmd-Alt-T',
toggleFullScreen: null toggleFullScreen: null
}, },
spellChecker: false, spellChecker: false,
onToggleFullScreen: (full: boolean) => { console.log('FullscreenToggled', full); }, onToggleFullScreen: (full: boolean) => {
console.log('FullscreenToggled', full);
},
theme: 'someOtherTheme', theme: 'someOtherTheme',
}); });
@ -23,4 +25,6 @@ const fullscreen = editor.isFullscreenActive() as boolean;
editor.codemirror.setOption('readOnly', true); editor.codemirror.setOption('readOnly', true);
// Static properties // Static properties
EasyMDE.toggleItalic = (editor: EasyMDE) => { console.log('SomeButtonOverride'); }; EasyMDE.toggleItalic = (editor: EasyMDE) => {
console.log('SomeButtonOverride');
};

14
types/easymde.d.ts vendored

@ -54,6 +54,7 @@ declare namespace EasyMDE {
interface Shortcuts { interface Shortcuts {
[action: string]: string | undefined | null; [action: string]: string | undefined | null;
toggleBlockquote?: string | null; toggleBlockquote?: string | null;
toggleBold?: string | null; toggleBold?: string | null;
cleanBlock?: string | null; cleanBlock?: string | null;
@ -78,7 +79,7 @@ declare namespace EasyMDE {
interface ToolbarIcon { interface ToolbarIcon {
name: string; name: string;
action: string|((editor: EasyMDE) => void); action: string | ((editor: EasyMDE) => void);
className: string; className: string;
title: string; title: string;
} }
@ -103,10 +104,10 @@ declare namespace EasyMDE {
shortcuts?: Shortcuts; shortcuts?: Shortcuts;
showIcons?: ReadonlyArray<string>; showIcons?: ReadonlyArray<string>;
spellChecker?: boolean; spellChecker?: boolean;
status?: boolean|ReadonlyArray<string|StatusBarItem>; status?: boolean | ReadonlyArray<string | StatusBarItem>;
styleSelectedText?: boolean; styleSelectedText?: boolean;
tabSize?: number; tabSize?: number;
toolbar?: boolean|ReadonlyArray<string|ToolbarIcon>; toolbar?: boolean | ReadonlyArray<string | ToolbarIcon>;
toolbarTips?: boolean; toolbarTips?: boolean;
onToggleFullScreen?: (goingIntoFullScreen: boolean) => void; onToggleFullScreen?: (goingIntoFullScreen: boolean) => void;
theme?: string; theme?: string;
@ -115,13 +116,20 @@ declare namespace EasyMDE {
declare class EasyMDE { declare class EasyMDE {
constructor(options?: EasyMDE.Options); constructor(options?: EasyMDE.Options);
value(): string; value(): string;
value(val: string): void; value(val: string): void;
codemirror: CodeMirror.Editor; codemirror: CodeMirror.Editor;
toTextArea(): void; toTextArea(): void;
isPreviewActive(): boolean; isPreviewActive(): boolean;
isSideBySideActive(): boolean; isSideBySideActive(): boolean;
isFullscreenActive(): boolean; isFullscreenActive(): boolean;
clearAutosavedValue(): void; clearAutosavedValue(): void;
static toggleBold: (editor: EasyMDE) => void; static toggleBold: (editor: EasyMDE) => void;

Loading…
Cancel
Save