forked from alibaba/lowcode-engine
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathindex.ts
More file actions
25 lines (21 loc) · 733 Bytes
/
index.ts
File metadata and controls
25 lines (21 loc) · 733 Bytes
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
import { IPublicModelPluginContext, IPublicTypePlugin } from '@alilc/lowcode-types';
import { nodeCommand } from './node-command';
import { historyCommand } from './history-command';
export const CommandPlugin: IPublicTypePlugin = (ctx: IPublicModelPluginContext) => {
const { plugins } = ctx;
return {
async init() {
await plugins.register(nodeCommand, {}, { autoInit: true });
await plugins.register(historyCommand, {}, { autoInit: true });
},
destroy() {
plugins.delete(nodeCommand.pluginName);
plugins.delete(historyCommand.pluginName);
},
};
};
CommandPlugin.pluginName = '___default_command___';
CommandPlugin.meta = {
commandScope: 'common',
};
export default CommandPlugin;