replace.d.ts 607 B

12345678910111213141516
  1. import { EmojiRegexMatch } from './find.js';
  2. /**
  3. * Callback for replacing emoji in text
  4. *
  5. * Returns text to replace emoji with, undefined to skip replacement
  6. */
  7. type FindAndReplaceEmojisInTextCallback = (match: EmojiRegexMatch, prev: string) => string | undefined;
  8. /**
  9. * Find and replace emojis in text
  10. *
  11. * Returns null if nothing was replaced
  12. */
  13. declare function findAndReplaceEmojisInText(regexp: string | RegExp | (string | RegExp)[], content: string, callback: FindAndReplaceEmojisInTextCallback): string | null;
  14. export { type FindAndReplaceEmojisInTextCallback, findAndReplaceEmojisInText };