plugin-tls 3.6.0 → 4.0.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 (45) hide show
  1. package/dist/Destroyable-BqvuD4gL-Cmk1ocqj.cjs +1 -0
  2. package/dist/Destroyable-BqvuD4gL-D50ZO9eN.js +129 -0
  3. package/dist/createTierModeOptionsPluginHost-C3kmxB00.cjs +1 -0
  4. package/dist/createTierModeOptionsPluginHost-CeND_z6P.js +852 -0
  5. package/dist/index-node.cjs +1 -1
  6. package/dist/index-node.d.ts +0 -1
  7. package/dist/index-node.d.ts.map +1 -1
  8. package/dist/index-node.js +254 -56
  9. package/dist/index-web.cjs +1 -1
  10. package/dist/index-web.d.ts +0 -1
  11. package/dist/index-web.d.ts.map +1 -1
  12. package/dist/index-web.js +324 -56
  13. package/dist/index.cjs +1 -1
  14. package/dist/index.d.ts +4 -5
  15. package/dist/index.d.ts.map +1 -1
  16. package/dist/index.js +628 -60
  17. package/dist/options/index-node.d.ts +0 -1
  18. package/dist/options/index-node.d.ts.map +1 -1
  19. package/dist/options/index-web.d.ts +0 -1
  20. package/dist/options/index-web.d.ts.map +1 -1
  21. package/dist/options/{index-com.d.ts → index.d.ts} +1 -1
  22. package/dist/options/index.d.ts.map +1 -0
  23. package/dist/options/plugins/tier-mode-options/type.d.ts +1 -1
  24. package/dist/options/plugins/tier-mode-options/type.d.ts.map +1 -1
  25. package/dist/options/plugins/tier-options/type.d.ts +1 -1
  26. package/dist/options/plugins/tier-options/type.d.ts.map +1 -1
  27. package/dist/plugin-host/PluginHostEventEmitter.d.ts +2 -2
  28. package/dist/plugin-host/PluginHostEventEmitter.d.ts.map +1 -1
  29. package/dist/plugin-host/PluginHostEventTarget.d.ts +1 -1
  30. package/dist/plugin-host/PluginHostEventTarget.d.ts.map +1 -1
  31. package/dist/plugin-host/index-node.d.ts +0 -1
  32. package/dist/plugin-host/index-node.d.ts.map +1 -1
  33. package/dist/plugin-host/index-web.d.ts +0 -1
  34. package/dist/plugin-host/index-web.d.ts.map +1 -1
  35. package/dist/plugin-host/{index-com.d.ts → index.d.ts} +1 -1
  36. package/dist/plugin-host/index.d.ts.map +1 -0
  37. package/package.json +2 -7
  38. package/dist/TierOptionsPluginHostEventEmitter-BjGVIRN6.cjs +0 -1
  39. package/dist/TierOptionsPluginHostEventEmitter-DXTNpSmS.js +0 -131
  40. package/dist/TierOptionsPluginHostEventTarget-Bok_zzQ1.js +0 -131
  41. package/dist/TierOptionsPluginHostEventTarget-DqfVEP_L.cjs +0 -1
  42. package/dist/decorator-Culqv4k6.js +0 -1454
  43. package/dist/decorator-Wf_x4qDo.cjs +0 -1
  44. package/dist/options/index-com.d.ts.map +0 -1
  45. package/dist/plugin-host/index-com.d.ts.map +0 -1
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./decorator-Wf_x4qDo.cjs"),t=require("./TierOptionsPluginHostEventEmitter-BjGVIRN6.cjs");exports.ExtendManager=e.ExtendManager;exports.ModeOptions=e.ModeOptions;exports.PluginExtendManager=e.PluginExtendManager;exports.PluginHost=e.PluginHost;exports.PluginManager=e.PluginManager;exports.TierModeOptions=e.TierModeOptions;exports.TierModeOptionsPluginHost=e.TierModeOptionsPluginHost;exports.TierOptions=e.TierOptions;exports.TierOptionsPluginHost=e.TierOptionsPluginHost;exports.addDefaultOptions=e.addDefaultOptions;exports.addInstOptions=e.addInstOptions;exports.becomePluginHost=e.becomePluginHost;exports.becomePluginHost_Extends=e.becomePluginHost_Extends;exports.becomePluginHost_Proxy=e.becomePluginHost_Proxy;exports.becomeTierModeOptionsHost=e.becomeTierModeOptionsHost;exports.becomeTierOptionsHost=e.becomeTierOptionsHost;exports.commonModeName=e.commonModeName;exports.createDefineExtend=e.createDefineExtend;exports.createDefineMixin=e.createDefineMixin;exports.createExtendTarget=e.createExtendTarget;exports.createMixinTarget=e.createMixinTarget;exports.createPluginHost=e.createPluginHost;exports.createPropertySetter=e.createPropertySetter;exports.createTargetExtend=e.createTargetExtend;exports.createTargetMixin=e.createTargetMixin;exports.createTierModeOptionsPluginHost=e.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=e.createTierOptionsPluginHost;exports.defineExtend=e.defineExtend;exports.defineMixin=e.defineMixin;exports.extendMark=e.extendMark;exports.extendTarget=e.extendTarget;exports.getPropertyValue=e.getPropertyValue;exports.getPropertyValueByPath=e.getPropertyValueByPath;exports.getTargetProperties=e.getTargetProperties;exports.isPlugin=e.isPlugin;exports.mergeProperties=e.mergeProperties;exports.mixin=e.mixin;exports.mixinByOmit=e.mixinByOmit;exports.mixinByPick=e.mixinByPick;exports.mixinIExtend=e.mixinIExtend;exports.mixinTarget=e.mixinTarget;exports.parsePropertyPath=e.parsePropertyPath;exports.pickHostExtendMembers=e.pickHostExtendMembers;exports.setPropertyValue=e.setPropertyValue;exports.setPropertyValueByPath=e.setPropertyValueByPath;exports.targetExtend=e.targetExtend;exports.targetMixin=e.targetMixin;exports.tierModeOptionsDecorator=e.tierModeOptionsDecorator;exports.tierModeOptionsPlugin=e.tierModeOptionsPlugin;exports.tierOptionsDecorator=e.tierOptionsDecorator;exports.tierOptionsPlugin=e.tierOptionsPlugin;exports.PluginHostEventEmitter=t.PluginHostEventEmitter;exports.TierModeOptionsPluginHostEventEmitter=t.TierModeOptionsPluginHostEventEmitter;exports.TierOptionsPluginHostEventEmitter=t.TierOptionsPluginHostEventEmitter;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const r=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),a=require("node:events"),d=require("com-tools"),s=require("./createTierModeOptionsPluginHost-C3kmxB00.cjs");class l extends a.EventEmitter{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const i=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(i),t.__destroyable_destroyer=i,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(i){console.error("销毁函数在同步销毁时出错",this,e,i)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return r.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=d.serialCallAllFuns(t,this,null,(i,u)=>{console.error("销毁函数在串行销毁时出错",this,u,i)});return e instanceof Promise?e.then(()=>(r.i(this),!0)):(r.i(this),!0)}}class o extends l{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new s.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new s.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class h extends o{static modeOptions=new s.TierModeOptions(s.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new s.TierModeOptions(s.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class c extends o{static defaultOptions=new s.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new s.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=s.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=s.TierOptionsPluginHost;exports.commonModeName=s.commonModeName;exports.createTierModeOptionsPluginHost=s.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=s.createTierOptionsPluginHost;exports.PluginHostEventEmitter=o;exports.TierModeOptionsPluginHostEventEmitter=h;exports.TierOptionsPluginHostEventEmitter=c;
@@ -1,4 +1,3 @@
1
- export * from "./index-com";
2
1
  export * from "./options/index-node";
