forked from DefinitelyTyped/DefinitelyTyped
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quill.d.ts
119 lines (83 loc) · 3.6 KB
/
quill.d.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
// Type definitions for Quill
// Project: http://quilljs.com
// Definitions by: Sumit <https://github.com/sumitkm>
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
///<reference path="../eventemitter2/eventemitter2.d.ts" />
declare interface DeltaStatic{
ops? : Array<any>;
retain?: any,
delete?: any,
insert?: any,
attributes?: any
}
declare interface RangeStatic{
new(): RangeStatic;
start: number;
end: number;
}
declare interface QuillStatic {
new(selector: string, options?: Object):QuillStatic;
on(eventName: string, callback: (delta: DeltaStatic, source: string) => void): EventEmitter2;
addModule(id: string, options: any) : Object;
getText(): string;
getText(start: number): string;
getText(start: number, end: number): string;
getLength(): number;
getContents(): DeltaStatic;
getContents(start: number): DeltaStatic;
getContents(start: number, end: number): DeltaStatic;
getHTML(): string;
insertText(index: number, text: string): void;
insertText(index: number, text: string, name: string, value: string): void;
insertText(index: number, text: string, formats: any): void;
insertText(index: number, text: string, source: string) : void;
insertText(index: number, text: string, name: string, value: string, source: string): void;
insertText(index: number, text: string, formats: any, source: string): void;
deleteText(start: number, end: number): void;
deleteText(start: number, end: number, source: string): void;
formatText(start: number, end: number): void;
formatText(start: number, end: number, name: string, value: boolean): void;
formatText(start: number, end: number, formats: any): void;
formatText(start: number, end: number, source: string): void;
formatText(start: number, end: number, name: string, value: string, source: string): void;
formatText(start: number, end: number, formats: string, source: string): void;
formatLine(start: number, end: number): void;
formatLine(start: number, end: number, name: string, value: boolean): void;
formatLine(start: number, end: number, formats: any): void;
formatLine(start: number, end: number, source: string): void;
formatLine(start: number, end: number, name: string, value: string, source: string): void;
formatLine(start: number, end: number, formats: any, source: string): void;
insertEmbed(index: number, type: string, url: string): void;
insertEmbed(index: number, type: string, url: string, source: string): void;
updateContents(delta: DeltaStatic): void;
setContents(delta: DeltaStatic): void;
setHTML(html: string): void;
setText(text: string): void;
getSelection(): RangeStatic;
setSelection(start: number, end: number): void;
setSelection(start: number, end: number, source: string): void;
setSelection(range: RangeStatic): void;
setSelection(range: RangeStatic, source: string): void;
prepareFormat(format: string, value: boolean): void;
focus(): void;
getBounds(index: number): any;
registerModule(name: string, callback: (quill: QuillStatic, options: any) => {}): any;
addModule(name: string, options: any): any;
getModule(name: string): any;
onModuleLoad(name: string, callback: (input: any) => {}): void;
addFormat(name: string, config: any): void;
addContainer(cssClass: string, before?: number): HTMLDivElement;
}
declare module "Range"
{
var Range: RangeStatic;
export = Range;
}
declare var Delta: DeltaStatic;
declare module "Delta"{
export = Delta;
}
declare var Quill: QuillStatic;
declare module "Quill" {
export = Quill;
}