Skip to content

armgit / zulip

Public Imported from GitHub
0

Zulip server and web application. Open-source team chat that helps teams stay productive and focused.

typeahead: Add Flow types for get_emoji_matcher and sort_emojis.

Austin Riba27494b8b500f
diff --git a/static/shared/js/typeahead.js.flow b/static/shared/js/typeahead.js.flow
index 9486610f53c..04238362f51 100644
--- a/static/shared/js/typeahead.js.flow
+++ b/static/shared/js/typeahead.js.flow
@@ -1,5 +1,7 @@
// @flow strict
+export type Emoji = {emoji_name: string, emoji_code: string, ...};
+
// declare export var popular_emojis
declare export function remove_diacritics(s: string): string;
@@ -8,8 +10,13 @@ declare export function remove_diacritics(s: string): string;
// declare export function clean_query_lowercase
-// declare export function get_emoji_matcher
+declare export function get_emoji_matcher(
+ query: string,
+): (emoji: Emoji) => boolean;
// declare export function triage
-// declare export function sort_emojis
+declare export function sort_emojis<E: {...Emoji, ...}>(
+ emojis: $ReadOnlyArray<E>,
+ query: string,
+): Array<E>;