3
2
  export * from "./plugin-host/index-node";
4
3
  //# sourceMappingURL=index-node.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA"}
1
+ {"version":3,"file":"index-node.d.ts","sourceRoot":"","sources":["../src/index-node.ts"],"names":[],"mappings":"AAAA,cAAc,sBAAsB,CAAA;AACpC,cAAc,0BAA0B,CAAA"}
@@ -1,58 +1,256 @@
1
- import { E as a, M as s, P as i, a as r, b as n, T as o, c as g, d as P, e as p, f as d, g as x, h as l, i as u, j as m, k as c, l as M, m as O, n as T, o as E, p as H, q as y, r as f, s as b, t as D, u as B, v as V, w as h, x as k, y as v, z as I, A as N, B as S, C as _, D as j, F as q, G as w, H as z, I as A, J as C, K as F, L as G, N as J, O as K, Q as L, R as Q, S as R, U, V as W, W as X, X as Y, Y as Z } from "./decorator-Culqv4k6.js";
2
- import { P as ee, T as te, a as ae } from "./TierOptionsPluginHostEventEmitter-DXTNpSmS.js";
1
+ import { i as n } from "./Destroyable-BqvuD4gL-D50ZO9eN.js";
2
+ import { EventEmitter as l } from "node:events";
3
+ import { serialCallAllFuns as p } from "com-tools";
4
+ import { P as r, T as o, c as u, a } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
5
+ import { d as D, e as T, g as E, h as x } from "./createTierModeOptionsPluginHost-CeND_z6P.js";
6
+ class c extends l {
7
+ /**
8
+ * 引用计数
9
+ * @remarks
10
+ * 引用计数为 0 时,对象才会被销毁
11
+ */
12
+ refCount = 0;
13
+ /**
14
+ * 是否已经销毁
15
+ */
16
+ get isDestroyed() {
17
+ return this._isDestroyed;
18
+ }
19
+ _isDestroyed = !1;
20
+ /**
21
+ * 是否可以销毁
22
+ */
23
+ get canDestroy() {
24
+ return !this.isDestroyed && this.refCount <= 0;
25
+ }
26
+ /**
27
+ * 销毁者
28
+ */
29
+ _destroyers = [];
30
+ /**
31
+ * 添加销毁者
32
+ * @param fun
33
+ * @returns 返回销毁者的顺序
34
+ */
35
+ disposeFun(t) {
36
+ return this._destroyers.push(t), t;
37
+ }
38
+ /**
39
+ * 取消销毁者函数
40
+ * @param fun
41
+ * @returns
42
+ */
43
+ cancelDisposeFun(t) {
44
+ const s = this._destroyers.indexOf(t);
45
+ return this._destroyers.splice(s, 1), t;
46
+ }
47
+ /**
48
+ * 添加销毁对象
49
+ * @param obj
50
+ * @param sync - 表示是否使用 `obj.destroySync()` 方法进行销毁;默认使用 `obj.destroy()` 方法进行销毁
51
+ * @returns
52
+ */
53
+ disposeObj(t, s) {
54
+ const e = s ? function() {
55
+ return t.destroySync();
56
+ } : function() {
57
+ return t.destroy();
58
+ };
59
+ return this.disposeFun(e), t.__destroyable_destroyer = e, t;
60
+ }
61
+ /**
62
+ * 取消销毁者函数
63
+ * @param fun
64
+ * @returns
65
+ */
66
+ cancelDisposeObj(t) {
67
+ const s = t.__destroyable_destroyer;
68
+ return s && this.cancelDisposeFun(s), t;
69
+ }
70
+ dispose(t, s) {
71
+ return typeof t == "function" ? this.disposeFun(t) : this.disposeObj(t, s);
72
+ }
73
+ cancelDispose(t) {
74
+ return typeof t == "function" ? this.cancelDisposeFun(t) : this.cancelDisposeObj(t);
75
+ }
76
+ /**
77
+ * 自己的销毁方法
78
+ * @remarks
79
+ * 子类根据需要进行重载
80
+ */
81
+ destroyThis() {
82
+ }
83
+ /**
84
+ * 同步销毁
85
+ * @remarks
86
+ * 会逆序依次同步调用所有销毁函数,并不会等待上一个销毁函数异步执行完成
87
+ */
88
+ destroySync() {
89
+ if (!this.canDestroy) return this.isDestroyed;
90
+ let t = this._destroyers.length;
91
+ for (; --t >= 0; ) {
92
+ const s = this._destroyers[t];
93
+ try {
94
+ s();
95
+ } catch (e) {
96
+ console.error("销毁函数在同步销毁时出错", this, s, e);
97
+ }
98
+ }
99
+ this._destroyers.length = 0;
100
+ try {
101
+ this.destroyThis();
102
+ } catch (s) {
103
+ console.error("destroyThis 在异步销毁时出错", this, s);
104
+ }
105
+ return n(this), !0;
106
+ }
107
+ /**
108
+ * 串行销毁
109
+ * @remarks
110
+ * 会逆序依次执行销毁,并且只有上一个销毁完成之后才会执行下一个销毁
111
+ * @returns 如果所有的销毁函数都是同步的,那么返回 true;如果有任何一个销毁函数是异步的,那么返回一个 Promise 对象
112
+ */
113
+ destroy() {
114
+ if (!this.canDestroy) return this.isDestroyed;
115
+ const t = this._destroyers.toReversed();
116
+ t.push(this.destroyThis), this._destroyers.length = 0;
117
+ const s = p(t, this, null, (e, h) => {
118
+ console.error("销毁函数在串行销毁时出错", this, h, e);
119
+ });
120
+ return s instanceof Promise ? s.then(() => (n(this), !0)) : (n(this), !0);
121
+ }
122
+ }
123
+ class d extends c {
124
+ /**
125
+ * 是否使用独立的插件管理器
126
+ * @defaultValue false
127
+ */
128
+ static isolatedPluginManager = !1;
129
+ /**
130
+ * 插件管理器
131
+ */
132
+ static get pluginManager() {
133
+ return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new r(this)), this._pluginManager;
134
+ }
135
+ static _pluginManager = new r(this);
136
+ /**
137
+ * 插件管理器 {@link PluginHost.pluginManager}
138
+ */
139
+ get pluginManager() {
140
+ return this.constructor.pluginManager;
141
+ }
142
+ /**
143
+ * {@inheritDoc PluginExtendManager.usePlugin}
144
+ */
145
+ static usePlugin(t, ...s) {
146
+ return this.pluginManager.usePlugin(t, ...s);
147
+ }
148
+ /**
149
+ * {@inheritDoc PluginExtendManager.useExtend}
150
+ */
151
+ static useExtend(t) {
152
+ return this.pluginManager.useExtend(t);
153
+ }
154
+ /**
155
+ * 是否注册了插件 或 扩展
156
+ * @param plugin - 插件 或 扩展
157
+ * @returns 是否注册了插件 或 扩展
158
+ */
159
+ static hasUsed(t) {
160
+ return this.pluginManager.hasUsed(t);
161
+ }
162
+ /**
163
+ * 需要在子类中调用
164
+ *
165
+ * 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
166
+ * 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
167
+ */
168
+ // constructor(...args:any) {
169
+ // super();
170
+ // // @ts-ignore
171
+ // this.pluginManager.onCreate(this,...args);
172
+ // }
173
+ /**
174
+ * 实例的注册插件的方法
175
+ * @param plugin
176
+ * @param args
177
+ * @returns
178
+ */
179
+ usePlugin(t, ...s) {
180
+ return this.pluginManager.instUsePlugin(this, t, ...s);
181
+ }
182
+ /**
183
+ * {@inheritDoc PluginExtendManager.useExtend}
184
+ */
185
+ useExtend(t, ...s) {
186
+ return this.pluginManager.instUseExtend(this, t, ...s);
187
+ }
188
+ /**
189
+ * 初始化实例
190
+ * @remarks
191
+ * 会调用 {@link PluginExtendManager.onInit}
192
+ * @param args
193
+ */
194
+ init(...t) {
195
+ return this.pluginManager.onInit(this, ...t);
196
+ }
197
+ /**
198
+ * 销毁实例
199
+ * @returns
200
+ */
201
+ destroyThis() {
202
+ const t = this.pluginManager.onDestroy(this);
203
+ return t instanceof Promise ? t.finally(() => super.destroyThis()) : super.destroyThis();
204
+ }
205
+ }
206
+ class f extends d {
207
+ /**
208
+ * 全局级别的默认选项
209
+ */
210
+ static modeOptions = new o(u);
211
+ /**
212
+ * 实例级的默认选项
213
+ */
214
+ get modeOptions() {
215
+ return this._modeOptions || (this._modeOptions = new o(u, void 0, this.constructor.modeOptions));
216
+ }
217
+ _modeOptions;
218
+ get mode() {
219
+ return this.modeOptions.mode;
220
+ }
221
+ set mode(t) {
222
+ this.modeOptions.mode = t;
223
+ }
224
+ get options() {
225
+ return this.modeOptions.plainFullOption;
226
+ }
227
+ constructor(t) {
228
+ super(), this.modeOptions.setOption(t);
229
+ }
230
+ }
231
+ class _ extends d {
232
+ /**
233
+ * 全局级别的默认选项
234
+ */
235
+ static defaultOptions = new a();
236
+ /**
237
+ * 实例级的默认选项
238
+ */
239
+ get defaultOptions() {
240
+ return this._defaultOptions || (this._defaultOptions = new a(void 0, this.constructor.defaultOptions));
241
+ }
242
+ _defaultOptions;
243
+ constructor(t) {
244
+ super(), this.defaultOptions.option = t;
245
+ }
246
+ }
3
247
  export {
4
- a as ExtendManager,
5
- s as ModeOptions,
6
- i as PluginExtendManager,
7
- r as PluginHost,
8
- ee as PluginHostEventEmitter,
9
- n as PluginManager,
10
- o as TierModeOptions,
11
- g as TierModeOptionsPluginHost,
12
- te as TierModeOptionsPluginHostEventEmitter,
13
- P as TierOptions,
14
- p as TierOptionsPluginHost,
15
- ae as TierOptionsPluginHostEventEmitter,
16
- d as addDefaultOptions,
17
- x as addInstOptions,
18
- l as becomePluginHost,
19
- u as becomePluginHost_Extends,
20
- m as becomePluginHost_Proxy,
21
- c as becomeTierModeOptionsHost,
22
- M as becomeTierOptionsHost,
23
- O as commonModeName,
24
- T as createDefineExtend,
25
- E as createDefineMixin,
26
- H as createExtendTarget,
27
- y as createMixinTarget,
28
- f as createPluginHost,
29
- b as createPropertySetter,
30
- D as createTargetExtend,
31
- B as createTargetMixin,
32
- V as createTierModeOptionsPluginHost,
33
- h as createTierOptionsPluginHost,
34
- k as defineExtend,
35
- v as defineMixin,
36
- I as extendMark,
37
- N as extendTarget,
38
- S as getPropertyValue,
39
- _ as getPropertyValueByPath,
40
- j as getTargetProperties,
41
- q as isPlugin,
42
- w as mergeProperties,
43
- z as mixin,
44
- A as mixinByOmit,
45
- C as mixinByPick,
46
- F as mixinIExtend,
47
- G as mixinTarget,
48
- J as parsePropertyPath,
49
- K as pickHostExtendMembers,
50
- L as setPropertyValue,
51
- Q as setPropertyValueByPath,
52
- R as targetExtend,
53
- U as targetMixin,
54
- W as tierModeOptionsDecorator,
55
- X as tierModeOptionsPlugin,
56
- Y as tierOptionsDecorator,
57
- Z as tierOptionsPlugin
248
+ d as PluginHostEventEmitter,
249
+ D as TierModeOptionsPluginHost,
250
+ f as TierModeOptionsPluginHostEventEmitter,
251
+ T as TierOptionsPluginHost,
252
+ _ as TierOptionsPluginHostEventEmitter,
253
+ u as commonModeName,
254
+ E as createTierModeOptionsPluginHost,
255
+ x as createTierOptionsPluginHost
58
256
  };
