From 8d36dce6aaee0b1a3440dc1322eaa4c05822ec0f Mon Sep 17 00:00:00 2001 From: Aniello Falcone Date: Thu, 21 Jun 2018 11:27:31 +0200 Subject: [PATCH] Added another formatText case and new test for it --- types/quill/index.d.ts | 1 + types/quill/quill-tests.ts | 9 +++++++++ 2 files changed, 10 insertions(+) diff --git a/types/quill/index.d.ts b/types/quill/index.d.ts index e4b11ca64e..afbdfa9222 100644 --- a/types/quill/index.d.ts +++ b/types/quill/index.d.ts @@ -176,6 +176,7 @@ export class Quill implements EventEmitter { formatText(index: number, length: number, format: string, value: any, source?: Sources): DeltaStatic; formatText(index: number, length: number, formats: StringMap, source?: Sources): DeltaStatic; formatText(range: RangeStatic, format: string, value: any, source?: Sources): DeltaStatic; + formatText(range: RangeStatic, formats: StringMap, source?: Sources): DeltaStatic; getFormat(range?: RangeStatic): StringMap; getFormat(index: number, length?: number): StringMap; removeFormat(index: number, length: number, source?: Sources): DeltaStatic; diff --git a/types/quill/quill-tests.ts b/types/quill/quill-tests.ts index a648cfa082..d0bc3a2189 100644 --- a/types/quill/quill-tests.ts +++ b/types/quill/quill-tests.ts @@ -85,6 +85,15 @@ function test_formatText3() { quillEditor.formatText(range, 'bold', true); } +function test_formatText4() { + const quillEditor = new Quill('#editor'); + const range = {index: 0, length: 5}; + quillEditor.formatText(range, { + bold: false, + color: 'rgb(0, 0, 255)' + }); +} + function test_formatLine1() { const quillEditor = new Quill('#editor'); quillEditor.formatLine(1, 3, 'api');