/** * Emoji detection utilities using Intl.Segmenter */ import { type EmojiVersion } from "./emoji-data.generated.js"; export type { EmojiVersion } from "./emoji-data.generated.js"; /** * Check if a string contains any emoji * Uses Unicode 17.0.0 Emoji_Presentation data and variation selector (U+FE0F) * to properly detect emoji while avoiding false positives from characters like * #, *, digits 0-9, and text symbols like Β© which have \p{Emoji} but are not visual emoji */ export declare function hasEmoji(text: string): boolean; /** * Extract all emoji from a string using Intl.Segmenter * Returns an array of emoji characters (including multi-codepoint sequences) * * Uses grapheme segmentation to properly handle: * - Emoji with skin tone modifiers (πŸ™‹πŸ») * - ZWJ sequences (πŸ‘¨β€πŸ‘©β€πŸ‘§β€πŸ‘¦) * - Flag sequences (πŸ‡ΊπŸ‡Έ) * - Regional indicator sequences * - Any other complex emoji grapheme clusters */ export declare function extractEmojis(text: string): string[]; /** * Check if a version string is a valid emoji version */ export declare function isValidEmojiVersion(version: string): boolean; /** * Get the Unicode version for a given emoji character * Returns undefined if the emoji is not found in our data */ export declare function getEmojiVersion(emoji: string): EmojiVersion | undefined; /** * Filter function for emoji versions * Returns a filter function that checks if an emoji is from version or below */ export declare function filterEmojis(version: EmojiVersion): (emoji: string) => boolean; /** * Get all emoji that match the filter * Generates emoji from codepoint ranges and filters them */ export declare function getAllEmojis(filter: (emoji: string) => boolean): string[];