format.d.cts 935 B

123456789101112131415161718192021222324252627282930
  1. interface UnicodeFormattingOptions {
  2. prefix: string;
  3. separator: string;
  4. case: 'upper' | 'lower';
  5. format: 'utf-32' | 'utf-16';
  6. add0: boolean;
  7. throwOnError: boolean;
  8. }
  9. /**
  10. * Convert unicode number to string
  11. *
  12. * Example:
  13. * 0x1F600 => '1F600'
  14. */
  15. declare function getEmojiUnicodeString(code: number, options?: Partial<UnicodeFormattingOptions>): string;
  16. /**
  17. * Convert unicode numbers sequence to string
  18. *
  19. * Example:
  20. * [0x1f441, 0xfe0f] => '1f441-fe0f'
  21. */
  22. declare function getEmojiSequenceString(sequence: number[], options?: Partial<UnicodeFormattingOptions>): string;
  23. /**
  24. * Convert unicode numbers sequence to string
  25. *
  26. * Simple version of `getEmojiSequenceString()` without options that otherwise add to bundle
  27. */
  28. declare function getEmojiSequenceKeyword(sequence: number[]): string;
  29. export { type UnicodeFormattingOptions, getEmojiSequenceKeyword, getEmojiSequenceString, getEmojiUnicodeString };