@kvpasupuleti/text-to-emoji-converter
Version:
A flexible and customizable text-to-emoji converter for JavaScript and TypeScript applications.
31 lines (30 loc) • 922 B
TypeScript
import { EmojiMap } from "./types";
export declare class EmojiConverter {
private emojiMap;
constructor(customEmojiMap?: EmojiMap);
/**
* Convert text to emojis using the configured emoji map
* @param text The input text to convert
* @returns The text with words replaced by emojis
*/
convert(text: string): string;
/**
* Add new emoji mappings or override existing ones
* @param newMappings Object containing word-to-emoji mappings
*/
addMappings(newMappings: EmojiMap): void;
/**
* Remove emoji mappings for specific words
* @param words Array of words to remove from the emoji map
*/
removeMappings(words: string[]): void;
/**
* Get the current emoji mappings
* @returns The current emoji map
*/
getMappings(): EmojiMap;
/**
* Reset the emoji map to default mappings
*/
resetToDefault(): void;
}