研究调查问卷:请告诉我们您使用 Blockly 的体验
开始调查问卷
blockly >注册表 >getClass
Registry.getClass() 函数
获取指定名称和类型的类。
Signature:
export declare function getClass<T>(type: string | Type<T>, name: string, opt_throwIfMissing?: boolean): (new (...p1: any[]) => T) | null;
参数
参数 |
类型 |
说明 |
类型 |
字符串 |类型<T> |
插件的类型。(例如 Field、Renderer) |
name |
字符串 |
插件的名称。(例如:field_angle、geras) |
opt_throwIfMissing |
布尔值 |
(可选)如果我们找不到插件,是否抛出错误。 |
返回:
(new (...p1: any[]) => T) |null
具有指定名称和类型的类,如果不存在,则返回 null。
如未另行说明,那么本页面中的内容已根据知识共享署名 4.0 许可获得了许可,并且代码示例已根据 Apache 2.0 许可获得了许可。有关详情,请参阅 Google 开发者网站政策。Java 是 Oracle 和/或其关联公司的注册商标。
最后更新时间 (UTC):2024-09-12。
[null,null,["最后更新时间 (UTC):2024-09-12。"],[[["The `registry.getClass()` function retrieves the class associated with a specific name and type from the Blockly registry."],["It requires the plugin's type (like 'Field' or 'Renderer') and name as input."],["An optional boolean parameter controls whether an error is thrown if the plugin is not found."],["The function returns the corresponding class if found, otherwise it returns null."]]],[]]