blockly > Block > getIcon

Block.getIcon() method

Signature:

getIcon<T extends IIcon>(type: IconType<T> | string): T | undefined;

Parameters

Parameter Type Description
type IconType<T> | string The type of the icon to retrieve. Prefer passing an IconType for proper type checking when using typescript.

Returns:

T | undefined

The icon with the given type if it exists on the block, undefined otherwise.