Constructor
new Stock(src, unit, size, width, height, names, variantsopt, nullable, variantAliasesopt)
Parameters:
Name | Type | Attributes | Description |
---|---|---|---|
src |
String | image source (normally a URL) |
|
unit |
String | unit of measurement for icon size (e.g. |
|
size |
Number | icon size with respect to the |
|
width |
Number | the number of icons in a row present in the source |
|
height |
Number | the number of icon rows present in the source |
|
names |
Object.<String, Number> | a mapping associating each icon name to its horizontal offset |
|
variants |
Object.<String, Number> |
<optional> <nullable> |
a mapping associating each icon variant to its vertical offset; the
variants of the default stock ( |
variantAliases |
Object.<String, String> |
<optional> |
an optional mapping of aliases to icon variants; the variant
aliases of the default stock ( |
- Source:
Methods
parseVariant(variant) → {Object}
Transform a variant into its corresponding filter and final variant.
Parameters:
Name | Type | Description |
---|---|---|
variant |
String |
- Source:
Returns:
- Type
- Object
prepare()
Make the stock ready to be used by ensuring all its properties are prepared.
- Source: