plugin-tls 3.1.0 → 3.3.1

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.
Files changed (33) hide show
  1. package/dist/index.js +285 -185
  2. package/dist/index.umd.cjs +1 -1
  3. package/dist/options/options-plugin-host/tier-mode-options/createTierModeOptionsPluginHost.d.ts +4 -3
  4. package/dist/options/options-plugin-host/tier-mode-options/createTierModeOptionsPluginHost.d.ts.map +1 -1
  5. package/dist/options/options-plugin-host/tier-options/createTierOptionsPluginHost.d.ts +4 -3
  6. package/dist/options/options-plugin-host/tier-options/createTierOptionsPluginHost.d.ts.map +1 -1
  7. package/dist/plugin-host/PluginHost.d.ts +10 -4
  8. package/dist/plugin-host/PluginHost.d.ts.map +1 -1
  9. package/dist/plugin-host/PluginHostEventEmitter.d.ts +10 -4
  10. package/dist/plugin-host/PluginHostEventEmitter.d.ts.map +1 -1
  11. package/dist/plugin-host/PluginHostEventTarget.d.ts +10 -4
  12. package/dist/plugin-host/PluginHostEventTarget.d.ts.map +1 -1
  13. package/dist/plugin-host/createPluginHost.d.ts +10 -4
  14. package/dist/plugin-host/createPluginHost.d.ts.map +1 -1
  15. package/dist/plugin-host/decorator.d.ts +16 -10
  16. package/dist/plugin-host/decorator.d.ts.map +1 -1
  17. package/dist/plugin-host/type.d.ts +10 -4
  18. package/dist/plugin-host/type.d.ts.map +1 -1
  19. package/dist/plugin-manager/ExtendManager.d.ts +13 -4
  20. package/dist/plugin-manager/ExtendManager.d.ts.map +1 -1
  21. package/dist/plugin-manager/IExtend.d.ts +19 -26
  22. package/dist/plugin-manager/IExtend.d.ts.map +1 -1
  23. package/dist/plugin-manager/PluginExtendManager.d.ts +10 -3
  24. package/dist/plugin-manager/PluginExtendManager.d.ts.map +1 -1
  25. package/dist/plugin-manager/PluginManager.d.ts +6 -0
  26. package/dist/plugin-manager/PluginManager.d.ts.map +1 -1
  27. package/dist/plugin-manager/extend.d.ts +84 -0
  28. package/dist/plugin-manager/extend.d.ts.map +1 -0
  29. package/dist/plugin-manager/index.d.ts +1 -0
  30. package/dist/plugin-manager/index.d.ts.map +1 -1
  31. package/dist/plugin-manager/mixin.d.ts +12 -3
  32. package/dist/plugin-manager/mixin.d.ts.map +1 -1
  33. package/package.json +3 -3
package/dist/index.js CHANGED
@@ -1,7 +1,7 @@
1
1
  import { Destroyable as M, DestroyableEventEmitter as N, DestroyableEventTarget as H, createDestroyableSubClass as V } from "@gby/destroyable";
2
2
  import { serialCallFuns as g } from "com-tools";
3
3
  import { deepmergeInto as P, deepmerge as w } from "deepmerge-ts";
