diff --git a/types/quill/index.d.ts b/types/quill/index.d.ts index 6325913519..7cad5330a2 100644 --- a/types/quill/index.d.ts +++ b/types/quill/index.d.ts @@ -2,8 +2,11 @@ // Project: https://github.com/quilljs/quill/ // Definitions by: Sumit // Guillaume +// James Garbutt // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped +import { Blot } from 'parchment/src/blot/abstract/blot'; + /** * A stricter type definition would be: * @@ -56,7 +59,9 @@ export interface QuillOptionsStatic { } export interface BoundsStatic { + bottom: number; left: number; + right: number; top: number; height: number; width: number; @@ -136,6 +141,7 @@ export class Quill implements EventEmitter { */ root: HTMLDivElement; clipboard: ClipboardStatic; + scroll: Blot; constructor(container: string | Element, options?: QuillOptionsStatic); deleteText(index: number, length: number, source?: Sources): DeltaStatic; disable(): void; diff --git a/types/quill/package.json b/types/quill/package.json new file mode 100644 index 0000000000..85d0ed05d1 --- /dev/null +++ b/types/quill/package.json @@ -0,0 +1,6 @@ +{ + "private": true, + "dependencies": { + "parchment": "^1.1.2" + } +} diff --git a/types/quill/quill-tests.ts b/types/quill/quill-tests.ts index 142c821ffa..f907092ed1 100644 --- a/types/quill/quill-tests.ts +++ b/types/quill/quill-tests.ts @@ -1,4 +1,5 @@ import { Quill, Delta, DeltaStatic, RangeStatic, StringMap } from 'quill'; +import { Blot } from 'parchment/src/blot/abstract/blot'; function test_quill() { const quillEditor = new Quill('#editor', { @@ -10,6 +11,11 @@ function test_quill() { }); } +function test_scroll() { + const quillEditor = new Quill('#editor'); + const blot: Blot = quillEditor.scroll; +} + function test_deleteText() { const quillEditor = new Quill('#editor'); quillEditor.deleteText(0, 10);