@tmagic/editor 1.5.18-beta.1 → 1.5.19

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -646,12 +646,21 @@ const advancedTabConfig = {
646
646
  name: "created",
647
647
  text: "created",
648
648
  labelPosition: "top",
649
- type: "code-select"
649
+ type: "code-select",
650
+ extra: "组件初始化时执行"
650
651
  },
651
652
  {
652
653
  name: "mounted",
653
654
  text: "mounted",
654
655
  labelPosition: "top",
656
+ type: "code-select",
657
+ extra: "组件挂载到dom时执行"
658
+ },
659
+ {
660
+ name: "display",
661
+ text: "display",
662
+ extra: "控制组件是否渲染,关系的代码块返回值为false时不渲染",
663
+ labelPosition: "top",
655
664
  type: "code-select"
656
665
  }
657
666
  ]
@@ -1200,7 +1209,7 @@ class BaseService extends EventEmitter {
1200
1209
  }
1201
1210
  }
1202
1211
 
1203
- const canUsePluginMethods$6 = {
1212
+ const canUsePluginMethods$7 = {
1204
1213
  async: [
1205
1214
  "setPropsConfig",
1206
1215
  "getPropsConfig",
@@ -1219,8 +1228,8 @@ class Props extends BaseService {
1219
1228
  });
1220
1229
  constructor() {
1221
1230
  super([
1222
- ...canUsePluginMethods$6.async.map((methodName) => ({ name: methodName, isAsync: true })),
1223
- ...canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false }))
1231
+ ...canUsePluginMethods$7.async.map((methodName) => ({ name: methodName, isAsync: true })),
1232
+ ...canUsePluginMethods$7.sync.map((methodName) => ({ name: methodName, isAsync: false }))
1224
1233
  ]);
1225
1234
  }
1226
1235
  setPropsConfigs(configs) {
@@ -1540,14 +1549,14 @@ var Protocol = /* @__PURE__ */ ((Protocol2) => {
1540
1549
  Protocol2["BOOLEAN"] = "boolean";
1541
1550
  return Protocol2;
1542
1551
  })(Protocol || {});
1543
- const canUsePluginMethods$5 = {
1552
+ const canUsePluginMethods$6 = {
1544
1553
  sync: ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"]
1545
1554
  };
1546
1555
  class WebStorage extends BaseService {
1547
1556
  storage = globalThis.localStorage;
1548
1557
  namespace = "tmagic";
1549
1558
  constructor() {
1550
- super(canUsePluginMethods$5.sync.map((methodName) => ({ name: methodName, isAsync: false })));
1559
+ super(canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false })));
1551
1560
  }
1552
1561
  /**
1553
1562
  * 获取数据存储对象,可以通过
@@ -1653,7 +1662,7 @@ class WebStorage extends BaseService {
1653
1662
  }
1654
1663
  const storageService = new WebStorage();
1655
1664
 
1656
- const canUsePluginMethods$4 = {
1665
+ const canUsePluginMethods$5 = {
1657
1666
  async: [
1658
1667
  "getLayout",
1659
1668
  "highlight",
@@ -1696,7 +1705,7 @@ class Editor extends BaseService {
1696
1705
  isHistoryStateChange = false;
1697
1706
  constructor() {
1698
1707
  super(
1699
- canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })),
1708
+ canUsePluginMethods$5.async.map((methodName) => ({ name: methodName, isAsync: true })),
1700
1709
  // 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
1701
1710
  ["select", "update", "moveLayer"]
1702
1711
  );
@@ -3676,11 +3685,11 @@ const state = shallowReactive({
3676
3685
  top: 0
3677
3686
  }
3678
3687
  });
3679
- const canUsePluginMethods$3 = {
3688
+ const canUsePluginMethods$4 = {
3680
3689
  async: ["zoom", "calcZoom"]};
3681
3690
  class Ui extends BaseService {
3682
3691
  constructor() {
3683
- super(canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })));
3692
+ super(canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })));
3684
3693
  }
3685
3694
  set(name, value) {
3686
3695
  const mask = editorService.get("stage")?.mask;
@@ -6266,7 +6275,6 @@ const _sfc_main$18 = /* @__PURE__ */ defineComponent({
6266
6275
  {
6267
6276
  text: "数据源",
6268
6277
  label: "数据源",
6269
- disabled: !dataSourceService?.get("dataSources")?.filter((ds) => ds.methods?.length || dataSourceService.getFormMethod(ds.type).length).length,
6270
6278
  value: ActionType.DATA_SOURCE
6271
6279
  }
6272
6280
  ]
@@ -13520,7 +13528,7 @@ const _sfc_main$1 = /* @__PURE__ */ defineComponent({
13520
13528
  }
13521
13529
  });
