@redhare/lowcode-datasource-types
Version:
61 lines (60 loc) • 1.42 kB
TypeScript
export interface JSExpression {
type: 'JSExpression';
/**
* 表达式字符串
*/
value: string;
/**
* 模拟值
*/
mock?: any;
/** 源码 */
compiled?: string;
}
export interface JSFunction {
type: 'JSFunction';
/**
* 表达式字符串
*/
value: string;
}
/**
* 事件函数类型
* @see https://yuque.antfin-inc.com/mo/spec/spec-low-code-building-schema#feHTW
*/
export interface JSFunction {
type: 'JSFunction';
/**
* 函数定义,或直接函数表达式
*/
value: string;
/** 源码 */
compiled?: string;
}
export interface JSFunction {
type: 'JSFunction';
/**
* 函数字符串
*/
value: string;
/**
* 模拟值
*/
mock?: any;
/**
* 额外扩展属性,如 extType、events
*/
[key: string]: any;
}
export type JSONValue = boolean | string | number | null | undefined | JSONArray | JSONObject;
export type JSONArray = JSONValue[];
export interface JSONObject {
[key: string]: JSONValue;
}
export type CompositeValue = JSONValue | JSExpression | JSFunction | CompositeArray | CompositeObject;
export type CompositeArray = CompositeValue[];
export interface CompositeObject {
[key: string]: CompositeValue;
}
export declare function isJSExpression(data: any): data is JSExpression;
export declare function isJSFunction(x: any): x is JSFunction;