setComponent
setComponent<
T,D>(type):Dextendsstring?DefineTypeAction<T> &object:RawConfigAction<"viewRawConfig",T,AnyCoreSchemaHandle> &object
Defined in: projects/view-core/convert/action/component.ts:18
D extends string 时把字面量钉在 value 上。
DefineTypeAction.value 是宽 string, 类型层读不出 ‘radio’ 这种组件名,
于是 SchemaTypeAt 只能退回 schema 自身的 type(picklist), 与运行时不一致。
交叉一层 { value: D } 后 string & 'radio' 收敛成 ‘radio’, 运行时不变。
Type Parameters
Section titled “Type Parameters”T
D
Parameters
Section titled “Parameters”D
Returns
Section titled “Returns”D extends string ? DefineTypeAction<T> & object : RawConfigAction<"viewRawConfig", T, AnyCoreSchemaHandle> & object