4
- function d(s, ...t) {
4
+ function u(s, ...t) {
5
5
  for (const e of t) {
6
6
  const n = Object.getOwnPropertyDescriptors(e);
7
7
  Object.defineProperties(s, n);
@@ -12,24 +12,48 @@ function B(s, t) {
12
12
  return t;
13
13
  }
14
14
  function K() {
15
- return function(t, e) {
16
- return e;
15
+ return function(t) {
16
+ return t;
17
17
  };
18
18
  }
19
19
  function R(s, t) {
20
- return d(s, t), t;
20
+ return u(s, t), t;
21
21
  }
22
22
  function W(s) {
23
23
  return function(e) {
24
- return d(s, e), e;
24
+ return u(s, e), e;
25
25
  };
26
26
  }
27
- function c(s, t) {
28
- return d(s, t), s;
27
+ function h(s, t) {
28
+ return u(s, t), s;
29
29
  }
30
30
  function G(s) {
31
31
  return function(e) {
32
- return d(s, e), s;
32
+ return u(s, e), s;
33
+ };
34
+ }
35
+ function J(s, t) {
36
+ return t;
37
+ }
38
+ function L() {
39
+ return function(t) {
40
+ return t;
41
+ };
42
+ }
43
+ function Q(s, t) {
44
+ return u(s.prototype, t), t;
45
+ }
46
+ function X(s) {
47
+ return function(e) {
48
+ return u(s.prototype, e), e;
49
+ };
50
+ }
51
+ function Y(s, t) {
52
+ return u(s.prototype, t), s;
53
+ }
54
+ function Z(s) {
55
+ return function(e) {
56
+ return u(s.prototype, e), s;
33
57
  };
34
58
  }
35
59
  const k = ["onCreate", "onInit", "onDestroy"];
@@ -39,13 +63,10 @@ function T(s) {
39
63
  typeof t[e] == "function" && delete t[e];
40
64
  return t;
41
65
  }
42
- function J(s, t) {
43
- return t;
44
- }
45
66
  function I(s) {
46
67
  return s && typeof s.onUse == "function";
47
68
  }
48
- class L extends M {
69
+ class tt extends M {
49
70
  /**
50
71
  * 插件的宿主
51
72
  */
@@ -63,6 +84,14 @@ class L extends M {
63
84
  destroyThis() {
64
85
  return this.plugins.clear(), this.host = null, super.destroyThis();
65
86
  }
87
+ /**
88
+ * 是否注册了插件
89
+ * @param plugin - 插件
90
+ * @returns 是否注册了插件
91
+ */
92
+ hasUsed(t) {
93
+ return this.plugins.has(t);
94
+ }
66
95
  /**
67
96
  * 使用插件、注册插件
68
97
  * @param plugin - 插件
@@ -84,8 +113,8 @@ class L extends M {
84
113
  instUse(t, e, ...n) {
85
114
  const { plugins: i } = this;
86
115
  if (i.has(e)) return i.get(e);
87
- const o = this.use(e, ...n);
88
- return e.onCreate?.(t), o;
116
+ const r = this.use(e, ...n);
117
+ return e.onCreate?.(t), r;
89
118
  }
90
119
  /**
91
120
  * 插件宿主创建实例时调用
@@ -129,7 +158,7 @@ class L extends M {
129
158
  return e.reverse(), g(e, void 0, [t]);
130
159
  }
131
160
  }
132
- class Q extends M {
161
+ class et extends M {
133
162
  /**
134
163
  * 插件的宿主
135
164
  */
@@ -147,14 +176,24 @@ class Q extends M {
147
176
  destroyThis() {
148
177
  return this.plugins.clear(), this.host = null, super.destroyThis();
149
178
  }
179
+ /**
180
+ * 是否注册了插件
181
+ * @param plugin - 插件
182
+ * @returns 是否注册了插件
183
+ */
184
+ hasUsed(t) {
185
+ return this.plugins.has(t);
186
+ }
150
187
  /**
151
188
  * 使用插件、注册插件
189
+ * @remarks
190
+ * 该函数的返回对象是插件对象本身,但返回的类型日排除了 IExtend 生命周期成员后的对宿主新增的成员,这样设计的目标是方便后续通过返回的类型直接对宿主的类型进行扩展
152
191
  * @param plugin - 插件
153
- * @param args - 传递给插件的选项
192
+ * @returns 返回插件对象本身
154
193
  */
155
194
  use(t) {
156
195
  const { plugins: e } = this;
157
- return e.has(t) ? !1 : (d(this.host.prototype, T(t)), e.add(t), !0);
196
+ return e.has(t) || (u(this.host.prototype, T(t)), e.add(t)), t;
158
197
  }
159
198
  /**
160
199
  * 插件宿主实例的注册插件的方法
@@ -165,7 +204,7 @@ class Q extends M {
165
204
  */
166
205
  instUse(t, e, ...n) {
167
206
  const { plugins: i } = this;
168
- return i.has(e) ? !1 : (this.use(e), e.onCreate?.call(t, t, ...n), !0);
207
+ return i.has(e) || (this.use(e), e.onCreate?.call(t, t, ...n)), e;
169
208
  }
170
209
  /**
171
210
  * 插件宿主创建实例时调用
@@ -210,7 +249,7 @@ class Q extends M {
210
249
  }
211
250
  }
212
251
  const O = /* @__PURE__ */ Symbol("extend");
213
- class p extends M {
252
+ class d extends M {
214
253
  /**
215
254
  * 插件的宿主
216
255
  */
@@ -228,6 +267,14 @@ class p extends M {
228
267
  destroyThis() {
229
268
  return this.plugins.clear(), this.host = null, super.destroyThis();
230
269
  }
270
+ /**
271
+ * 是否注册了插件 或 扩展
272
+ * @param plugin - 插件 或 扩展
273
+ * @returns 是否注册了插件 或 扩展
274
+ */
275
+ hasUsed(t) {
276
+ return this.plugins.has(t);
277
+ }
231
278
  /**
232
279
  * 判断一个对象是否是插件
233
280
  * @param target
@@ -244,7 +291,7 @@ class p extends M {
244
291
  */
245
292
  useExtend(t) {
246
293
  const { plugins: e } = this;
247
- return e.has(t) ? !1 : (d(this.host.prototype, T(t)), e.set(t, O), !0);
294
+ return e.has(t) ? e.get(t) : (u(this.host.prototype, T(t)), e.set(t, O), t);
248
295
  }
249
296
  /**
250
297
  * 插件宿主实例的注册插件的方法
@@ -255,7 +302,7 @@ class p extends M {
255
302
  */
256
303
  instUseExtend(t, e, ...n) {
257
304
  const { plugins: i } = this;
258
- return i.has(e) ? !1 : (this.useExtend(e), e.onCreate?.call(t, t, ...n), !0);
305
+ return i.has(e) ? i.get(e) : (this.useExtend(e), e.onCreate?.call(t, t, ...n), e);
259
306
  }
260
307
  /**
261
308
  * 使用插件、注册插件
@@ -278,8 +325,8 @@ class p extends M {
278
325
  instUsePlugin(t, e, ...n) {
279
326
  const { plugins: i } = this;
280
327
  if (i.has(e)) return i.get(e);
281
- const o = this.usePlugin(e, ...n);
282
- return e.onCreate?.(t), o;
328
+ const r = this.usePlugin(e, ...n);
329
+ return e.onCreate?.(t), r;
283
330
  }
284
331
  /**
285
332
  * 插件宿主创建实例时调用
@@ -291,10 +338,10 @@ class p extends M {
291
338
  */
292
339
  onCreate(t, ...e) {
293
340
  const n = [];
294
- for (const [i, o] of this.plugins)
341
+ for (const [i, r] of this.plugins)
295
342
  if (i.onCreate) {
296
- const r = o === O ? i.onCreate : i.onCreate.bind(i);
297
- n.push(r);
343
+ const o = r === O ? i.onCreate : i.onCreate.bind(i);
344
+ n.push(o);
298
345
  }
299
346
  return g(n, t, [t, ...e]);
300
347
  }
@@ -308,10 +355,10 @@ class p extends M {
308
355
  */
309
356
  onInit(t, ...e) {
310
357
  const n = [];
311
- for (const [i, o] of this.plugins)
358
+ for (const [i, r] of this.plugins)
312
359
  if (i.onInit) {
313
- const r = o === O ? i.onInit : i.onInit.bind(i);
314
- n.push(r);
360
+ const o = r === O ? i.onInit : i.onInit.bind(i);
361
+ n.push(o);
315
362
  }
316
363
  return g(n, t, [t, ...e]);
317
364
  }
@@ -326,16 +373,16 @@ class p extends M {
326
373
  const e = [];
327
374
  for (const [n, i] of this.plugins)
328
375
  if (n.onDestroy) {
329
- const o = i === O ? n.onDestroy : n.onDestroy.bind(n);
330
- e.push(o);
376
+ const r = i === O ? n.onDestroy : n.onDestroy.bind(n);
377
+ e.push(r);
331
378
  }
332
379
  return e.reverse(), g(e, t, [t]);
333
380
  }
334
381
  }
335
- function X(s, t) {
382
+ function nt(s, t) {
336
383
  const e = t ?? "defaultOptions", n = `_${e}`;
337
- return function(o) {
338
- const r = c(o, {
384
+ return function(r) {
385
+ const o = h(r, {
339
386
  /**
340
387
  * 全局级别的默认选项
341
388
  */
@@ -343,19 +390,19 @@ function X(s, t) {
343
390
  return s;
344
391
  }
345
392
  });
346
- c(r.prototype, {
393
+ h(o.prototype, {
347
394
  /**
348
395
  * 实例级的默认选项
349
396
  */
350
397
  get [e]() {
351
- return this[n] || (this[n] = structuredClone(r.defaultOptions));
398
+ return this[n] || (this[n] = structuredClone(o.defaultOptions));
352
399
  }
353
400
  });
354
401
  };
355
402
  }
356
- function Y(s, t, e) {
403
+ function st(s, t, e) {
357
404
  const n = `_${t}`;
358
- return c(s.prototype, {
405
+ return h(s.prototype, {
359
406
  /**
360
407
  * 实例级的默认选项
361
408
  */
@@ -364,7 +411,7 @@ function Y(s, t, e) {
364
411
  }
365
412
  }), e;
366
413
  }
367
- function b(s) {
414
+ function E(s) {
368
415
  const t = s.split(".");
369
416
  return t[0] === "" && t.shift(), t;
370
417
  }
@@ -373,24 +420,24 @@ function y(s, t) {
373
420
  if (s = s[e], s == null) return;
374
421
  return s;
375
422
  }
376
- function Z(s, t) {
377
- return y(s, b(t));
423
+ function it(s, t) {
424
+ return y(s, E(t));
378
425
  }
379
- function E(s, t, e) {
426
+ function U(s, t, e) {
380
427
  const n = t.pop(), i = t.length;
381
- let o = 0;
382
- for (; o < i; ) {
383
- const r = s[t[o]];
384
- if (r == null) break;
385
- s = r, o++;
386
- }
387
- t = t.slice(o);
388
- for (const r of t)
389
- s = s[r] = {};
428
+ let r = 0;
429
+ for (; r < i; ) {
430
+ const o = s[t[r]];
431
+ if (o == null) break;
432
+ s = o, r++;
433
+ }
434
+ t = t.slice(r);
435
+ for (const o of t)
436
+ s = s[o] = {};
390
437
  return s[n] = e, s;
391
438
  }
392
- function tt(s, t, e) {
393
- return E(s, b(t), e);
439
+ function rt(s, t, e) {
440
+ return U(s, E(t), e);
394
441
  }
395
442
  const x = {
396
443
  UndefinedAndNull: function(t) {
@@ -403,7 +450,7 @@ const x = {
403
450
  return t === null;
404
451
  }
405
452
  };
406
- class v {
453
+ class b {
407
454
  /**
408
455
  * 是否要冻结 fullOption 的成员
409
456
  * @remarks
@@ -491,8 +538,8 @@ class v {
491
538
  if (e === void 0)
492
539
  delete i[t];
493
540
  else {
494
- const o = i[t];
495
- n && o && typeof o == "object" ? P(o, e) : i[t] = e;
541
+ const r = i[t];
542
+ n && r && typeof r == "object" ? P(r, e) : i[t] = e;
496
543
  }
497
544
  this.updateFullOption();
498
545
  }
@@ -513,11 +560,11 @@ class v {
513
560
  */
514
561
  setValue(t, e, n) {
515
562
  const i = this.option;
516
- let o;
517
- n && (o = y(i, t)) && typeof o == "object" ? P(o, e) : E(this.option, t, e), this.updateFullOption();
563
+ let r;
564
+ n && (r = y(i, t)) && typeof r == "object" ? P(r, e) : U(this.option, t, e), this.updateFullOption();
518
565
  }
519
566
  }
520
- class u extends v {
567
+ class a extends b {
521
568
  constructor(t, e) {
522
569
  super(), t && (this.option = t), e && (this.extends = e);
523
570
  }
@@ -582,15 +629,15 @@ class u extends v {
582
629
  return n.getValue(t);
583
630
  }
584
631
  }
585
- function et(s, t) {
632
+ function ot(s, t) {
586
633
  const { name: e } = t, n = `_${e}`;
587
634
  return {
588
635
  get: function() {
589
- return this[n] || (this[n] = new u(void 0, this.constructor[e]));
636
+ return this[n] || (this[n] = new a(void 0, this.constructor[e]));
590
637
  }
591
638
  };
592
639
  }
593
- class S extends v {
640
+ class S extends b {
594
641
  constructor(t, e) {
595
642
  super(), e && this.setModeOption(t, e), this.mode = t;
596
643
  }
@@ -680,15 +727,15 @@ class S extends v {
680
727
  * @param extend - 继承哪个模式
681
728
  */
682
729
  setModeOption(t, e, n, i) {
683
- const { modes: o } = this, r = o[t] || (o[t] = new u());
684
- if (r.setOption(e, n), i) {
685
- const l = o[i];
686
- l && (r.extends = l);
730
+ const { modes: r } = this, o = r[t] || (r[t] = new a());
731
+ if (o.setOption(e, n), i) {
732
+ const p = r[i];
733
+ p && (o.extends = p);
687
734
  }
688
- return this.updateFullOption(), r;
735
+ return this.updateFullOption(), o;
689
736
  }
690
737
  }
691
- class a extends S {
738
+ class l extends S {
692
739
  constructor(t, e, n) {
693
740
  super(t, e), n && (this.extends = n);
694
741
  }
@@ -712,8 +759,8 @@ class a extends S {
712
759
  getFullModeOption(t) {
713
760
  const { modes: e, extends: n } = this, i = e[t]?.plainFullOption;
714
761
  if (n) {
715
- const o = n.getFullModeOption(t);
716
- return i ? w(o, i) : o;
762
+ const r = n.getFullModeOption(t);
763
+ return i ? w(r, i) : r;
717
764
  }
718
765
  return i;
719
766
  }
@@ -777,15 +824,15 @@ class a extends S {
777
824
  return n.getValue(t);
778
825
  }
779
826
  }
780
- function nt(s, t) {
827
+ function ut(s, t) {
781
828
  const { name: e } = t, n = `_${e}`;
782
829
  return {
783
830
  get: function() {
784
- return this[n] || (this[n] = new a(this.constructor[e].mode, void 0, this.constructor[e]));
831
+ return this[n] || (this[n] = new l(this.constructor[e].mode, void 0, this.constructor[e]));
785
832
  }
786
833
  };
787
834
  }
788
- class F extends M {
835
+ class v extends M {
789
836
  /**
790
837
  * 是否使用独立的插件管理器
791
838
  * @defaultValue false
@@ -795,9 +842,9 @@ class F extends M {
795
842
  * 插件管理器
796
843
  */
797
844
  static get pluginManager() {
798
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
845
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
799
846
  }
800
- static _pluginManager = new p(this);
847
+ static _pluginManager = new d(this);
801
848
  /**
802
849
  * 插件管理器 {@link PluginHost.pluginManager}
803
850
  */
@@ -816,6 +863,14 @@ class F extends M {
816
863
  static useExtend(t) {
817
864
  return this.pluginManager.useExtend(t);
818
865
  }
866
+ /**
867
+ * 是否注册了插件 或 扩展
868
+ * @param plugin - 插件 或 扩展
869
+ * @returns 是否注册了插件 或 扩展
870
+ */
871
+ static hasUsed(t) {
872
+ return this.pluginManager.hasUsed(t);
873
+ }
819
874
  /**
820
875
  * 需要在子类中调用
821
876
  *
@@ -860,7 +915,7 @@ class F extends M {
860
915
  return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
861
916
  }
862
917
  }
863
- class U extends N {
918
+ class F extends N {
864
919
  /**
865
920
  * 是否使用独立的插件管理器
866
921
  * @defaultValue false
@@ -870,9 +925,9 @@ class U extends N {
870
925
  * 插件管理器
871
926
  */
872
927
  static get pluginManager() {
873
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
928
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
874
929
  }
875
- static _pluginManager = new p(this);
930
+ static _pluginManager = new d(this);
876
931
  /**
877
932
  * 插件管理器 {@link PluginHost.pluginManager}
878
933
  */
@@ -891,6 +946,14 @@ class U extends N {
891
946
  static useExtend(t) {
892
947
  return this.pluginManager.useExtend(t);
893
948
  }
949
+ /**
950
+ * 是否注册了插件 或 扩展
951
+ * @param plugin - 插件 或 扩展
952
+ * @returns 是否注册了插件 或 扩展
953
+ */
954
+ static hasUsed(t) {
955
+ return this.pluginManager.hasUsed(t);
956
+ }
894
957
  /**
895
958
  * 需要在子类中调用
896
959
  *
@@ -945,9 +1008,9 @@ class D extends H {
945
1008
  * 插件管理器
946
1009
  */
947
1010
  static get pluginManager() {
948
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
1011
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
949
1012
  }
950
- static _pluginManager = new p(this);
1013
+ static _pluginManager = new d(this);
951
1014
  /**
952
1015
  * 插件管理器 {@link PluginHost.pluginManager}
953
1016
  */
@@ -966,6 +1029,14 @@ class D extends H {
966
1029
  static useExtend(t) {
967
1030
  return this.pluginManager.useExtend(t);
968
1031
  }
1032
+ /**
1033
+ * 是否注册了插件 或 扩展
1034
+ * @param plugin - 插件 或 扩展
1035
+ * @returns 是否注册了插件 或 扩展
1036
+ */
1037
+ static hasUsed(t) {
1038
+ return this.pluginManager.hasUsed(t);
1039
+ }
969
1040
  /**
970
1041
  * 需要在子类中调用
971
1042
  *
@@ -1022,9 +1093,9 @@ function C(s) {
1022
1093
  * 插件管理器
1023
1094
  */
1024
1095
  static get pluginManager() {
1025
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
1096
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1026
1097
  }
1027
- static _pluginManager = new p(this);
1098
+ static _pluginManager = new d(this);
1028
1099
  /**
1029
1100
  * 插件管理器 {@link PluginHostSub.pluginManager}
1030
1101
  */
@@ -1043,6 +1114,14 @@ function C(s) {
1043
1114
  static useExtend(n) {
1044
1115
  return this.pluginManager.useExtend(n);
1045
1116
  }
1117
+ /**
1118
+ * 是否注册了插件 或 扩展
1119
+ * @param plugin - 插件 或 扩展
1120
+ * @returns 是否注册了插件 或 扩展
1121
+ */
1122
+ static hasUsed(n) {
1123
+ return this.pluginManager.hasUsed(n);
1124
+ }
1046
1125
  /**
1047
1126
  * 需要在子类中调用
1048
1127
  *
@@ -1088,7 +1167,7 @@ function C(s) {
1088
1167
  };
1089
1168
  }
1090
1169
  function j(s) {
1091
- const t = c(s, {
1170
+ const t = h(s, {
1092
1171
  /**
1093
1172
  * 是否使用独立的插件管理器
1094
1173
  * @defaultValue false
@@ -1098,7 +1177,7 @@ function j(s) {
1098
1177
  * PluginHost 的插件管理器
1099
1178
  */
1100
1179
  get pluginManager() {
1101
- return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new p(this)), this._pluginManager;
1180
+ return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new d(this)), this._pluginManager;
1102
1181
  },
1103
1182
  // _pluginManager: PluginManager<HOST,Plugin>;
1104
1183
  /**
@@ -1112,9 +1191,17 @@ function j(s) {
1112
1191
  */
1113
1192
  useExtend(e) {
1114
1193
  return this.pluginManager.useExtend(e);
1194
+ },
1195
+ /**
1196
+ * 是否注册了插件 或 扩展
1197
+ * @param plugin - 插件 或 扩展
1198
+ * @returns 是否注册了插件 或 扩展
1199
+ */
1200
+ hasUsed(e) {
1201
+ return this.pluginManager.hasUsed(e);
1115
1202
  }
1116
1203
  });
1117
- return c(t.prototype, {
1204
+ return h(t.prototype, {
1118
1205
  /**
1119
1206
  * 插件管理器
1120
1207
  */
@@ -1152,16 +1239,16 @@ function j(s) {
1152
1239
  }
1153
1240
  }), s;
1154
1241
  }
1155
- function it(s) {
1242
+ function lt(s) {
1156
1243
  const t = j(s);
1157
1244
  return new Proxy(t, {
1158
1245
  construct: function(e, n, i) {
1159
- const o = new e(...n);
1160
- return t.pluginManager.onCreate(this, ...n), o;
1246
+ const r = new e(...n);
1247
+ return t.pluginManager.onCreate(this, ...n), r;
1161
1248
  }
1162
1249
  });
1163
1250
  }
1164
- function rt(s) {
1251
+ function dt(s) {
1165
1252
  return class extends s {
1166
1253
  /**
1167
1254
  * 是否使用独立的插件管理器
@@ -1172,9 +1259,9 @@ function rt(s) {
1172
1259
  * 插件管理器
1173
1260
  */
1174
1261
  static get pluginManager() {
1175
- return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new p(this)), this._pluginManager;
1262
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new d(this)), this._pluginManager;
1176
1263
  }
1177
- static _pluginManager = new p(this);
1264
+ static _pluginManager = new d(this);
1178
1265
  /**
1179
1266
  * 插件管理器 {@link PluginHostExtends.pluginManager}
1180
1267
  */
@@ -1193,6 +1280,14 @@ function rt(s) {
1193
1280
  static useExtend(e) {
1194
1281
  return this.pluginManager.useExtend(e);
1195
1282
  }
1283
+ /**
1284
+ * 是否注册了插件 或 扩展
1285
+ * @param plugin - 插件 或 扩展
1286
+ * @returns 是否注册了插件 或 扩展
1287
+ */
1288
+ static hasUsed(e) {
1289
+ return this.pluginManager.hasUsed(e);
1290
+ }
1196
1291
  constructor(...e) {
1197
1292
  super(...e), this.pluginManager.onCreate(this, ...e);
1198
1293
  }
@@ -1235,66 +1330,66 @@ function rt(s) {
1235
1330
  }
1236
1331
  };
1237
1332
  }
1238
- class ut extends F {
1333
+ class gt extends v {
1239
1334
  /**
1240
1335
  * 全局级别的默认选项
1241
1336
  */
1242
- static defaultOptions = new u();
1337
+ static defaultOptions = new a();
1243
1338
  /**
1244
1339
  * 实例级的默认选项
1245
1340
  */
1246
1341
  get defaultOptions() {
1247
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1342
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1248
1343
  }
1249
1344
  _defaultOptions;
1250
1345
  constructor(t) {
1251
1346
  super(), this.defaultOptions.option = t;
1252
1347
  }
1253
1348
  }
1254
- class at extends U {
1349
+ class ht extends F {
1255
1350
  /**
1256
1351
  * 全局级别的默认选项
1257
1352
  */
1258
- static defaultOptions = new u();
1353
+ static defaultOptions = new a();
1259
1354
  /**
1260
1355
  * 实例级的默认选项
1261
1356
  */
1262
1357
  get defaultOptions() {
1263
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1358
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1264
1359
  }
1265
1360
  _defaultOptions;
1266
1361
  constructor(t) {
1267
1362
  super(), this.defaultOptions.option = t;
1268
1363
  }
1269
1364
  }
1270
- class lt extends D {
1365
+ class ct extends D {
1271
1366
  /**
1272
1367
  * 全局级别的默认选项
1273
1368
  */
1274
- static defaultOptions = new u();
1369
+ static defaultOptions = new a();
1275
1370
  /**
1276
1371
  * 实例级的默认选项
1277
1372
  */
1278
1373
  get defaultOptions() {
1279
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1374
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1280
1375
  }
1281
1376
  _defaultOptions;
1282
1377
  constructor(t) {
1283
1378
  super(), this.defaultOptions.option = t;
1284
1379
  }
1285
1380
  }
1286
- function dt(s) {
1381
+ function Ot(s) {
1287
1382
  const t = C(s);
1288
1383
  return class extends t {
1289
1384
  /**
1290
1385
  * 全局级别的默认选项
1291
1386
  */
1292
- static defaultOptions = new u();
1387
+ static defaultOptions = new a();
1293
1388
  /**
1294
1389
  * 实例级的默认选项
1295
1390
  */
1296
1391
  get defaultOptions() {
1297
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1392
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1298
1393
  }
1299
1394
  _defaultOptions;
1300
1395
  constructor(n) {
@@ -1302,17 +1397,17 @@ function dt(s) {
1302
1397
  }
1303
1398
  };
1304
1399
  }
1305
- const h = "common";
1306
- class gt extends F {
1400
+ const c = "common";
1401
+ class mt extends v {
1307
1402
  /**
1308
1403
  * 全局级别的默认选项
1309
1404
  */
1310
- static modeOptions = new a(h);
1405
+ static modeOptions = new l(c);
1311
1406
  /**
1312
1407
  * 实例级的默认选项
1313
1408
  */
1314
1409
  get modeOptions() {
1315
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1410
+ return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1316
1411
  }
1317
1412
  _modeOptions;
1318
1413
  get mode() {
@@ -1328,16 +1423,16 @@ class gt extends F {
1328
1423
  super(), this.modeOptions.setOption(t);
1329
1424
  }
1330
1425
  }
1331
- class ct extends U {
1426
+ class Mt extends F {
1332
1427
  /**
1333
1428
  * 全局级别的默认选项
1334
1429
  */
1335
- static modeOptions = new a(h);
1430
+ static modeOptions = new l(c);
1336
1431
  /**
1337
1432
  * 实例级的默认选项
1338
1433
  */
1339
1434
  get modeOptions() {
1340
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1435
+ return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1341
1436
  }
1342
1437
  _modeOptions;
1343
1438
  get mode() {
@@ -1353,16 +1448,16 @@ class ct extends U {
1353
1448
  super(), this.modeOptions.setOption(t);
1354
1449
  }
1355
1450
  }
1356
- class ht extends D {
1451
+ class Pt extends D {
1357
1452
  /**
1358
1453
  * 全局级别的默认选项
1359
1454
  */
1360
- static modeOptions = new a(h);
1455
+ static modeOptions = new l(c);
1361
1456
  /**
1362
1457
  * 实例级的默认选项
1363
1458
  */
1364
1459
  get modeOptions() {
1365
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1460
+ return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1366
1461
  }
1367
1462
  _modeOptions;
1368
1463
  get mode() {
@@ -1378,18 +1473,18 @@ class ht extends D {
1378
1473
  super(), this.modeOptions.setOption(t);
1379
1474
  }
1380
1475
  }
1381
- function Ot(s) {
1476
+ function yt(s) {
1382
1477
  const t = C(s);
1383
1478
  return class extends t {
1384
1479
  /**
1385
1480
  * 全局级别的默认选项
1386
1481
  */
1387
- static modeOptions = new a(h);
1482
+ static modeOptions = new l(c);
1388
1483
  /**
1389
1484
  * 实例级的默认选项
1390
1485
  */
1391
1486
  get modeOptions() {
1392
- return this._modeOptions || (this._modeOptions = new a(h, void 0, this.constructor.modeOptions));
1487
+ return this._modeOptions || (this._modeOptions = new l(c, void 0, this.constructor.modeOptions));
1393
1488
  }
1394
1489
  _modeOptions;
1395
1490
  get mode() {
@@ -1406,19 +1501,19 @@ function Ot(s) {
1406
1501
  }
1407
1502
  };
1408
1503
  }
1409
- function mt(s, t, e) {
1410
- const n = c(s, {
1504
+ function _t(s, t, e) {
1505
+ const n = h(s, {
1411
1506
  /**
1412
1507
  * 全局级别的默认选项
1413
1508
  */
1414
- modeOptions: new a(t, e)
1509
+ modeOptions: new l(t, e)
1415
1510
  });
1416
- return c(n.prototype, {
1511
+ return h(n.prototype, {
1417
1512
  /**
1418
1513
  * 实例级的默认选项
1419
1514
  */
1420
1515
  get modeOptions() {
1421
- return this._modeOptions || (this._modeOptions = new a(t, void 0, this.constructor.modeOptions));
1516
+ return this._modeOptions || (this._modeOptions = new l(t, void 0, this.constructor.modeOptions));
1422
1517
  },
1423
1518
  get mode() {
1424
1519
  return this.modeOptions.mode;
@@ -1431,30 +1526,30 @@ function mt(s, t, e) {
1431
1526
  }
1432
1527
  }), s;
1433
1528
  }
1434
- const Mt = {
1529
+ const wt = {
1435
1530
  onUse(s, t, e) {
1436
- const n = t ?? h;
1437
- d(s, {
1438
- modeOptions: new a(
1531
+ const n = t ?? c;
1532
+ u(s, {
1533
+ modeOptions: new l(
1439
1534
  n,
1440
1535
  void 0,
1441
1536
  e
1442
1537
  )
1443
- }), d(s.prototype, {
1538
+ }), u(s.prototype, {
1444
1539
  get modeOptions() {
1445
- const i = this, o = s;
1446
- return i._modeOptions || (i._modeOptions = new a(
1447
- o.modeOptions.mode,
1540
+ const i = this, r = s;
1541
+ return i._modeOptions || (i._modeOptions = new l(
1542
+ r.modeOptions.mode,
1448
1543
  void 0,
1449
- o.modeOptions
1544
+ r.modeOptions
1450
1545
  ));
1451
1546
  },
1452
1547
  get mode() {
1453
1548
  return this.modeOptions.mode;
1454
1549
  },
1455
1550
  set mode(i) {
1456
- const o = this;
1457
- o.modeOptions.mode = i;
1551
+ const r = this;
1552
+ r.modeOptions.mode = i;
1458
1553
  },
1459
1554
  get options() {
1460
1555
  return this.modeOptions.plainFullOption;
@@ -1464,19 +1559,19 @@ const Mt = {
1464
1559
  onCreate(s, t) {
1465
1560
  s.modeOptions.setOption(t);
1466
1561
  }
1467
- }, Pt = {
1562
+ }, Tt = {
1468
1563
  onUse(s, t, e) {
1469
- d(s, {
1564
+ u(s, {
1470
1565
  /**
1471
1566
  * 全局级别的默认选项
1472
1567
  */
1473
- defaultOptions: new u(t, e)
1474
- }), d(s.prototype, {
1568
+ defaultOptions: new a(t, e)
1569
+ }), u(s.prototype, {
1475
1570
  /**
1476
1571
  * 实例级的默认选项
1477
1572
  */
1478
1573
  get defaultOptions() {
1479
- return this._defaultOptions || (this._defaultOptions = new u(void 0, s.defaultOptions));
1574
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, s.defaultOptions));
1480
1575
  }
1481
1576
  });
1482
1577
  },
@@ -1484,19 +1579,19 @@ const Mt = {
1484
1579
  s.defaultOptions.option = t;
1485
1580
  }
1486
1581
  };
1487
- function xt(s, t) {
1488
- const e = c(s, {
1582
+ function Et(s, t) {
1583
+ const e = h(s, {
1489
1584
  /**
1490
1585
  * 全局级别的默认选项
1491
1586
  */
1492
- defaultOptions: new u(t)
1587
+ defaultOptions: new a(t)
1493
1588
  });
1494
- return c(e.prototype, {
1589
+ return h(e.prototype, {
1495
1590
  /**
1496
1591
  * 实例级的默认选项
1497
1592
  */
1498
1593
  get defaultOptions() {
1499
- return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
1594
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
1500
1595
  }
1501
1596
  }), s;
1502
1597
  }
@@ -1504,13 +1599,13 @@ function _(s, t) {
1504
1599
  const e = [{ target: s, props: t }];
1505
1600
  let n;
1506
1601
  for (; n = e.shift(); ) {
1507
- const { target: i, props: o } = n;
1508
- for (const [r, l] of Object.entries(o)) {
1509
- if (l != null && typeof l == "object" && (!l.constructor || l.constructor === Object)) {
1510
- e.push({ target: i[r], props: l });
1602
+ const { target: i, props: r } = n;
1603
+ for (const [o, p] of Object.entries(r)) {
1604
+ if (p != null && typeof p == "object" && (!p.constructor || p.constructor === Object)) {
1605
+ e.push({ target: i[o], props: p });
1511
1606
  continue;
1512
1607
  }
1513
- i[r] = l;
1608
+ i[o] = p;
1514
1609
  }
1515
1610
  }
1516
1611
  return s;
@@ -1519,18 +1614,18 @@ function A(s, t) {
1519
1614
  const e = {}, n = [{ target: s, props: t, targetProps: e }];
1520
1615
  let i;
1521
1616
  for (; i = n.shift(); ) {
1522
- const { target: o, props: r, targetProps: l } = i;
1523
- for (const [m, f] of Object.entries(r)) {
1617
+ const { target: r, props: o, targetProps: p } = i;
1618
+ for (const [m, f] of Object.entries(o)) {
1524
1619
  if (f != null && typeof f == "object" && (!f.constructor || f.constructor === Object)) {
1525
- n.push({ target: o[m], props: f, targetProps: l[m] = {} });
1620
+ n.push({ target: r[m], props: f, targetProps: p[m] = {} });
1526
1621
  continue;
1527
1622
  }
1528
- l[m] = o[m];
1623
+ p[m] = r[m];
1529
1624
  }
1530
1625
  }
1531
1626
  return e;
1532
1627
  }
1533
- function yt(s, t) {
1628
+ function Ut(s, t) {
1534
1629
  const e = A(s, t);
1535
1630
  function n() {
1536
1631
  _(s, t);
@@ -1541,53 +1636,58 @@ function yt(s, t) {
1541
1636
  return { set: n, unset: i };
1542
1637
  }
1543
1638
  export {
1544
- Q as ExtendManager,
1639
+ et as ExtendManager,
1545
1640
  S as ModeOptions,
1546
- p as PluginExtendManager,
1547
- F as PluginHost,
1548
- U as PluginHostEventEmitter,
1641
+ d as PluginExtendManager,
1642
+ v as PluginHost,
1643
+ F as PluginHostEventEmitter,
1549
1644
  D as PluginHostEventTarget,
1550
- L as PluginManager,
1551
- a as TierModeOptions,
1552
- gt as TierModeOptionsPluginHost,
1553
- ct as TierModeOptionsPluginHostEventEmitter,
1554
- ht as TierModeOptionsPluginHostEventTarget,
1555
- u as TierOptions,
1556
- ut as TierOptionsPluginHost,
1557
- at as TierOptionsPluginHostEventEmitter,
1558
- lt as TierOptionsPluginHostEventTarget,
1559
- X as addDefaultOptions,
1560
- Y as addInstOptions,
1645
+ tt as PluginManager,
1646
+ l as TierModeOptions,
1647
+ mt as TierModeOptionsPluginHost,
1648
+ Mt as TierModeOptionsPluginHostEventEmitter,
1649
+ Pt as TierModeOptionsPluginHostEventTarget,
1650
+ a as TierOptions,
1651
+ gt as TierOptionsPluginHost,
1652
+ ht as TierOptionsPluginHostEventEmitter,
1653
+ ct as TierOptionsPluginHostEventTarget,
1654
+ nt as addDefaultOptions,
1655
+ st as addInstOptions,
1561
1656
  j as becomePluginHost,
1562
- rt as becomePluginHost_Extends,
1563
- it as becomePluginHost_Proxy,
1564
- mt as becomeTierModeOptionsHost,
1565
- xt as becomeTierOptionsHost,
1566
- h as commonModeName,
1657
+ dt as becomePluginHost_Extends,
1658
+ lt as becomePluginHost_Proxy,
1659
+ _t as becomeTierModeOptionsHost,
1660
+ Et as becomeTierOptionsHost,
1661
+ c as commonModeName,
1662
+ L as createDefineExtend,
1567
1663
  K as createDefineMixin,
1664
+ Z as createExtendTarget,
1568
1665
  G as createMixinTarget,
1569
1666
  C as createPluginHost,
1570
- yt as createPropertySetter,
1667
+ Ut as createPropertySetter,
1668
+ X as createTargetExtend,
1571
1669
  W as createTargetMixin,
1572
- Ot as createTierModeOptionsPluginHost,
1573
- dt as createTierOptionsPluginHost,
1670
+ yt as createTierModeOptionsPluginHost,
1671
+ Ot as createTierOptionsPluginHost,
1574
1672
  J as defineExtend,
1575
1673
  B as defineMixin,
1576
1674
  O as extendMark,
1675
+ Y as extendTarget,
1577
1676
  y as getPropertyValue,
1578
- Z as getPropertyValueByPath,
1677
+ it as getPropertyValueByPath,
1579
1678
  A as getTargetProperties,
1580
1679
  I as isPlugin,
1581
1680
  _ as mergeProperties,
1582
- d as mixin,
1583
- c as mixinTarget,
1584
- b as parsePropertyPath,
1681
+ u as mixin,
1682
+ h as mixinTarget,
1683
+ E as parsePropertyPath,
1585
1684
  T as pickHostExtendMembers,
1586
- E as setPropertyValue,
1587
- tt as setPropertyValueByPath,
1685
+ U as setPropertyValue,
1686
+ rt as setPropertyValueByPath,
1687
+ Q as targetExtend,
1588
1688
  R as targetMixin,
1589
- nt as tierModeOptionsDecorator,
1590
- Mt as tierModeOptionsPlugin,
1591
- et as tierOptionsDecorator,
1592
- Pt as tierOptionsPlugin
1689
+ ut as tierModeOptionsDecorator,
1690
+ wt as tierModeOptionsPlugin,
1691
+ ot as tierOptionsDecorator,
1692
+ Tt as tierOptionsPlugin
1593
1693
  };