-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsbx.d.ts
executable file
·165 lines (142 loc) · 4.37 KB
/
sbx.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
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
// Type definitions for Summernote v0.8.2
// Project: http://summernote.org/deep-dive/#initialization-options
// Definitions by: Wouter Staelens https://github.com/wstaelens/
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
interface SbxOptions {
airMode?: boolean;
buttons?: any;
callbacks?: any; // todo
codemirror?: CodemirrorOptions;
colors?: colorsDef;
dialogsInBody?: boolean;
dialogsFade?: boolean;
direction?: string;
disableDragAndDrop?: boolean;
focus?: boolean;
fontNames?: string[];
fontNamesIgnoreCheck?: string[];
height?: number;
hint?: HintOptions;
icons?: IconsOptions;
insertTableMaxSize?: InsertTableMaxSizeOptions;
keyMap?: KeyMapOptions;
lang?: string;
lineHeights?: string[];
minHeight?: number;
maxHeight?: number;
maximumImageFileSize?: any;
modules?: ModuleOptions;
popover?: PopoverOptions;
placeholder?: string;
shortcuts?: boolean;
styleTags?: styleTagsOptions[];
styleWithSpan?: boolean;
tabsize?: number;
tableClassName?: string;
textareaAutoSync?: boolean;
toolbar?: toolbarDef;
tooltip?: boolean;
width?: number;
}
// callbacks ?
// https://www.typescriptlang.org/docs/handbook/functions.html#writing-the-function-type
// type OptionsDef = {
// callbacks?: {
// [event: string]: () => void
// }
// };
type toolbarStyleGroupOptions = 'style' | 'bold' | 'italic' | 'underline' | 'clear';
type toolbarFontGroupOptions = 'strikethrough' | 'superscript' | 'subscript';
type toolbarFontsizeGroupOptions = 'fontsize';
type toolbarColorGroupOptions = 'color';
type toolbarParaGroupOptions = 'ul' | 'ol' | 'paragraph';
type toolbarHeightGroupOptions = 'height';
type toolbarTableGroupOptions = 'table';
type toolbarInsertGroupOptions = 'link' | 'picture' | 'hr';
type toolbarViewGroupOptions = 'fullscreen' | 'codeview';
type toolbarHelpGroupOptions = 'help';
type toolbarDef = [string, string[]][];
// type toolbarDef = [
// ['style', toolbarStyleGroupOptions[]]
// | ['font', toolbarFontGroupOptions[]]
// | ['fontsize', toolbarFontsizeGroupOptions[]]
// | ['color', toolbarColorGroupOptions[]]
// | ['para', toolbarParaGroupOptions[]]
// | ['height', toolbarHeightGroupOptions[]]
// | ['table', toolbarTableGroupOptions[]]
// | ['insert', toolbarInsertGroupOptions[]]
// | ['view', toolbarViewGroupOptions[]]
// | ['help', toolbarHelpGroupOptions[]]
// ];
type colorsDef = [string[]][];
type styleTagsOptions = 'p' | 'blockquote' | 'pre' | 'h1' | 'h2' | 'h3' | 'h4' | 'h5' | 'h6';
interface InsertTableMaxSizeOptions {
col: number;
row: number;
}
interface IconsOptions {
options?: any; // todo
}
interface KeyMapOptions {
pc?: KeyMapPcOptions;
mac?: KeyMapMacOptions;
}
interface KeyMapPcOptions {
options?: any; // todo
}
interface KeyMapMacOptions {
options?: any; // todo
}
interface HintOptions {
words?: string[];
mentions?: string[];
match: RegExp;
search: Function;
template?: Function;
content?: Function;
}
interface CodemirrorOptions {
mode?: string;
htmlNode?: boolean;
lineNumbers?: boolean;
theme?: string;
}
type popoverImageOptionsImagesize = 'imageSize100' | 'imageSize50' | 'imageSize25';
type popoverImageOptionsFloat = 'floatLeft' | 'floatRight' | 'floatNone';
type popoverImageOptionsRemove = 'removeMedia';
type popoverImageDef = [
['imagesize', popoverImageOptionsImagesize[]],
['float', popoverImageOptionsFloat[]],
['remove', popoverImageOptionsRemove[]]
];
type popoverLinkLinkOptions = 'linkDialogShow' | 'unlink';
type popoverLinkDef = [
['link', popoverLinkLinkOptions[]]
];
type popoverAirOptionsColor = 'color';
type popoverAirOptionsFont = 'bold' | 'underline' | 'clear';
type popoverAirOptionsPara = 'ul' | 'paragraph';
type popoverAirOptionsTable = 'table';
type popoverAirOptionsInsert = 'link' | 'picture';
type popoverAirDef = [
['color', popoverAirOptionsColor],
['font', popoverAirOptionsFont],
['para', popoverAirOptionsPara],
['table', popoverAirOptionsTable],
['insert', popoverAirOptionsInsert]
];
interface PopoverOptions {
image?: popoverImageDef;
link?: popoverLinkDef;
air?: popoverAirDef;
}
interface ModuleOptions {
options?: any; // todo
}
interface CreateLinkOptions {
text: string;
url: string;
newWindow: boolean;
}
declare module 'sbxangular' {
}