blockly > 图标 > registry > register
icon.registry.register() 函数
注册指定的图标,以便可以对其进行反序列化。
Signature:
export declare function register(type: IconType<IIcon>, iconConstructor: new (block: Block) => IIcon): void;
参数
参数 | 类型 | 说明 |
---|---|---|
类型 | IconType<IIcon> | 要注册的图标的类型。它应该与其 getType 方法返回的字符串相同。 |
iconConstructor | new (block: Block) => IIcon | 要注册的图标类/构造函数。 |
返回:
void