mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-06-05 14:59:37 +08:00
Merge pull request #21913 from 43081j/quill-fixes
quill: add scroll and getBounds definition
This commit is contained in:
6
types/quill/index.d.ts
vendored
6
types/quill/index.d.ts
vendored
@@ -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
6
types/quill/package.json
Normal file
@@ -0,0 +1,6 @@
|
||||
{
|
||||
"private": true,
|
||||
"dependencies": {
|
||||
"parchment": "^1.1.2"
|
||||
}
|
||||
}
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user