From 4a1e6de4decb2877be5ce8dbb1ecbf6de6f41304 Mon Sep 17 00:00:00 2001 From: Jeroen Akkerman Date: Fri, 20 Mar 2020 14:35:24 +0100 Subject: [PATCH] Add typings for options added in PR #170 --- types/easymde-test.ts | 9 ++++++++- types/easymde.d.ts | 8 ++++++++ 2 files changed, 16 insertions(+), 1 deletion(-) diff --git a/types/easymde-test.ts b/types/easymde-test.ts index 63cfb1d..7c1c4c7 100644 --- a/types/easymde-test.ts +++ b/types/easymde-test.ts @@ -161,7 +161,7 @@ const editorImagesCustom = new EasyMDE({ image: 'Insert URL' }, syncSideBySidePreviewScroll: true - }); +}); const editorAutosave = new EasyMDE({ autosave: { @@ -169,5 +169,12 @@ const editorAutosave = new EasyMDE({ delay: 2000, submit_delay: 10000, uniqueId: 'abc', + timeFormat: { + locale: 'en-GB', + format: { + month: 'long', + } + }, + text: 'Stored: ', } }); diff --git a/types/easymde.d.ts b/types/easymde.d.ts index 0ef9e53..d77e5f8 100644 --- a/types/easymde.d.ts +++ b/types/easymde.d.ts @@ -46,11 +46,19 @@ type ToolbarButton = | 'guide'; declare namespace EasyMDE { + + interface TimeFormatOptions { + locale?: string | string[]; + format?: Intl.DateTimeFormatOptions; + } + interface AutoSaveOptions { enabled?: boolean; delay?: number; submit_delay?: number; uniqueId: string; + timeFormat?: TimeFormatOptions; + text?: string; } interface BlockStyleOptions {