forked from zenoamaro/react-quill
-
Notifications
You must be signed in to change notification settings - Fork 0
/
types.d.ts
95 lines (87 loc) · 2.71 KB
/
types.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
import * as React from "react";
import * as Quill from "quill";
declare namespace ReactQuill {
export interface UnprivilegedEditor {
getLength(): number;
getText(index?: number, length?: number): string;
getHTML(): string;
getBounds(index: number, length?: number): Quill.BoundsStatic;
getSelection(focus?: boolean): Quill.RangeStatic;
getContents(index?: number, length?: number): Quill.DeltaStatic;
}
export interface ComponentProps {
id?: string;
className?: string;
theme?: string;
style?: React.CSSProperties;
readOnly?: boolean;
value?: string | Quill.Delta;
defaultValue?: string | Quill.Delta;
placeholder?: string;
tabIndex?: number;
bounds?: string | HTMLElement;
scrollingContainer?: string | HTMLElement;
onChange?: (
content: string,
delta: Quill.Delta,
source: Quill.Sources,
editor: UnprivilegedEditor
) => void;
onChangeSelection?: (
range: Quill.RangeStatic,
source: Quill.Sources,
editor: UnprivilegedEditor
) => void;
onFocus?: (
range: Quill.RangeStatic,
source: Quill.Sources,
editor: UnprivilegedEditor
) => void;
onBlur?: (
previousRange: Quill.RangeStatic,
source: Quill.Sources,
editor: UnprivilegedEditor
) => void;
onKeyPress?: React.EventHandler<any>;
onKeyDown?: React.EventHandler<any>;
onKeyUp?: React.EventHandler<any>;
formats?: string[];
children?: React.ReactElement<any>;
modules?: Quill.StringMap;
/** @deprecated
* The `toolbar` prop has been deprecated. Use `modules.toolbar` instead.
* See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100.
* */
toolbar?: never;
/** @deprecated
* The `styles` prop has been deprecated. Use custom stylesheets instead.
* See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100
*/
styles?: never;
/**
* @deprecated
* The `pollInterval` property does not have any effect anymore.
* You can safely remove it from your props.
* See: https://github.com/zenoamaro/react-quill#upgrading-to-react-quill-v100.
*/
pollInterval?: never;
}
export interface Mixin {
createEditor(
element: HTMLElement,
config: Quill.QuillOptionsStatic
): Quill.Quill;
hookEditor(editor: Quill.Quill): void;
unhookEditor(editor: Quill.Quill): void;
setEditorReadOnly(editor: Quill.Quill, value: boolean): void;
setEditorContents(editor: Quill.Quill, value: Quill.Delta | string): void;
setEditorSelection(editor: Quill.Quill, range: Quill.RangeStatic): void;
makeUnprivilegedEditor(editor: Quill.Quill): UnprivilegedEditor;
}
}
export default class ReactQuill extends React.Component<ReactQuill.ComponentProps> {
focus(): void;
blur(): void;
getEditor(): Quill.Quill;
}
export { Quill } from "quill";