13522
13530
 
13523
- const canUsePluginMethods$2 = {
13531
+ const canUsePluginMethods$3 = {
13524
13532
  async: ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"],
13525
13533
  sync: ["setCodeDslByIdSync"]
13526
13534
  };
@@ -13534,8 +13542,8 @@ class CodeBlock extends BaseService {
13534
13542
  });
13535
13543
  constructor() {
13536
13544
  super([
13537
- ...canUsePluginMethods$2.async.map((methodName) => ({ name: methodName, isAsync: true })),
13538
- ...canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false }))
13545
+ ...canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })),
13546
+ ...canUsePluginMethods$3.sync.map((methodName) => ({ name: methodName, isAsync: false }))
13539
13547
  ]);
13540
13548
  }
13541
13549
  /**
@@ -13793,7 +13801,7 @@ class ComponentList extends BaseService {
13793
13801
  }
13794
13802
  const componentListService = new ComponentList();
13795
13803
 
13796
- const canUsePluginMethods$1 = {
13804
+ const canUsePluginMethods$2 = {
13797
13805
  sync: [
13798
13806
  "getFormConfig",
13799
13807
  "setFormConfig",
@@ -13820,7 +13828,7 @@ class DataSource extends BaseService {
13820
13828
  methods: {}
13821
13829
  });
13822
13830
  constructor() {
13823
- super(canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false })));
13831
+ super(canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false })));
13824
13832
  }
13825
13833
  set(name, value) {
13826
13834
  this.state[name] = value;
@@ -14163,11 +14171,18 @@ class Dep extends BaseService {
14163
14171
  }
14164
14172
  const depService = new Dep();
14165
14173
 
14174
+ const canUsePluginMethods$1 = {
14175
+ async: [],
14176
+ sync: ["setEvent", "getEvent", "setMethod", "getMethod"]
14177
+ };
14166
14178
  let eventMap = reactive({});
14167
14179
  let methodMap = reactive({});
14168
14180
  class Events extends BaseService {
14169
14181
  constructor() {
14170
- super([]);
14182
+ super([
14183
+ ...canUsePluginMethods$1.async.map((methodName) => ({ name: methodName, isAsync: true })),
14184
+ ...canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false }))
14185
+ ]);
14171
14186
  }
14172
14187
  setEvents(events) {
14173
14188
  Object.keys(events).forEach((type) => {
@@ -14200,6 +14215,9 @@ class Events extends BaseService {
14200
14215
  this.removeAllListeners();
14201
14216
  this.removeAllPlugins();
14202
14217
  }
14218
+ usePlugin(options) {
14219
+ super.usePlugin(options);
14220
+ }
14203
14221
  }
14204
14222
  const eventsService = new Events();
14205
14223
 
@@ -5439,12 +5439,21 @@
5439
5439
  name: "created",
5440
5440
  text: "created",
5441
5441
  labelPosition: "top",
5442
- type: "code-select"
5442
+ type: "code-select",
5443
+ extra: "组件初始化时执行"
5443
5444
  },
5444
5445
  {
5445
5446
  name: "mounted",
5446
5447
  text: "mounted",
5447
5448
  labelPosition: "top",
5449
+ type: "code-select",
5450
+ extra: "组件挂载到dom时执行"
5451
+ },
5452
+ {
5453
+ name: "display",
5454
+ text: "display",
5455
+ extra: "控制组件是否渲染,关系的代码块返回值为false时不渲染",
5456
+ labelPosition: "top",
5448
5457
  type: "code-select"
5449
5458
  }
5450
5459
  ]
@@ -5993,7 +6002,7 @@
5993
6002
  }
5994
6003
  }
5995
6004
 
5996
- const canUsePluginMethods$6 = {
6005
+ const canUsePluginMethods$7 = {
5997
6006
  async: [
5998
6007
  "setPropsConfig",
5999
6008
  "getPropsConfig",
@@ -6012,8 +6021,8 @@
6012
6021
  });
6013
6022
  constructor() {
6014
6023
  super([
6015
- ...canUsePluginMethods$6.async.map((methodName) => ({ name: methodName, isAsync: true })),
6016
- ...canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false }))
6024
+ ...canUsePluginMethods$7.async.map((methodName) => ({ name: methodName, isAsync: true })),
6025
+ ...canUsePluginMethods$7.sync.map((methodName) => ({ name: methodName, isAsync: false }))
6017
6026
  ]);
6018
6027
  }
6019
6028
  setPropsConfigs(configs) {
@@ -6333,14 +6342,14 @@
6333
6342
  Protocol2["BOOLEAN"] = "boolean";
6334
6343
  return Protocol2;
6335
6344
  })(Protocol || {});
6336
- const canUsePluginMethods$5 = {
6345
+ const canUsePluginMethods$6 = {
6337
6346
  sync: ["getStorage", "getNamespace", "clear", "getItem", "removeItem", "setItem"]
6338
6347
  };
6339
6348
  class WebStorage extends BaseService {
6340
6349
  storage = globalThis.localStorage;
6341
6350
  namespace = "tmagic";
6342
6351
  constructor() {
6343
- super(canUsePluginMethods$5.sync.map((methodName) => ({ name: methodName, isAsync: false })));
6352
+ super(canUsePluginMethods$6.sync.map((methodName) => ({ name: methodName, isAsync: false })));
6344
6353
  }
6345
6354
  /**
6346
6355
  * 获取数据存储对象,可以通过
@@ -6446,7 +6455,7 @@
6446
6455
  }
6447
6456
  const storageService = new WebStorage();
6448
6457
 
6449
- const canUsePluginMethods$4 = {
6458
+ const canUsePluginMethods$5 = {
6450
6459
  async: [
6451
6460
  "getLayout",
6452
6461
  "highlight",
@@ -6489,7 +6498,7 @@
6489
6498
  isHistoryStateChange = false;
6490
6499
  constructor() {
6491
6500
  super(
6492
- canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })),
6501
+ canUsePluginMethods$5.async.map((methodName) => ({ name: methodName, isAsync: true })),
6493
6502
  // 需要注意循环依赖问题,如果函数间有相互调用的话,不能设置为串行调用
6494
6503
  ["select", "update", "moveLayer"]
6495
6504
  );
@@ -8469,11 +8478,11 @@
8469
8478
  top: 0
8470
8479
  }
8471
8480
  });
8472
- const canUsePluginMethods$3 = {
8481
+ const canUsePluginMethods$4 = {
8473
8482
  async: ["zoom", "calcZoom"]};
8474
8483
  class Ui extends BaseService {
8475
8484
  constructor() {
8476
- super(canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })));
8485
+ super(canUsePluginMethods$4.async.map((methodName) => ({ name: methodName, isAsync: true })));
8477
8486
  }
8478
8487
  set(name, value) {
8479
8488
  const mask = editorService.get("stage")?.mask;
@@ -11059,7 +11068,6 @@
11059
11068
  {
11060
11069
  text: "数据源",
11061
11070
  label: "数据源",
11062
- disabled: !dataSourceService?.get("dataSources")?.filter((ds) => ds.methods?.length || dataSourceService.getFormMethod(ds.type).length).length,
11063
11071
  value: core.ActionType.DATA_SOURCE
11064
11072
  }
11065
11073
  ]
@@ -18313,7 +18321,7 @@
18313
18321
  }
18314
18322
  });
18315
18323
 
18316
- const canUsePluginMethods$2 = {
18324
+ const canUsePluginMethods$3 = {
18317
18325
  async: ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"],
18318
18326
  sync: ["setCodeDslByIdSync"]
18319
18327
  };
@@ -18327,8 +18335,8 @@
18327
18335
  });
18328
18336
  constructor() {
18329
18337
  super([
18330
- ...canUsePluginMethods$2.async.map((methodName) => ({ name: methodName, isAsync: true })),
18331
- ...canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false }))
18338
+ ...canUsePluginMethods$3.async.map((methodName) => ({ name: methodName, isAsync: true })),
18339
+ ...canUsePluginMethods$3.sync.map((methodName) => ({ name: methodName, isAsync: false }))
18332
18340
  ]);
18333
18341
  }
18334
18342
  /**
@@ -18586,7 +18594,7 @@
18586
18594
  }
18587
18595
  const componentListService = new ComponentList();
18588
18596
 
18589
- const canUsePluginMethods$1 = {
18597
+ const canUsePluginMethods$2 = {
18590
18598
  sync: [
18591
18599
  "getFormConfig",
18592
18600
  "setFormConfig",
@@ -18613,7 +18621,7 @@
18613
18621
  methods: {}
18614
18622
  });
18615
18623
  constructor() {
18616
- super(canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false })));
18624
+ super(canUsePluginMethods$2.sync.map((methodName) => ({ name: methodName, isAsync: false })));
18617
18625
  }
18618
18626
  set(name, value) {
18619
18627
  this.state[name] = value;
@@ -18956,11 +18964,18 @@
18956
18964
  }
18957
18965
  const depService = new Dep();
18958
18966
 
18967
+ const canUsePluginMethods$1 = {
18968
+ async: [],
18969
+ sync: ["setEvent", "getEvent", "setMethod", "getMethod"]
18970
+ };
18959
18971
  let eventMap = vue.reactive({});
18960
18972
  let methodMap = vue.reactive({});
18961
18973
  class Events extends BaseService {
18962
18974
  constructor() {
18963
- super([]);
18975
+ super([
18976
+ ...canUsePluginMethods$1.async.map((methodName) => ({ name: methodName, isAsync: true })),
18977
+ ...canUsePluginMethods$1.sync.map((methodName) => ({ name: methodName, isAsync: false }))
18978
+ ]);
18964
18979
  }
18965
18980
  setEvents(events) {
18966
18981
  Object.keys(events).forEach((type) => {
@@ -18993,6 +19008,9 @@
18993
19008
  this.removeAllListeners();
18994
19009
  this.removeAllPlugins();
18995
19010
  }
19011
+ usePlugin(options) {
19012
+ super.usePlugin(options);
19013
+ }
18996
19014
  }
18997
19015
  const eventsService = new Events();
18998
19016
 
package/package.json CHANGED
@@ -1,5 +1,5 @@
1
1
  {
2
- "version": "1.5.18-beta.1",
2
+ "version": "1.5.19",
3
3
  "name": "@tmagic/editor",
4
4
  "type": "module",
5
5
  "sideEffects": [
@@ -58,11 +58,11 @@
58
58
  "moveable": "^0.53.0",
59
59
  "serialize-javascript": "^6.0.0",
60
60
  "sortablejs": "^1.15.2",
61
- "@tmagic/design": "1.5.17",
62
- "@tmagic/form": "1.5.17",
63
- "@tmagic/stage": "1.5.17",
64
- "@tmagic/table": "1.5.17",
65
- "@tmagic/utils": "1.5.17"
61
+ "@tmagic/design": "1.5.19",
62
+ "@tmagic/form": "1.5.19",
63
+ "@tmagic/table": "1.5.19",
64
+ "@tmagic/utils": "1.5.19",
65
+ "@tmagic/stage": "1.5.19"
66
66
  },
67
67
  "devDependencies": {
68
68
  "@types/events": "^3.0.0",
@@ -76,7 +76,7 @@
76
76
  "monaco-editor": "^0.48.0",
77
77
  "typescript": "*",
78
78
  "vue": ">=3.5.0",
79
- "@tmagic/core": "1.5.17"
79
+ "@tmagic/core": "1.5.19"
80
80
  },
81
81
  "peerDependenciesMeta": {
82
82
  "typescript": {
@@ -188,9 +188,6 @@ const actionTypeConfig = computed(() => {
188
188
  {
189
189
  text: '数据源',
190
190
  label: '数据源',
191
- disabled: !dataSourceService
192
- ?.get('dataSources')
193
- ?.filter((ds) => ds.methods?.length || dataSourceService.getFormMethod(ds.type).length).length,
194
191
  value: ActionType.DATA_SOURCE,
195
192
  },
196
193
  ],
@@ -18,18 +18,32 @@
18
18
 
19
19
  import { reactive } from 'vue';
20
20
  import { cloneDeep } from 'lodash-es';
21
+ import type { Writable } from 'type-fest';
21
22
 
22
23
  import { type EventOption } from '@tmagic/core';
23
24
  import { toLine } from '@tmagic/utils';
24
25
 
26
+ import type { AsyncHookPlugin, SyncHookPlugin } from '@editor/type';
27
+
25
28
  import BaseService from './BaseService';
26
29
 
30
+ const canUsePluginMethods = {
31
+ async: [] as const,
32
+ sync: ['setEvent', 'getEvent', 'setMethod', 'getMethod'] as const,
33
+ };
34
+
35
+ type AsyncMethodName = Writable<(typeof canUsePluginMethods)['async']>;
36
+ type SyncMethodName = Writable<(typeof canUsePluginMethods)['sync']>;
37
+
27
38
  let eventMap: Record<string, EventOption[]> = reactive({});
28
39
  let methodMap: Record<string, EventOption[]> = reactive({});
29
40
 
30
41
  class Events extends BaseService {
31
42
  constructor() {
32
- super([]);
43
+ super([
44
+ ...canUsePluginMethods.async.map((methodName) => ({ name: methodName, isAsync: true })),
45
+ ...canUsePluginMethods.sync.map((methodName) => ({ name: methodName, isAsync: false })),
46
+ ]);
33
47
  }
34
48
 
35
49
  public setEvents(events: Record<string, EventOption[]>) {
@@ -70,6 +84,10 @@ class Events extends BaseService {
70
84
  this.removeAllListeners();
71
85
  this.removeAllPlugins();
72
86
  }
87
+
88
+ public usePlugin(options: AsyncHookPlugin<AsyncMethodName, Events> & SyncHookPlugin<SyncMethodName, Events>): void {
89
+ super.usePlugin(options);
90
+ }
73
91
  }
74
92
 
75
93
  export type EventsService = Events;
@@ -128,12 +128,21 @@ export const advancedTabConfig: TabPaneConfig = {
128
128
  text: 'created',
129
129
  labelPosition: 'top',
130
130
  type: 'code-select',
131
+ extra: '组件初始化时执行',
131
132
  },
132
133
  {
133
134
  name: 'mounted',
134
135
  text: 'mounted',
135
136
  labelPosition: 'top',
136
137
  type: 'code-select',
138
+ extra: '组件挂载到dom时执行',
139
+ },
140
+ {
141
+ name: 'display',
142
+ text: 'display',
143
+ extra: '控制组件是否渲染,关系的代码块返回值为false时不渲染',
144
+ labelPosition: 'top',
145
+ type: 'code-select',
137
146
  },
138
147
  ],
139
148
  };
package/types/index.d.ts CHANGED
@@ -94,11 +94,11 @@ declare class export_default extends EventEmitter {
94
94
  private doTask;
95
95
  }
96
96
 
97
- declare const canUsePluginMethods$6: {
97
+ declare const canUsePluginMethods$7: {
98
98
  async: readonly ["setCodeDslById", "setEditStatus", "setCombineIds", "setUndeleteableList", "deleteCodeDslByIds"];
99
99
  sync: string[];
100
100
  };
101
- type AsyncMethodName$3 = Writable<(typeof canUsePluginMethods$6)['async']>;
101
+ type AsyncMethodName$4 = Writable<(typeof canUsePluginMethods$7)['async']>;
102
102
  declare class CodeBlock extends export_default {
103
103
  private state;
104
104
  constructor();
@@ -213,7 +213,7 @@ declare class CodeBlock extends export_default {
213
213
  paste(): void;
214
214
  resetState(): void;
215
215
  destroy(): void;
216
- usePlugin(options: AsyncHookPlugin<AsyncMethodName$3, CodeBlock>): void;
216
+ usePlugin(options: AsyncHookPlugin<AsyncMethodName$4, CodeBlock>): void;
217
217
  }
218
218
  type CodeBlockService = CodeBlock;
219
219
  declare const _default$H: CodeBlock;
@@ -241,11 +241,11 @@ interface State$2 {
241
241
  methods: Record<string, EventOption[]>;
242
242
  }
243
243
  type StateKey$1 = keyof State$2;
244
- declare const canUsePluginMethods$5: {
244
+ declare const canUsePluginMethods$6: {
245
245
  async: never[];
246
246
  sync: readonly ["getFormConfig", "setFormConfig", "getFormValue", "setFormValue", "getFormEvent", "setFormEvent", "getFormMethod", "setFormMethod", "add", "update", "remove", "createId"];
247
247
  };
248
- type SyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['sync']>;
248
+ type SyncMethodName$4 = Writable<(typeof canUsePluginMethods$6)['sync']>;
249
249
  declare class DataSource extends export_default {
250
250
  private state;
251
251
  constructor();
@@ -278,7 +278,7 @@ declare class DataSource extends export_default {
278
278
  getDataSourceById(id: string): DataSourceSchema | undefined;
279
279
  resetState(): void;
280
280
  destroy(): void;
281
- usePlugin(options: SyncHookPlugin<SyncMethodName$3, DataSource>): void;
281
+ usePlugin(options: SyncHookPlugin<SyncMethodName$4, DataSource>): void;
282
282
  /**
283
283
  * 复制时会带上组件关联的数据源
284
284
  * @param config 组件节点配置
@@ -359,11 +359,11 @@ interface EditorEvents {
359
359
  }];
360
360
  'history-change': [data: MPage | MPageFragment];
361
361
  }
362
- declare const canUsePluginMethods$4: {
362
+ declare const canUsePluginMethods$5: {
363
363
  async: readonly ["getLayout", "highlight", "select", "multiSelect", "doAdd", "add", "doRemove", "remove", "doUpdate", "update", "sort", "copy", "paste", "doPaste", "doAlignCenter", "alignCenter", "moveLayer", "moveToContainer", "dragTo", "undo", "redo", "move"];
364
364
  sync: never[];
365
365
  };
366
- type AsyncMethodName$2 = Writable<(typeof canUsePluginMethods$4)['async']>;
366
+ type AsyncMethodName$3 = Writable<(typeof canUsePluginMethods$5)['async']>;
367
367
  declare class Editor extends export_default {
368
368
  state: StoreState;
369
369
  private isHistoryStateChange;
@@ -514,7 +514,7 @@ declare class Editor extends export_default {
514
514
  resetState(): void;
515
515
  destroy(): void;
516
516
  resetModifiedNodeId(): void;
517
- usePlugin(options: AsyncHookPlugin<AsyncMethodName$2, Editor>): void;
517
+ usePlugin(options: AsyncHookPlugin<AsyncMethodName$3, Editor>): void;
518
518
  on<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, listener: (...args: Param) => void | Promise<void>): this;
519
519
  once<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, listener: (...args: Param) => void | Promise<void>): this;
520
520
  emit<Name extends keyof EditorEvents, Param extends EditorEvents[Name]>(eventName: Name, ...args: Param): boolean;
@@ -527,6 +527,12 @@ declare class Editor extends export_default {
527
527
  type EditorService = Editor;
528
528
  declare const _default$E: Editor;
529
529
 
530
+ declare const canUsePluginMethods$4: {
531
+ async: readonly [];
532
+ sync: readonly ["setEvent", "getEvent", "setMethod", "getMethod"];
533
+ };
534
+ type AsyncMethodName$2 = Writable<(typeof canUsePluginMethods$4)['async']>;
535
+ type SyncMethodName$3 = Writable<(typeof canUsePluginMethods$4)['sync']>;
530
536
  declare class Events extends export_default {
531
537
  constructor();
532
538
  setEvents(events: Record<string, EventOption[]>): void;
@@ -537,6 +543,7 @@ declare class Events extends export_default {
537
543
  getMethod(type: string): EventOption[];
538
544
  resetState(): void;
539
545
  destroy(): void;
546
+ usePlugin(options: AsyncHookPlugin<AsyncMethodName$2, Events> & SyncHookPlugin<SyncMethodName$3, Events>): void;
540
547
  }
541
548
  type EventsService = Events;
542
549
  declare const _default$D: Events;