(spec: ComponentSpec)
| 792 | * 获取组件 Props |
| 793 | */ |
| 794 | export function getComponentProps<T = unknown>(spec: ComponentSpec): T { |
| 795 | const typeName = getComponentTypeName(spec); |
| 796 | const props = (spec as unknown as Record<string, T>)[typeName]; |
| 797 | if (props === undefined) { |
| 798 | throw new Error(`Invalid ComponentSpec: no props found for type ${typeName}`); |
| 799 | } |
| 800 | return props; |
| 801 | } |
| 802 | |
| 803 | /** |
| 804 | * 标准组件类型白名单 |
no test coverage detected