diff --git a/types/easymde-test.ts b/types/easymde-test.ts index 5a269c3..dc0ec74 100644 --- a/types/easymde-test.ts +++ b/types/easymde-test.ts @@ -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', + } }, ], }, diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 02f06c8..e08a9ab 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -74,6 +74,10 @@ declare namespace EasyMDE { italic?: string; } + interface CustomAttributes { + [key: string]: string; + } + interface InsertTextOptions { horizontalRule?: ReadonlyArray; image?: ReadonlyArray; @@ -142,6 +146,7 @@ declare namespace EasyMDE { noDisable?: boolean; noMobile?: boolean; icon?: string; + attributes?: CustomAttributes; } interface ImageTextsOptions {