Add toolbar button attributes to type declaration

pull/388/head
Jeroen Akkerman 2 years ago
parent 98d9049728
commit 4ddb5b8e1b

@ -59,6 +59,9 @@ const editor2 = new EasyMDE({
title: 'A Custom Button',
noDisable: undefined,
noMobile: false,
attributes: {
'data-custom': 'attribute',
}
},
'|',
{
@ -89,6 +92,10 @@ const editor2 = new EasyMDE({
action: EasyMDE.toggleBold,
className: 'fa fas fa-bold',
title: 'Bold',
attributes: {
'data-custom': 'some value',
'data-custom-2': 'another value',
}
},
],
},

@ -74,6 +74,10 @@ declare namespace EasyMDE {
italic?: string;
}
interface CustomAttributes {
[key: string]: string;
}
interface InsertTextOptions {
horizontalRule?: ReadonlyArray<string>;
image?: ReadonlyArray<string>;
@ -142,6 +146,7 @@ declare namespace EasyMDE {
noDisable?: boolean;
noMobile?: boolean;
icon?: string;
attributes?: CustomAttributes;
}
interface ImageTextsOptions {

Loading…
Cancel
Save