forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathcommand.ts
More file actions
59 lines (47 loc) · 1.08 KB
/
command.ts
File metadata and controls
59 lines (47 loc) · 1.08 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
import { IPublicTypePropType } from './prop-types';
// 定义命令处理函数的参数类型
export interface IPublicTypeCommandHandlerArgs {
[key: string]: any;
}
// 定义命令参数的接口
export interface IPublicTypeCommandParameter {
/**
* 参数名称
*/
name: string;
/**
* 参数类型或详细类型描述
*/
propType: string | IPublicTypePropType;
/**
* 参数描述
*/
description: string;
/**
* 参数默认值(可选)
*/
defaultValue?: any;
}
// 定义单个命令的接口
export interface IPublicTypeCommand {
/**
* 命令名称
* 命名规则:commandName
* 使用规则:commandScope:commandName (commandScope 在插件 meta 中定义,用于区分不同插件的命令)
*/
name: string;
/**
* 命令参数
*/
parameters?: IPublicTypeCommandParameter[];
/**
* 命令描述
*/
description?: string;
/**
* 命令处理函数
*/
handler: (args: any) => void;
}
export interface IPublicTypeListCommand extends Pick<IPublicTypeCommand, 'name' | 'description' | 'parameters'> {
}