@@ -1 +1 @@
1
- "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const e=require("./decorator-Wf_x4qDo.cjs"),t=require("./TierOptionsPluginHostEventTarget-DqfVEP_L.cjs");exports.ExtendManager=e.ExtendManager;exports.ModeOptions=e.ModeOptions;exports.PluginExtendManager=e.PluginExtendManager;exports.PluginHost=e.PluginHost;exports.PluginManager=e.PluginManager;exports.TierModeOptions=e.TierModeOptions;exports.TierModeOptionsPluginHost=e.TierModeOptionsPluginHost;exports.TierOptions=e.TierOptions;exports.TierOptionsPluginHost=e.TierOptionsPluginHost;exports.addDefaultOptions=e.addDefaultOptions;exports.addInstOptions=e.addInstOptions;exports.becomePluginHost=e.becomePluginHost;exports.becomePluginHost_Extends=e.becomePluginHost_Extends;exports.becomePluginHost_Proxy=e.becomePluginHost_Proxy;exports.becomeTierModeOptionsHost=e.becomeTierModeOptionsHost;exports.becomeTierOptionsHost=e.becomeTierOptionsHost;exports.commonModeName=e.commonModeName;exports.createDefineExtend=e.createDefineExtend;exports.createDefineMixin=e.createDefineMixin;exports.createExtendTarget=e.createExtendTarget;exports.createMixinTarget=e.createMixinTarget;exports.createPluginHost=e.createPluginHost;exports.createPropertySetter=e.createPropertySetter;exports.createTargetExtend=e.createTargetExtend;exports.createTargetMixin=e.createTargetMixin;exports.createTierModeOptionsPluginHost=e.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=e.createTierOptionsPluginHost;exports.defineExtend=e.defineExtend;exports.defineMixin=e.defineMixin;exports.extendMark=e.extendMark;exports.extendTarget=e.extendTarget;exports.getPropertyValue=e.getPropertyValue;exports.getPropertyValueByPath=e.getPropertyValueByPath;exports.getTargetProperties=e.getTargetProperties;exports.isPlugin=e.isPlugin;exports.mergeProperties=e.mergeProperties;exports.mixin=e.mixin;exports.mixinByOmit=e.mixinByOmit;exports.mixinByPick=e.mixinByPick;exports.mixinIExtend=e.mixinIExtend;exports.mixinTarget=e.mixinTarget;exports.parsePropertyPath=e.parsePropertyPath;exports.pickHostExtendMembers=e.pickHostExtendMembers;exports.setPropertyValue=e.setPropertyValue;exports.setPropertyValueByPath=e.setPropertyValueByPath;exports.targetExtend=e.targetExtend;exports.targetMixin=e.targetMixin;exports.tierModeOptionsDecorator=e.tierModeOptionsDecorator;exports.tierModeOptionsPlugin=e.tierModeOptionsPlugin;exports.tierOptionsDecorator=e.tierOptionsDecorator;exports.tierOptionsPlugin=e.tierOptionsPlugin;exports.PluginHostEventTarget=t.PluginHostEventTarget;exports.TierModeOptionsPluginHostEventTarget=t.TierModeOptionsPluginHostEventTarget;exports.TierOptionsPluginHostEventTarget=t.TierOptionsPluginHostEventTarget;
1
+ "use strict";Object.defineProperty(exports,Symbol.toStringTag,{value:"Module"});const u=require("./Destroyable-BqvuD4gL-Cmk1ocqj.cjs"),c=require("com-tools"),n=require("./createTierModeOptionsPluginHost-C3kmxB00.cjs");if(!globalThis.CustomEvent){class i extends Event{detail;constructor(e,s){super(e,s),this.detail=s?.detail}}globalThis.CustomEvent=i}class h extends EventTarget{addEventListener(t,e,s){const r=s?.times;if(r){const o=typeof e=="function"?e:e?.handleEvent;if(o)return this.multipleListen(t,o,r)}return super.addEventListener(t,e,s),()=>{this.removeEventListener(t,e,s)}}dispatchEvent(t,e){const s=t instanceof Event?t:new CustomEvent(t,{detail:e,bubbles:!1,cancelable:!0,composed:!1});return super.dispatchEvent(s)}onceListen(t,e,s){return this.addEventListener(t,e,{...s,once:!0})}multipleListen(t,e,s){let r=0;const o=new AbortController,l=o.signal;return super.addEventListener(t,d=>{++r>=s&&o.abort(),e.call(this,d)},{signal:l}),function(){o.abort()}}}class p extends h{refCount=0;get isDestroyed(){return this._isDestroyed}_isDestroyed=!1;get canDestroy(){return!this.isDestroyed&&this.refCount<=0}_destroyers=[];disposeFun(t){return this._destroyers.push(t),t}cancelDisposeFun(t){const e=this._destroyers.indexOf(t);return this._destroyers.splice(e,1),t}disposeObj(t,e){const s=e?function(){return t.destroySync()}:function(){return t.destroy()};return this.disposeFun(s),t.__destroyable_destroyer=s,t}cancelDisposeObj(t){const e=t.__destroyable_destroyer;return e&&this.cancelDisposeFun(e),t}dispose(t,e){return typeof t=="function"?this.disposeFun(t):this.disposeObj(t,e)}cancelDispose(t){return typeof t=="function"?this.cancelDisposeFun(t):this.cancelDisposeObj(t)}destroyThis(){}destroySync(){if(!this.canDestroy)return this.isDestroyed;let t=this._destroyers.length;for(;--t>=0;){const e=this._destroyers[t];try{e()}catch(s){console.error("销毁函数在同步销毁时出错",this,e,s)}}this._destroyers.length=0;try{this.destroyThis()}catch(e){console.error("destroyThis 在异步销毁时出错",this,e)}return u.i(this),!0}destroy(){if(!this.canDestroy)return this.isDestroyed;const t=this._destroyers.toReversed();t.push(this.destroyThis),this._destroyers.length=0;const e=c.serialCallAllFuns(t,this,null,(s,r)=>{console.error("销毁函数在串行销毁时出错",this,r,s)});return e instanceof Promise?e.then(()=>(u.i(this),!0)):(u.i(this),!0)}}class a extends p{static isolatedPluginManager=!1;static get pluginManager(){return this.isolatedPluginManager&&!this.hasOwnProperty("_pluginManager")&&(this._pluginManager=new n.PluginExtendManager(this)),this._pluginManager}static _pluginManager=new n.PluginExtendManager(this);get pluginManager(){return this.constructor.pluginManager}static usePlugin(t,...e){return this.pluginManager.usePlugin(t,...e)}static useExtend(t){return this.pluginManager.useExtend(t)}static hasUsed(t){return this.pluginManager.hasUsed(t)}usePlugin(t,...e){return this.pluginManager.instUsePlugin(this,t,...e)}useExtend(t,...e){return this.pluginManager.instUseExtend(this,t,...e)}init(...t){return this.pluginManager.onInit(this,...t)}destroyThis(){const t=this.pluginManager.onDestroy(this);return t instanceof Promise?t.finally(()=>super.destroyThis()):super.destroyThis()}}class g extends a{static modeOptions=new n.TierModeOptions(n.commonModeName);get modeOptions(){return this._modeOptions||(this._modeOptions=new n.TierModeOptions(n.commonModeName,void 0,this.constructor.modeOptions))}_modeOptions;get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}constructor(t){super(),this.modeOptions.setOption(t)}}class y extends a{static defaultOptions=new n.TierOptions;get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new n.TierOptions(void 0,this.constructor.defaultOptions))}_defaultOptions;constructor(t){super(),this.defaultOptions.option=t}}exports.TierModeOptionsPluginHost=n.TierModeOptionsPluginHost;exports.TierOptionsPluginHost=n.TierOptionsPluginHost;exports.commonModeName=n.commonModeName;exports.createTierModeOptionsPluginHost=n.createTierModeOptionsPluginHost;exports.createTierOptionsPluginHost=n.createTierOptionsPluginHost;exports.PluginHostEventTarget=a;exports.TierModeOptionsPluginHostEventTarget=g;exports.TierOptionsPluginHostEventTarget=y;
@@ -1,4 +1,3 @@
1
- export * from "./index-com";
2
1
  export * from "./options/index-web";
3
2
  export * from "./plugin-host/index-web";
4
3
  //# sourceMappingURL=index-web.d.ts.map
@@ -1 +1 @@
1
- {"version":3,"file":"index-web.d.ts","sourceRoot":"","sources":["../src/index-web.ts"],"names":[],"mappings":"AAAA,cAAc,aAAa,CAAA;AAC3B,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA"}
1
+ {"version":3,"file":"index-web.d.ts","sourceRoot":"","sources":["../src/index-web.ts"],"names":[],"mappings":"AAAA,cAAc,qBAAqB,CAAA;AACnC,cAAc,yBAAyB,CAAA"}