LooseDataValue
描述
LooseDataValue
是一种表示松散数据值的类型。它可以是DataValue
、string
、number
或boolean
。
定义
type LooseDataValue = DataValue | string | number | boolean;
说明
DataValue
: 这是该库中定义的一种特定类型。更多详情,请参阅DataValue文档页面。string
: 标准的JavaScript字符串。number
: 标准的 JavaScript 数字类型。boolean
: 标准的JavaScript布尔值。
使用方法
LooseDataValue
在API的各个地方被使用,特别是在RunGraphOptions
类型中作为输入和上下文值的类型。
export type RunGraphOptions = {
inputs?: Record<string, LooseDataValue>;
context?: Record<string, LooseDataValue>;
// Other properties...
};
在这个例子中,RunGraphOptions
里的inputs
和context
可以接受一个对象,其值可以是DataValue
、string
、number
或boolean
。