2022-01-18 14:06:16 +00:00
|
|
|
export const unicodeEmojiCategories = ['face', 'people', 'animals_and_nature', 'food_and_drink', 'activity', 'travel_and_places', 'objects', 'symbols', 'flags'] as const;
|
|
|
|
|
|
|
|
export type UnicodeEmojiDef = {
|
2019-09-21 12:31:38 +00:00
|
|
|
name: string;
|
|
|
|
keywords: string[];
|
|
|
|
char: string;
|
2022-01-18 14:06:16 +00:00
|
|
|
category: typeof unicodeEmojiCategories[number];
|
|
|
|
}
|
|
|
|
|
|
|
|
// initial converted from https://github.com/muan/emojilib/commit/242fe68be86ed6536843b83f7e32f376468b38fb
|
2022-07-13 12:17:19 +00:00
|
|
|
import _emojilist from '../emojilist.json';
|
|
|
|
|
2022-07-13 12:39:16 +00:00
|
|
|
export const emojilist = _emojilist as UnicodeEmojiDef[];
|
2022-12-25 06:52:52 +00:00
|
|
|
|
|
|
|
export function getEmojiName(char: string): string | undefined {
|
|
|
|
return emojilist.find(emo => emo.char === char)?.name;
|
|
|
|
}
|