emoji-data
Version:
Emoji encoding swiss army knife for NodeJS
683 lines (678 loc) • 15.8 kB
HTML
<html>
<head>
<meta charset='UTF-8'>
<title>CoffeeScript API Documentation</title>
<script src='../javascript/application.js'></script>
<script src='../javascript/search.js'></script>
<link rel='stylesheet' href='../stylesheets/application.css' type='text/css'>
</head>
<body>
<div id='base' data-path='../'></div>
<div id='header'>
<div id='menu'>
<a href='../extra/README.md.html' title='Emoji-data'>
Emoji-data
</a>
»
<a href='../alphabetical_index.html' title='Index'>
Index
</a>
»
<span class='title'>EmojiData</span>
</div>
</div>
<div id='content'>
<h1>
Class:
EmojiData
</h1>
<table class='box'>
<tr>
<td>Defined in:</td>
<td>src/emoji_data.coffee</td>
</tr>
</table>
<h2>Class Method Summary</h2>
<ul class='summary'>
<li>
<span class='signature'>
<a href='#all-static'>
.
(Array<EmojiChar>)
<b>all</b><span>()</span>
</a>
</span>
<span class='desc'>
Returns a list of all known Emoji characters as <code>EmojiChar</code> objects.
</span>
</li>
<li>
<span class='signature'>
<a href='#all_doublebyte-static'>
.
(Array<EmojiChar>)
<b>all_doublebyte</b><span>()</span>
</a>
</span>
<span class='desc'>
Returns a list of all <code>EmojiChar</code> that are represented with doublebyte encoding.
</span>
</li>
<li>
<span class='signature'>
<a href='#all_with_variants-static'>
.
(Array<EmojiChar>)
<b>all_with_variants</b><span>()</span>
</a>
</span>
<span class='desc'>
Returns a list of all <code>EmojiChar</code> that have at least one variant encoding.
</span>
</li>
<li>
<span class='signature'>
<a href='#chars-static'>
.
(Array<String>)
<b>chars</b><span>(options = {
include_variants: false
})</span>
</a>
</span>
<span class='desc'>
Returns a list of all known Emoji characters rendered as UCS-2 strings.
</span>
</li>
<li>
<span class='signature'>
<a href='#codepoints-static'>
.
(Array<String>)
<b>codepoints</b><span>(options = {
include_variants: false
})</span>
</a>
</span>
<span class='desc'>
Returns a list of all known codepoints representing Emoji characters.
</span>
</li>
<li>
<span class='signature'>
<a href='#char_to_unified-static'>
.
(String)
<b>char_to_unified</b><span>(char)</span>
</a>
</span>
<span class='desc'>
Convert a native UCS-2 string glyph to its unified codepoint ID.
</span>
</li>
<li>
<span class='signature'>
<a href='#unified_to_char-static'>
.
(String)
<b>unified_to_char</b><span>(uid)</span>
</a>
</span>
<span class='desc'>
Convert a unified codepoint ID directly to its UCS-2 string representation.
</span>
</li>
<li>
<span class='signature'>
<a href='#find_by_name-static'>
.
(Array<EmojiChar>)
<b>find_by_name</b><span>(name)</span>
</a>
</span>
<span class='desc'>
Finds any <code>EmojiChar</code> that contains given string in its official name.
</span>
</li>
<li>
<span class='signature'>
<a href='#find_by_short_name-static'>
.
(Array<EmojiChar>)
<b>find_by_short_name</b><span>(name)</span>
</a>
</span>
<span class='desc'>
Find all <code>EmojiChar</code> that match string in any of their associated short name keywords.
</span>
</li>
<li>
<span class='signature'>
<a href='#from_short_name-static'>
.
(EmojiChar)
<b>from_short_name</b><span>(name)</span>
</a>
</span>
<span class='desc'>
Finds a specific <code>EmojiChar</code> based on the unified codepoint ID.
</span>
</li>
<li>
<span class='signature'>
<a href='#from_unified-static'>
.
(EmojiChar)
<b>from_unified</b><span>(uid)</span>
</a>
</span>
<span class='desc'>
Finds a specific <code>EmojiChar</code> based on its unified codepoint ID.
</span>
</li>
<li>
<span class='signature'>
<a href='#scan-static'>
.
(Array<EmojiChar>)
<b>scan</b><span>(str)</span>
</a>
</span>
<span class='desc'>
Scans a string for all encoded emoji characters contained within.
</span>
</li>
</ul>
<h2>Class Method Details</h2>
<div class='methods'>
<div class='method_details'>
<p class='signature' id='all-static'>
.
(Array<EmojiChar>)
<b>all</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Returns a list of all known Emoji characters as <code>EmojiChar</code> objects.</p>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<EmojiChar></tt>
)
—
<span class='desc'>a list of all known <code>EmojiChar</code>. </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='all_doublebyte-static'>
.
(Array<EmojiChar>)
<b>all_doublebyte</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Returns a list of all <code>EmojiChar</code> that are represented with doublebyte
encoding.</p>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<EmojiChar></tt>
)
—
<span class='desc'>a list of all doublebyte <code>EmojiChar</code>. </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='all_with_variants-static'>
.
(Array<EmojiChar>)
<b>all_with_variants</b><span>()</span>
<br>
</p>
<div class='docstring'>
<p>Returns a list of all <code>EmojiChar</code> that have at least one variant encoding.</p>
</div>
<div class='tags'>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<EmojiChar></tt>
)
—
<span class='desc'>a list of all <code>EmojiChar</code> with variant encoding. </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='chars-static'>
.
(Array<String>)
<b>chars</b><span>(options = {
include_variants: false
})</span>
<br>
</p>
<div class='docstring'>
<p>Returns a list of all known Emoji characters rendered as UCS-2 strings.</p><p>By default, the default rendering options for this library will be used.
However, if you pass an option hash with <code>include_variants: true</code> then all
possible renderings of a single glyph will be included, meaning that:</p><ol>
<li>You will have "duplicate" emojis in your list.</li>
<li>This list is now suitable for exhaustably matching against in a search.</li>
</ol>
</div>
<div class='tags'>
<h3>
Options Hash:
(options):
</h3>
<ul class='options'>
<li>
<span class='name'>:include_variants</span>
<span class='type'>
(
<tt>Boolean</tt>
)
</span>
—
<span class='desc'>whether or not to include all possible encoding variants in the list </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<String></tt>
)
—
<span class='desc'>all Emoji characters rendered as UTF-8 strings </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='codepoints-static'>
.
(Array<String>)
<b>codepoints</b><span>(options = {
include_variants: false
})</span>
<br>
</p>
<div class='docstring'>
<p>Returns a list of all known codepoints representing Emoji characters.</p>
</div>
<div class='tags'>
<h3>
Options Hash:
(options):
</h3>
<ul class='options'>
<li>
<span class='name'>:include_variants</span>
<span class='type'>
(
<tt>Boolean</tt>
)
</span>
—
<span class='desc'>whether or not to include all possible encoding variants in the list </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<String></tt>
)
—
<span class='desc'>all codepoints represented as unified ID strings </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='char_to_unified-static'>
.
(String)
<b>char_to_unified</b><span>(char)</span>
<br>
</p>
<div class='docstring'>
<p>Convert a native UCS-2 string glyph to its unified codepoint ID.</p><p>This is a conversion operation, not a match, so it may produce unexpected
results with different types of values.</p>
<div class='examples'>
<h3>Examples:</h3>
<h4>
</h4>
<pre><code class='coffeescript'>> EmojiData.unified_to_char("1F47E");
'👾'</code></pre>
</div>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>char</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
—
<span class='desc'>a single rendered emoji glyph encoded as a UCS-2 string </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
—
<span class='desc'>the unified ID </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='unified_to_char-static'>
.
(String)
<b>unified_to_char</b><span>(uid)</span>
<br>
</p>
<div class='docstring'>
<p>Convert a unified codepoint ID directly to its UCS-2 string representation.</p>
<div class='examples'>
<h3>Examples:</h3>
<h4>
</h4>
<pre><code class='coffeescript'>> EmojiData.char_to_unified("👾");
'1F47E'</code></pre>
</div>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>uid</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
—
<span class='desc'>the unified codepoint ID for an emoji </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>String</tt>
)
—
<span class='desc'>UCS-2 string rendering of the emoji character </span>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='find_by_name-static'>
.
(Array<EmojiChar>)
<b>find_by_name</b><span>(name)</span>
<br>
</p>
<div class='docstring'>
<p>Finds any <code>EmojiChar</code> that contains given string in its official name.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
<tt>Array<EmojiChar></tt>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='find_by_short_name-static'>
.
(Array<EmojiChar>)
<b>find_by_short_name</b><span>(name)</span>
<br>
</p>
<div class='docstring'>
<p>Find all <code>EmojiChar</code> that match string in any of their associated short
name keywords.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>short_name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
<tt>Array<EmojiChar></tt>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='from_short_name-static'>
.
(EmojiChar)
<b>from_short_name</b><span>(name)</span>
<br>
</p>
<div class='docstring'>
<p>Finds a specific <code>EmojiChar</code> based on the unified codepoint ID.</p><p>Must be exact match.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>name</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
<tt><a href='../class/EmojiChar.html'>EmojiChar</a></tt>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='from_unified-static'>
.
(EmojiChar)
<b>from_unified</b><span>(uid)</span>
<br>
</p>
<div class='docstring'>
<p>Finds a specific <code>EmojiChar</code> based on its unified codepoint ID.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>uid</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
—
<span class='desc'>the unified codepoint ID for an emoji </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
<tt><a href='../class/EmojiChar.html'>EmojiChar</a></tt>
</li>
</ul>
</div>
</div>
<div class='method_details'>
<p class='signature' id='scan-static'>
.
(Array<EmojiChar>)
<b>scan</b><span>(str)</span>
<br>
</p>
<div class='docstring'>
<p>Scans a string for all encoded emoji characters contained within.</p><p> string, in the order they appeared.</p>
</div>
<div class='tags'>
<h3>Parameters:</h3>
<ul class='param'>
<li>
<span class='name'>str</span>
<span class='type'>
(
<tt>String</tt>
)
</span>
—
<span class='desc'>the target string to search </span>
</li>
</ul>
<h3>Returns:</h3>
<ul class='return'>
<li>
<span class='type'></span>
(
<tt>Array<EmojiChar></tt>
)
—
<span class='desc'>all emoji characters contained within the target </span>
</li>
</ul>
</div>
</div>
</div>
</div>
<div id='footer'>
September 02, 14 22:28:50 by
<a href='https://github.com/coffeedoc/codo' title='CoffeeScript API documentation generator'>
Codo
</a>
2.0.9
✲
Press H to see the keyboard shortcuts
✲
<a href='http://twitter.com/netzpirat' target='_parent'>@netzpirat</a>
✲
<a href='http://twitter.com/_inossidabile' target='_parent'>@_inossidabile</a>
</div>
<iframe id='search_frame'></iframe>
<div id='fuzzySearch'>
<input type='text'>
<ol></ol>
</div>
<div id='help'>
<p>
Quickly fuzzy find classes, mixins, methods, file:
</p>
<ul>
<li>
<span>T</span>
Open fuzzy finder dialog
</li>
</ul>
<p>
Control the navigation frame:
</p>
<ul>
<li>
<span>L</span>
Toggle list view
</li>
<li>
<span>C</span>
Show class list
</li>
<li>
<span>I</span>
Show mixin list
</li>
<li>
<span>F</span>
Show file list
</li>
<li>
<span>M</span>
Show method list
</li>
<li>
<span>E</span>
Show extras list
</li>
</ul>
<p>
You can focus and blur the search input:
</p>
<ul>
<li>
<span>S</span>
Focus search input
</li>
<li>
<span>Esc</span>
Blur search input
</li>
</ul>
</div>
</body>
</html>