/** * @import { EmojiEntry } from '../../typedefs'; */ /** * Regular expression that matches an emoji shortcode being typed at the end of a line, like `:smi`. * The colon must be at the beginning of the text or preceded by a whitespace or an opening bracket, * so a colon in the middle of a word, as in `https://` or `12:34`, doesn’t trigger the suggestions. * The query is bounded to keep a runaway line from being searched for, at a length that still * accommodates the longest published shortcode. */ export const EMOJI_TRIGGER_REGEX: RegExp; /** * Maximum number of emoji suggestions offered, matching what Discord shows. The dropdown displays * five at a time and scrolls through the rest, so this only bounds how far a query can be explored * — a single letter otherwise matches over a thousand emojis, all rendered on every keystroke. */ export const MAX_EMOJI_SUGGESTIONS: 50; export function parseEmojiData(data: string): EmojiEntry[]; /** * Rank given when there is no match at all. Higher than any real rank, so an unmatched emoji sorts * last and the ranks can still be compared arithmetically. */ export const NO_EMOJI_MATCH: 9; export function getEmojiNameMatchRank(name: string, query: string): number; export function getEmojiAliasMatchRank(aliases: string[], query: string): number; export function getEmojiMatchRank({ name, aliases }: EmojiEntry, query: string): { rank: number; nameRank: number; }; export function searchEmojis(query: string): EmojiEntry[]; export function getEmojiInsertText(emoji: string, textAfterCaret: string): string; export function detectEmojiTrigger(textBeforeCaret: string): string | undefined; import type { EmojiEntry } from '../../typedefs';