forked from kkfor/for-editor
-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.d.ts
89 lines (87 loc) · 1.87 KB
/
index.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
import * as React from 'react'
export interface IToolbar {
h1?: boolean
h2?: boolean
h3?: boolean
h4?: boolean
img?: boolean
link?: boolean
code?: boolean
preview?: boolean
expand?: boolean
undo?: boolean
redo?: boolean
save?: boolean
subfield?: boolean
}
export interface IWords {
placeholder?: string
h1?: string
h2?: string
h3?: string
h4?: string
undo?: string
redo?: string
img?: string
link?: string
code?: string
save?: string
preview?: string
singleColumn?: string
doubleColumn?: string
fullscreenOn?: string
fullscreenOff?: string
addImgLink?: string
addImg?: string
}
interface IP {
value?: string
lineNum?: number
onChange?: (value: string) => void
onSave?: (value: string) => void
placeholder?: string
fontSize?: string
disabled?: boolean
style?: object
height?: string
preview?: boolean
expand?: boolean
subfield?: boolean
toolbar?: IToolbar
language?: string
addImg?: (file: File, index: number) => void
}
interface IS {
preview: boolean
expand: boolean
subfield: boolean
history: string[]
historyIndex: number
lineIndex: number
value: string
words: IWords
}
declare class MdEditor extends React.Component<IP, IS> {
static defaultProps: {
lineNum: boolean
onChange: () => void
onSave: () => void
addImg: () => void
fontSize: string
disabled: boolean
preview: boolean
expand: boolean
subfield: boolean
style: {}
toolbar: IToolbar
language: string
};
$img2Url: (name: string, url: string) => void;
private $vm;
private $scrollEdit;
private $scrollPreview;
private $blockEdit;
private $blockPreview;
private currentTimeout;
}
export default MdEditor