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');