Class: EmojiData

Defined in: src/emoji_data.coffee

Class Method Summary

Class Method Details

. (Array<EmojiChar>) all()

Returns a list of all known Emoji characters as EmojiChar objects.

Returns:

  • ( Array<EmojiChar> ) — a list of all known EmojiChar.

. (Array<EmojiChar>) all_doublebyte()

Returns a list of all EmojiChar that are represented with doublebyte encoding.

Returns:

  • ( Array<EmojiChar> ) — a list of all doublebyte EmojiChar.

. (Array<EmojiChar>) all_with_variants()

Returns a list of all EmojiChar that have at least one variant encoding.

Returns:

  • ( Array<EmojiChar> ) — a list of all EmojiChar with variant encoding.

. (Array<String>) chars(options = { include_variants: false })

Returns a list of all known Emoji characters rendered as UCS-2 strings.

By default, the default rendering options for this library will be used. However, if you pass an option hash with include_variants: true then all possible renderings of a single glyph will be included, meaning that:

  1. You will have "duplicate" emojis in your list.
  2. This list is now suitable for exhaustably matching against in a search.

Options Hash: (options):

  • :include_variants ( Boolean ) whether or not to include all possible encoding variants in the list

Returns:

  • ( Array<String> ) — all Emoji characters rendered as UTF-8 strings

. (Array<String>) codepoints(options = { include_variants: false })

Returns a list of all known codepoints representing Emoji characters.

Options Hash: (options):

  • :include_variants ( Boolean ) whether or not to include all possible encoding variants in the list

Returns:

  • ( Array<String> ) — all codepoints represented as unified ID strings

. (String) char_to_unified(char)

Convert a native UCS-2 string glyph to its unified codepoint ID.

This is a conversion operation, not a match, so it may produce unexpected results with different types of values.

Examples:

> EmojiData.unified_to_char("1F47E");
'👾'

Parameters:

  • char ( String ) a single rendered emoji glyph encoded as a UCS-2 string

Returns:

  • ( String ) — the unified ID

. (String) unified_to_char(uid)

Convert a unified codepoint ID directly to its UCS-2 string representation.

Examples:

> EmojiData.char_to_unified("👾");
'1F47E'

Parameters:

  • uid ( String ) the unified codepoint ID for an emoji

Returns:

  • ( String ) — UCS-2 string rendering of the emoji character

. (Array<EmojiChar>) find_by_name(name)

Finds any EmojiChar that contains given string in its official name.

Parameters:

  • name ( String )

Returns:

  • Array<EmojiChar>

. (Array<EmojiChar>) find_by_short_name(name)

Find all EmojiChar that match string in any of their associated short name keywords.

Parameters:

  • short_name ( String )

Returns:

  • Array<EmojiChar>

. (EmojiChar) from_short_name(name)

Finds a specific EmojiChar based on the unified codepoint ID.

Must be exact match.

Parameters:

  • name ( String )

Returns:

. (EmojiChar) from_unified(uid)

Finds a specific EmojiChar based on its unified codepoint ID.

Parameters:

  • uid ( String ) the unified codepoint ID for an emoji

Returns:

. (Array<EmojiChar>) scan(str)

Scans a string for all encoded emoji characters contained within.

string, in the order they appeared.

Parameters:

  • str ( String ) the target string to search

Returns:

  • ( Array<EmojiChar> ) — all emoji characters contained within the target

    Quickly fuzzy find classes, mixins, methods, file:

    Control the navigation frame:

    You can focus and blur the search input: