Stay organized with collections
Save and categorize content based on your preferences.
blockly > icons > IconType
icons.IconType class
Defines the type of an icon, so that it can be retrieved from block.getIcon
Signature:
export declare class IconType<_T extends IIcon>
Constructors
Constructor |
Modifiers |
Description |
(constructor)(name) |
|
Constructs a new instance of the IconType class |
Properties
Methods
Except as otherwise noted, the content of this page is licensed under the Creative Commons Attribution 4.0 License, and code samples are licensed under the Apache 2.0 License. For details, see the Google Developers Site Policies. Java is a registered trademark of Oracle and/or its affiliates.
Last updated 2024-09-18 UTC.
[[["Easy to understand","easyToUnderstand","thumb-up"],["Solved my problem","solvedMyProblem","thumb-up"],["Other","otherUp","thumb-up"]],[["Missing the information I need","missingTheInformationINeed","thumb-down"],["Too complicated / too many steps","tooComplicatedTooManySteps","thumb-down"],["Out of date","outOfDate","thumb-down"],["Samples / code issue","samplesCodeIssue","thumb-down"],["Other","otherDown","thumb-down"]],["Last updated 2024-09-18 UTC."],[[["\u003cp\u003eThe \u003ccode\u003eIconType\u003c/code\u003e class defines the type of an icon, enabling retrieval from a block using \u003ccode\u003eblock.getIcon\u003c/code\u003e.\u003c/p\u003e\n"],["\u003cp\u003eIt provides static properties like \u003ccode\u003eCOMMENT\u003c/code\u003e, \u003ccode\u003eMUTATOR\u003c/code\u003e, and \u003ccode\u003eWARNING\u003c/code\u003e representing different icon types.\u003c/p\u003e\n"],["\u003cp\u003eIncludes methods for comparison (\u003ccode\u003eequals\u003c/code\u003e) and string representation (\u003ccode\u003etoString\u003c/code\u003e).\u003c/p\u003e\n"],["\u003cp\u003eDevelopers can construct a new \u003ccode\u003eIconType\u003c/code\u003e instance using its constructor.\u003c/p\u003e\n"]]],["The `IconType` class defines icon types for retrieval from a block using `block.getIcon`. It has a constructor to create new instances and includes static properties: `COMMENT`, `MUTATOR`, and `WARNING`, representing different icon types. It also includes two methods: `equals(type)` for comparison and `toString()` for string conversion of the icon type. The class is part of the `icons` namespace within the larger `blockly` module.\n"],null,["[blockly](./blockly.md) \\\u003e [icons](./blockly.icons_namespace.md) \\\u003e [IconType](./blockly.icons_namespace.icontype_class.md)\n\nicons.IconType class\n--------------------\n\nDefines the type of an icon, so that it can be retrieved from block.getIcon\n\n**Signature:** \n\n export declare class IconType\u003c_T extends IIcon\u003e \n\nConstructors\n------------\n\n| Constructor | Modifiers | Description |\n|------------------------------------------------------------------------------------------------|-----------|---------------------------------------------------|\n| [(constructor)(name)](./blockly.icons_namespace.icontype_class._constructor__1_constructor.md) | | Constructs a new instance of the `IconType` class |\n\nProperties\n----------\n\n| Property | Modifiers | Type | Description |\n|-------------------------------------------------------------------------|-----------|--------------------------------------------------------------------------------------------------------------------------|-------------|\n| [COMMENT](./blockly.icons_namespace.icontype_class.comment_property.md) | `static` | [IconType](./blockly.icons_namespace.icontype_class.md)\\\u003cICommentIcon\\\u003e | |\n| [MUTATOR](./blockly.icons_namespace.icontype_class.mutator_property.md) | `static` | [IconType](./blockly.icons_namespace.icontype_class.md)\\\u003c[MutatorIcon](./blockly.icons_namespace.mutatoricon_class.md)\\\u003e | |\n| [WARNING](./blockly.icons_namespace.icontype_class.warning_property.md) | `static` | [IconType](./blockly.icons_namespace.icontype_class.md)\\\u003c[WarningIcon](./blockly.icons_namespace.warningicon_class.md)\\\u003e | |\n\nMethods\n-------\n\n| Method | Modifiers | Description |\n|-----------------------------------------------------------------------------|-----------|-------------|\n| [equals(type)](./blockly.icons_namespace.icontype_class.equals_1_method.md) | | |\n| [toString()](./blockly.icons_namespace.icontype_class.tostring_1_method.md) | | |"]]