UNPKG

smile2emoji

Version:

Plugin to convert from text smile to emoticons. Emoji from punctuation

64 lines (63 loc) 1.73 kB
/** * With this simple and little module you can convert the smiles in your text to emoji. * * @module */ /** * A map of text to their emoji representation. */ export declare const emojiMap: { [key: string]: string; }; /** * A map of unicode characters to their string representation. */ export declare const mapStringToUnicode: { [key: string]: string; }; /** * * Function to check if in the string parameter there is some emoji and in case convert it. * * @param text * @returns the text with the emojis converted */ export declare const checkText: (text: string) => string; /** * * function to get the keys of an object that starts with a specific string * * @param obj * @param start * @returns string array */ export declare const keysStartingWith: (obj: { [key: string]: string; }, start: string) => string[]; /** * * Function to check if in the string parameter there is some emoji but * with autosuggestion, so if there is only one emoji key in the map starting with the string, it use it. * * @param text * @returns the text with the emojis converted */ export declare const checkTextWithAutoSuggestions: (text: string) => string; /** * * Function to convert a unicode string to an emoji * * @param text * @returns string emoji */ export declare const fromUnicodeToEmoji: (text: string) => string; /** * * Function to check if in the string parameter there is some emoji but * it use the map with unicode char instead of emoji, * so if there is only one emoji key in the map starting with the string, it use it. * * @param text * @returns the text with the emojis converted */ export declare const checkTextWithAutoSuggestionsAndUnicode: (text: string) => string;