-
Notifications
You must be signed in to change notification settings - Fork 89
/
shared.d.ts
95 lines (95 loc) · 2.28 KB
/
shared.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
export declare enum SkinTone {
Default = 0,
Light = 1,
MediumLight = 2,
Medium = 3,
MediumDark = 4,
Dark = 5
}
export interface NativeEmoji {
annotation: string;
emoticon?: string;
group: number;
name: string;
order: number;
shortcodes?: string[];
tags?: string[];
version: number;
unicode: string;
skins?: EmojiSkin[];
}
export interface EmojiSkin {
tone: SkinTone;
unicode: string;
version: number;
}
export interface DatabaseConstructorOptions {
dataSource?: string;
locale?: string;
customEmoji?: CustomEmoji[];
}
export interface PickerConstructorOptions {
dataSource?: string;
locale?: string;
i18n?: I18n;
skinToneEmoji?: string;
customEmoji?: CustomEmoji[];
customCategorySorting?: (a: string, b: string) => number;
emojiVersion?: number;
}
export interface I18n {
emojiUnsupportedMessage: string;
loadingMessage: string;
networkErrorMessage: string;
regionLabel: string;
searchLabel: string;
skinToneLabel: string;
searchResultsLabel: string;
categoriesLabel: string;
categories: I18nCategories;
skinTonesLabel: string;
skinTones: string[];
searchDescription: string;
skinToneDescription: string;
favoritesLabel: string;
}
export interface I18nCategories {
custom: string;
'smileys-emotion': string;
'people-body': string;
'animals-nature': string;
'food-drink': string;
'travel-places': string;
activities: string;
objects: string;
symbols: string;
flags: string;
}
export interface EmojiClickEventDetail {
emoji: Emoji;
skinTone: SkinTone;
unicode?: string;
name?: string;
}
export interface SkinToneChangeEventDetail {
skinTone: SkinTone;
}
declare type Modify<T, R> = Omit<T, keyof R> & R;
export declare type EmojiClickEvent = Modify<UIEvent, {
detail: EmojiClickEventDetail;
}>;
export declare type SkinToneChangeEvent = Modify<UIEvent, {
detail: SkinToneChangeEventDetail;
}>;
export interface EmojiPickerEventMap {
"emoji-click": EmojiClickEvent;
"skin-tone-change": SkinToneChangeEvent;
}
export interface CustomEmoji {
name: string;
shortcodes?: string[];
url: string;
category?: string;
}
export declare type Emoji = NativeEmoji | CustomEmoji;
export {};