feat: 🎸 按照中后台搭建协议规范文档补充 JSFunction 的定义和数据源定义中一些字段

This commit is contained in:
牧毅 2020-08-12 14:16:54 +08:00
parent 9e325250df
commit 8b1d0c76f3
2 changed files with 21 additions and 5 deletions

View File

@ -1,16 +1,32 @@
import { CompositeValue } from './value-type';
import { CompositeValue, JSExpression, JSFunction, JSONObject } from './value-type';
/**
*
* @see https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5
*/
export interface DataSourceConfig {
id: string;
isInit: boolean;
isInit: boolean | JSExpression;
type: string;
requestHandler?: JSFunction;
dataHandler?: JSFunction;
options: {
uri: string;
uri: string | JSExpression;
params?: JSONObject | JSExpression;
method?: string | JSExpression;
isCors?: boolean | JSExpression;
timeout?: number | JSExpression;
headers?: JSONObject | JSExpression;
[option: string]: CompositeValue;
};
[otherKey: string]: CompositeValue;
}
/**
*
* @see https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#XMeF5
*/
export interface DataSource {
items: DataSourceConfig[];
list: DataSourceConfig[];
dataHandler?: JSFunction;
}

View File

@ -55,7 +55,7 @@ export interface JSONObject {
}
// 复合类型
export type CompositeValue = JSONValue | JSExpression | JSSlot | CompositeArray | CompositeObject;
export type CompositeValue = JSONValue | JSExpression | JSFunction | JSSlot | CompositeArray | CompositeObject;
export type CompositeArray = CompositeValue[];
export interface CompositeObject {
[key: string]: CompositeValue;