From a2fab1285d1ad43c438b5574226679e3ef40a090 Mon Sep 17 00:00:00 2001 From: ewwwwwwww Date: Mon, 4 Jul 2022 21:03:09 -0700 Subject: [PATCH] fix types --- app/soapbox/features/emoji/search.ts | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/app/soapbox/features/emoji/search.ts b/app/soapbox/features/emoji/search.ts index 339debced..aeb3830f0 100644 --- a/app/soapbox/features/emoji/search.ts +++ b/app/soapbox/features/emoji/search.ts @@ -2,9 +2,8 @@ import { Index } from 'flexsearch'; import data from './data'; -import { Emoji as EmojiType } from './index'; - -import type { Emoji, CustomEmoji } from 'emoji-mart'; +import type { Emoji } from './index'; +import type { Emoji as EmojiMart, CustomEmoji } from 'emoji-mart'; const index = new Index({ tokenize: 'forward', @@ -19,7 +18,7 @@ export interface searchOptions { maxResults?: number; } -export const addCustomToPool = (customEmojis: Emoji[]) => { +export const addCustomToPool = (customEmojis: EmojiMart[]) => { let i = 0; for (const emoji of customEmojis) { @@ -27,7 +26,7 @@ export const addCustomToPool = (customEmojis: Emoji[]) => { } }; -const search = (str: string, options: searchOptions, custom_emojis: any): EmojiType[] => { +const search = (str: string, options: searchOptions, custom_emojis: any): Emoji[] => { return index.search(str, options.maxResults) .flatMap(id => { if (Number.isInteger(id)) {