From 4fd50955f039a6722fe6cceb4b198d0db0155aa5 Mon Sep 17 00:00:00 2001 From: Alec Gibson <12036746+alecgibson@users.noreply.github.com> Date: Fri, 3 Feb 2023 16:10:06 +0000 Subject: [PATCH] =?UTF-8?q?=F0=9F=8F=B7=EF=B8=8F=20Add=20overload=20for=20?= =?UTF-8?q?`Clipboard.dangerouslyPasteHTML()`?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit `Clipboard.dangerouslyPasteHTML()` is allowed to be called without an index as its first argument. At the moment, doing this results in a compilation error: ``` (method) Clipboard.dangerouslyPasteHTML(index: number, html: string, source?: EmitterSource): void Expected 2-3 arguments, but got 1.ts(2554) ``` This change adds the overload to allow this. --- modules/clipboard.ts | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/clipboard.ts b/modules/clipboard.ts index 176bf92db7..af9a022732 100644 --- a/modules/clipboard.ts +++ b/modules/clipboard.ts @@ -130,9 +130,15 @@ class Clipboard extends Module { ); } + dangerouslyPasteHTML(html: string, source?: EmitterSource): void; dangerouslyPasteHTML( index: number, html: string, + source?: EmitterSource, + ): void; + dangerouslyPasteHTML( + index: number | string, + html: string, source: EmitterSource = Quill.sources.API, ) { if (typeof index === 'string') {