mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 14:57:10 +00:00
Merge pull request #26698 from AnielloFalcone/master
Added range case for formatText method and Keyboard module in QuillJs types
This commit is contained in:
Vendored
+4
@@ -3,6 +3,7 @@
|
||||
// Definitions by: Sumit <https://github.com/sumitkm>
|
||||
// Guillaume <https://github.com/guillaume-ro-fr>
|
||||
// James Garbutt <https://github.com/43081j>
|
||||
// Aniello Falcone <https://github.com/AnielloFalcone>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
import { Blot } from 'parchment/dist/src/blot/abstract/blot';
|
||||
@@ -142,6 +143,7 @@ export class Quill implements EventEmitter {
|
||||
root: HTMLDivElement;
|
||||
clipboard: ClipboardStatic;
|
||||
scroll: Blot;
|
||||
keyboard: KeyboardStatic;
|
||||
constructor(container: string | Element, options?: QuillOptionsStatic);
|
||||
deleteText(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
disable(): void;
|
||||
@@ -173,6 +175,8 @@ export class Quill implements EventEmitter {
|
||||
formatText(index: number, length: number, source?: Sources): DeltaStatic;
|
||||
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;
|
||||
|
||||
@@ -79,6 +79,21 @@ function test_formatText2() {
|
||||
});
|
||||
}
|
||||
|
||||
function test_formatText3() {
|
||||
const quillEditor = new Quill('#editor');
|
||||
const range = {index: 0, length: 5};
|
||||
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');
|
||||
|
||||
Reference in New Issue
Block a user