mirror of
https://github.com/alibaba/lowcode-engine.git
synced 2026-01-13 17:48:13 +00:00
feat: 🎸 补充规范中定义的 JSFunction 类型
This commit is contained in:
parent
a3f0c3dcef
commit
9e325250df
@ -17,6 +17,22 @@ export interface JSExpression {
|
||||
[key: string]: any;
|
||||
}
|
||||
|
||||
/**
|
||||
* 事件函数类型
|
||||
* @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 JSSlot {
|
||||
name?: string;
|
||||
type: 'JSSlot';
|
||||
@ -50,6 +66,10 @@ export function isJSExpression(data: any): data is JSExpression {
|
||||
return data && data.type === 'JSExpression';
|
||||
}
|
||||
|
||||
export function isJSFunction(x: any): x is JSFunction {
|
||||
return typeof x === 'object' && x && x.type === 'JSFunction';
|
||||
}
|
||||
|
||||
export function isJSSlot(data: any): data is JSSlot {
|
||||
return data && data.type === 'JSSlot';
|
||||
}
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user