mirror of
https://github.com/Ionaru/easy-markdown-editor
synced 2025-07-04 08:34:28 -06:00
Merge a50d716e9356e0b0ab3736fc30828bfed9bfba42 into 2996b67ec95ec69000ee03ccaee4fcca26cfc701
This commit is contained in:
commit
391fa346e0
@ -34,6 +34,30 @@ EasyMDE.toggleItalic = (editor: EasyMDE) => {
|
||||
console.log('SomeButtonOverride');
|
||||
};
|
||||
|
||||
console.log(editor.options.blockStyles.bold);
|
||||
console.log(editor.options.insertTexts.horizontalRule[0]);
|
||||
console.log(editor.options.minHeight);
|
||||
console.log(editor.options.parsingConfig.allowAtxHeaderWithoutSpace);
|
||||
console.log(editor.options.previewClass);
|
||||
console.log(editor.options.previewRender('Hello', document.body));
|
||||
console.log(editor.options.shortcuts.cleanBlock);
|
||||
console.log(editor.options.status);
|
||||
console.log(editor.options.toolbar);
|
||||
|
||||
console.log(editor.options.uploadImage);
|
||||
console.log(editor.options.imageMaxSize);
|
||||
console.log(editor.options.imageAccept);
|
||||
console.log(editor.options.imagePathAbsolute);
|
||||
console.log(editor.options.imageCSRFName);
|
||||
console.log(editor.options.imageCSRFHeader);
|
||||
console.log(editor.options.imageTexts.sbInit);
|
||||
console.log(editor.options.errorMessages.fileTooLarge);
|
||||
console.log(editor.options.errorCallback('Something went oops!'));
|
||||
|
||||
console.log(editor.options.promptTexts.image);
|
||||
|
||||
console.log(editor.options.direction);
|
||||
|
||||
const editor2 = new EasyMDE({
|
||||
autoDownloadFontAwesome: undefined,
|
||||
previewClass: ['my-custom-class', 'some-other-class'],
|
||||
|
29
types/easymde.d.ts
vendored
29
types/easymde.d.ts
vendored
@ -27,6 +27,8 @@ interface ArrayOneOrMore<T> extends Array<T> {
|
||||
0: T;
|
||||
}
|
||||
|
||||
type SetRequired<T, K extends keyof T> = Omit<T, K> & Required<Pick<T, K>>;
|
||||
|
||||
type ToolbarButton =
|
||||
'bold'
|
||||
| 'italic'
|
||||
@ -54,6 +56,32 @@ type ToolbarButton =
|
||||
| 'fullscreen'
|
||||
| 'guide';
|
||||
|
||||
interface InstanceOptions extends SetRequired<EasyMDE.Options, 'minHeight' |
|
||||
'parsingConfig' |
|
||||
'previewClass' |
|
||||
'previewRender' |
|
||||
'status' |
|
||||
'toolbar' |
|
||||
'uploadImage' |
|
||||
'imageMaxSize' |
|
||||
'imageAccept' |
|
||||
'imagePathAbsolute' |
|
||||
'imageCSRFName' |
|
||||
'imageCSRFHeader' |
|
||||
'errorCallback' |
|
||||
'direction'> {
|
||||
blockStyles: Required<EasyMDE.BlockStyleOptions>;
|
||||
insertTexts: Required<EasyMDE.InsertTextOptions>;
|
||||
shortcuts: {
|
||||
[P in keyof EasyMDE.Shortcuts]-?: NonNullable<EasyMDE.Shortcuts[P]>;
|
||||
};
|
||||
|
||||
imageTexts: Required<EasyMDE.ImageTextsOptions>;
|
||||
errorMessages: Required<EasyMDE.ImageErrorTextsOptions>;
|
||||
|
||||
promptTexts: Required<EasyMDE.PromptTexts>;
|
||||
}
|
||||
|
||||
declare namespace EasyMDE {
|
||||
|
||||
interface TimeFormatOptions {
|
||||
@ -247,6 +275,7 @@ declare class EasyMDE {
|
||||
value(val: string): void;
|
||||
|
||||
codemirror: CodeMirror.Editor;
|
||||
options: InstanceOptions;
|
||||
|
||||
cleanup(): void;
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user