tty-strings
Version:
Tools for working with strings displayed in the terminal
45 lines • 1.82 kB
TypeScript
/**
* Get the emoji properties of a given unicode code point
*
* @remarks
* Properties are derived from {@link https://unicode.org/Public/16.0.0/ucd/emoji/emoji-data.txt}
*
* @param code - unicode code point
* @returns A bitmask encoded with the following properties:
* `Emoji (1) | Emoji_Presentation (2) | Emoji_Modifier_Base (4) | Emoji_Modifier (8) | Emoji_Component (16)`
*/
export declare function emojiProps(code: number): 0 | 1 | 3 | 5 | 7 | 27 | 19;
/**
* Check if a sequence of code points is an emoji zwj sequence.
*
* @remarks
* Emoji zwj sequences defined by UTS #51 ED-16: {@link https://unicode.org/reports/tr51/#def_emoji_zwj_sequence}
* Emoji zwj elements defined by UTS #51 ED-15a: {@link https://unicode.org/reports/tr51/#def_emoji_zwj_element}
*
* @param sequence - array of code points
* @returns `true` for fully-qualified and minimally-qualified emoji zwj sequences,
* and `false` for unqualified sequences
*/
export declare function isEmojiZwjSequence(sequence: number[]): boolean;
/**
* Check if two code points make a valid emoji modifier sequence
*
* @remarks
* Defined by UTS #51 ED-13: {@link https://unicode.org/reports/tr51/#def_emoji_modifier_sequence}
*
* @param cp1 - first code point
* @param cp2 - second code point
* @returns Whether the two code points maek a valid emoji modifier sequence
*/
export declare function isEmojiModifierSequence(cp1: number, cp2: number): boolean;
/**
* Check if a code point is a valid emoji modifier base
*
* @remarks
* Defined by UTS #51 ED-12: {@link https://unicode.org/reports/tr51/#def_emoji_modifier_base}
*
* @param cp - code point to check
* @returns Whether the code point is an emodi modifier base
*/
export declare function isEmojiModifierBase(cp: number): boolean;
//# sourceMappingURL=emoji.d.ts.map