-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathindex.d.ts
173 lines (145 loc) · 3.92 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
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
166
167
168
169
170
171
172
173
export as namespace EmojiPicker;
export = EmojiPicker;
declare namespace EmojiPicker {
export class EmojiPicker {
// Constructor Function
constructor(options?: EmojiPicker.Options);
// on event listener
on(event: Event, callback: (selection: EmojiSelection) => void): void;
// off event listener
off(event: Event, callback: (selection: EmojiSelection) => void): void;
// returns an emoji from twemoji based on an emoji input
getEmoji(emoji: String): Object;
// takes in html string and parses it together with the emoji
parse(htmlString: String): String;
// hidePicker function
hidePicker(): void;
// destroyPicker function
destroyPicker(): void;
// showPicker function
showPicker(referenceEl: HTMLElement): void;
// togglePicker function
togglePicker(referenceEl: HTMLElement): void;
// isPickerVisible function
isPickerVisible(): boolean;
// setTheme function
setTheme(theme: EmojiTheme): void;
}
export interface Options {
position?: Placement | FixedPosition;
autoHide?: boolean;
autoFocusSearch?: boolean;
showAnimation?: boolean;
showPreview?: boolean;
showSearch?: boolean;
showRecents?: boolean;
showVariants?: boolean;
showCategoryButtons?: boolean;
recentsCount?: number;
emojiVersion?: EmojiVersion;
i18n?: I18NStrings;
zIndex?: number;
boxShadow?: string | 'none';
theme?: EmojiTheme;
categories?: Category[];
style?: EmojiStyle;
twemojiBaseUrl?: string;
emojisPerRow?: number;
rows?: number;
emojiSize?: string;
initialCategory?: Category | 'recents';
custom?: CustomEmoji[];
plugins?: Plugin[];
icons?: Icons;
rootElement?: HTMLElement;
}
export interface TwemojiOptions {
base?: string,
ext: string,
folder: string
}
export interface FixedPosition {
top?: string;
bottom?: string;
left?: string;
right?: string;
}
export interface Plugin {
render(picker: EmojiPicker): HTMLElement;
destroy?(): void;
}
export interface EmojiSelection {
custom?: boolean;
emoji?: string;
url?: string;
}
export interface CustomEmoji {
name: string;
emoji: string;
}
export type EmojiStyle = 'native' | 'twemoji';
export type EmojiTheme = 'dark' | 'light' | 'auto';
export type Event = 'emoji' | 'hidden';
export type Placement =
| 'auto'
| 'auto-start'
| 'auto-end'
| 'top'
| 'top-start'
| 'top-end'
| 'bottom'
| 'bottom-start'
| 'bottom-end'
| 'right'
| 'right-start'
| 'right-end'
| 'left'
| 'left-start'
| 'left-end';
export type EmojiVersion =
| '1.0'
| '2.0'
| '3.0'
| '4.0'
| '5.0'
| '11.0'
| '12.0'
| '12.1';
export type Category =
| 'smileys'
| 'people'
| 'animals'
| 'food'
| 'activities'
| 'travel'
| 'objects'
| 'symbols'
| 'flags';
export type I18NCategory =
| 'recents'
| 'smileys'
| 'people'
| 'animals'
| 'food'
| 'activities'
| 'travel'
| 'objects'
| 'symbols'
| 'flags'
| 'custom';
export interface I18NStrings {
search: string;
categories: {
[key in I18NCategory]: string;
};
notFound: string;
}
export interface Icons {
search?: string;
clearSearch?: string;
categories?: {
[key in I18NCategory]?: string;
};
notFound?: string;
}
}