Merge pull request #21913 from 43081j/quill-fixes

quill: add scroll and getBounds definition
This commit is contained in:
Arthur Ozga
2017-12-04 17:30:25 -08:00
committed by GitHub
3 changed files with 18 additions and 0 deletions

View File

@@ -2,8 +2,11 @@
// Project: https://github.com/quilljs/quill/
// Definitions by: Sumit <https://github.com/sumitkm>
// Guillaume <https://github.com/guillaume-ro-fr>
// James Garbutt <https://github.com/43081j>
// 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;

6
types/quill/package.json Normal file
View File

@@ -0,0 +1,6 @@
{
"private": true,
"dependencies": {
"parchment": "^1.1.2"
}
}

View File

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