plugin-tls 4.5.0 → 4.7.0
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.
- package/dist/{createTierModeOptionsPluginHost-CeND_z6P.js → createTierModeOptionsPluginHost-D-fKYlcA.js} +248 -156
- package/dist/createTierModeOptionsPluginHost-DyDtXKNW.cjs +1 -0
- package/dist/index-node.cjs +1 -1
- package/dist/index-node.js +9 -9
- package/dist/index-web.cjs +1 -1
- package/dist/index-web.js +7 -7
- package/dist/index.cjs +1 -1
- package/dist/index.js +220 -227
- package/dist/plugin-manager/ExtendManager.d.ts +15 -5
- package/dist/plugin-manager/ExtendManager.d.ts.map +1 -1
- package/dist/plugin-manager/IExtend.d.ts +64 -0
- package/dist/plugin-manager/IExtend.d.ts.map +1 -1
- package/dist/plugin-manager/PluginExtendManager.d.ts +20 -5
- package/dist/plugin-manager/PluginExtendManager.d.ts.map +1 -1
- package/dist/plugin-manager/PluginManager.d.ts +20 -6
- package/dist/plugin-manager/PluginManager.d.ts.map +1 -1
- package/dist/plugin-manager/extend.d.ts +1 -1
- package/dist/plugin-manager/extend.d.ts.map +1 -1
- package/dist/plugin-manager/index.d.ts +1 -0
- package/dist/plugin-manager/index.d.ts.map +1 -1
- package/dist/plugin-manager/type.d.ts +2 -0
- package/dist/plugin-manager/type.d.ts.map +1 -0
- package/package.json +1 -1
- package/dist/createTierModeOptionsPluginHost-C3kmxB00.cjs +0 -1
package/dist/index.js
CHANGED
|
@@ -1,71 +1,40 @@
|
|
|
1
|
-
import { Destroyable as
|
|
2
|
-
import {
|
|
3
|
-
import { m as
|
|
4
|
-
import { M as et,
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
const s = Object.getOwnPropertyDescriptors(t);
|
|
8
|
-
Object.defineProperties(n, s);
|
|
9
|
-
}
|
|
10
|
-
return n;
|
|
11
|
-
}
|
|
12
|
-
function C(n, e, t) {
|
|
13
|
-
let s = Object.getOwnPropertyDescriptors(e);
|
|
14
|
-
return t && m(s, t), Object.defineProperties(n, s), n;
|
|
15
|
-
}
|
|
16
|
-
function U(n, e, t) {
|
|
17
|
-
let s = Object.getOwnPropertyDescriptors(e);
|
|
18
|
-
return t ? Object.defineProperties(n, P(y(s, t))) : Object.defineProperties(n, s), n;
|
|
19
|
-
}
|
|
20
|
-
function j(n, e) {
|
|
21
|
-
return e;
|
|
22
|
-
}
|
|
23
|
-
function v(n) {
|
|
24
|
-
return function(t) {
|
|
25
|
-
return t;
|
|
26
|
-
};
|
|
27
|
-
}
|
|
28
|
-
function H(n, e) {
|
|
29
|
-
return o(n, e), e;
|
|
30
|
-
}
|
|
31
|
-
function I(n) {
|
|
32
|
-
return function(t) {
|
|
33
|
-
return o(n, t), t;
|
|
34
|
-
};
|
|
35
|
-
}
|
|
36
|
-
function a(n, e) {
|
|
37
|
-
return o(n, e), n;
|
|
38
|
-
}
|
|
39
|
-
function k(n) {
|
|
40
|
-
return function(t) {
|
|
41
|
-
return o(n, t), n;
|
|
42
|
-
};
|
|
43
|
-
}
|
|
44
|
-
function B(n, e) {
|
|
1
|
+
import { Destroyable as O } from "@gby/destroyable";
|
|
2
|
+
import { serialCallFuns as c } from "com-tools";
|
|
3
|
+
import { m as a, a as y, b as u, T as d, c as P, d as f, P as M } from "./createTierModeOptionsPluginHost-D-fKYlcA.js";
|
|
4
|
+
import { M as J, e as Q, f as X, g as Y, h as Z, i as L, j as K, k as tt, l as et, n as nt, o as st, p as rt, q as it, r as ot, s as ut, t as at, u as pt, v as ct, w as gt, x as lt, y as ht, z as dt, A as ft, B as Mt, C as mt, D as Ot, E as yt, F as Pt, G as xt, H as Tt } from "./createTierModeOptionsPluginHost-D-fKYlcA.js";
|
|
5
|
+
import { waitAsyncable as g } from "type-tls";
|
|
6
|
+
function C(s, e) {
|
|
45
7
|
return e;
|
|
46
8
|
}
|
|
47
|
-
function
|
|
9
|
+
function b(s) {
|
|
48
10
|
return function(t) {
|
|
49
11
|
return t;
|
|
50
12
|
};
|
|
51
13
|
}
|
|
52
|
-
function
|
|
53
|
-
return
|
|
14
|
+
function D(s, e) {
|
|
15
|
+
return a(s.prototype, e), e;
|
|
54
16
|
}
|
|
55
|
-
function
|
|
17
|
+
function v(s) {
|
|
56
18
|
return function(t) {
|
|
57
|
-
return
|
|
19
|
+
return a(s.prototype, t), t;
|
|
58
20
|
};
|
|
59
21
|
}
|
|
60
|
-
function
|
|
61
|
-
return
|
|
22
|
+
function H(s, e) {
|
|
23
|
+
return a(s.prototype, e), s;
|
|
62
24
|
}
|
|
63
|
-
function
|
|
25
|
+
function j(s) {
|
|
64
26
|
return function(t) {
|
|
65
|
-
return
|
|
27
|
+
return a(s.prototype, t), s;
|
|
66
28
|
};
|
|
67
29
|
}
|
|
68
|
-
class
|
|
30
|
+
class I extends O {
|
|
31
|
+
/**
|
|
32
|
+
* 父级插件管理者
|
|
33
|
+
*
|
|
34
|
+
* @remarks
|
|
35
|
+
* 当子类创建了子类插件管理者时,为了能让父类插件管理者的插件生效,需要将父类插件管理者设置为其 parent
|
|
36
|
+
*/
|
|
37
|
+
parent;
|
|
69
38
|
/**
|
|
70
39
|
* 插件的宿主
|
|
71
40
|
*/
|
|
@@ -77,8 +46,8 @@ class $ extends M {
|
|
|
77
46
|
/**
|
|
78
47
|
* @param host - 插件的宿主
|
|
79
48
|
*/
|
|
80
|
-
constructor(e) {
|
|
81
|
-
super(), e && (this.host = e);
|
|
49
|
+
constructor(e, t) {
|
|
50
|
+
super(), this.parent = t, e && (this.host = e);
|
|
82
51
|
}
|
|
83
52
|
destroyThis() {
|
|
84
53
|
return this.plugins.clear(), this.host = null, super.destroyThis();
|
|
@@ -89,7 +58,16 @@ class $ extends M {
|
|
|
89
58
|
* @returns 是否注册了插件
|
|
90
59
|
*/
|
|
91
60
|
hasUsed(e) {
|
|
92
|
-
return this.plugins.has(e);
|
|
61
|
+
return this.parent?.hasUsed(e) || this.plugins.has(e);
|
|
62
|
+
}
|
|
63
|
+
/**
|
|
64
|
+
* 获取插件 或 扩展 的 use 的返回值
|
|
65
|
+
* @param plugin
|
|
66
|
+
* @returns
|
|
67
|
+
*/
|
|
68
|
+
getUseReturn(e) {
|
|
69
|
+
const { parent: t } = this;
|
|
70
|
+
return t?.hasUsed(e) ? t.getUseReturn(e) : this.plugins.get(e);
|
|
93
71
|
}
|
|
94
72
|
/**
|
|
95
73
|
* 使用插件、注册插件
|
|
@@ -97,10 +75,9 @@ class $ extends M {
|
|
|
97
75
|
* @param args - 传递给插件的选项
|
|
98
76
|
*/
|
|
99
77
|
use(e, ...t) {
|
|
100
|
-
|
|
101
|
-
|
|
102
|
-
|
|
103
|
-
return s.set(e, r), r;
|
|
78
|
+
if (this.hasUsed(e)) return this.getUseReturn(e);
|
|
79
|
+
const n = e.onUse(this.host, ...t);
|
|
80
|
+
return this.plugins.set(e, n), n;
|
|
104
81
|
}
|
|
105
82
|
/**
|
|
106
83
|
* 插件宿主实例的注册插件的方法
|
|
@@ -109,10 +86,10 @@ class $ extends M {
|
|
|
109
86
|
* 会调用每个插件的 {@link IPlugin.use } 方法
|
|
110
87
|
* @param hostInst - 插件宿主的新实例
|
|
111
88
|
*/
|
|
112
|
-
instUse(e, t, ...
|
|
89
|
+
instUse(e, t, ...n) {
|
|
113
90
|
const { plugins: r } = this;
|
|
114
|
-
if (
|
|
115
|
-
const i = this.use(t, ...
|
|
91
|
+
if (this.hasUsed(t)) return this.getUseReturn(t);
|
|
92
|
+
const i = this.use(t, ...n);
|
|
116
93
|
return t.onCreate?.(e), i;
|
|
117
94
|
}
|
|
118
95
|
/**
|
|
@@ -124,10 +101,10 @@ class $ extends M {
|
|
|
124
101
|
* @param hostInst - 插件宿主的新实例
|
|
125
102
|
*/
|
|
126
103
|
onCreate(e, ...t) {
|
|
127
|
-
const
|
|
128
|
-
for (const [
|
|
129
|
-
|
|
130
|
-
return c(
|
|
104
|
+
const n = this.parent?.onCreate(e, ...t), r = [];
|
|
105
|
+
for (const [i] of this.plugins)
|
|
106
|
+
i.onCreate && r.push(i.onCreate.bind(i));
|
|
107
|
+
return g(n, () => c(r, void 0, [e, ...t]));
|
|
131
108
|
}
|
|
132
109
|
/**
|
|
133
110
|
* 插件宿主创建实例时调用
|
|
@@ -138,10 +115,10 @@ class $ extends M {
|
|
|
138
115
|
* @param args - 初始化宿主实例时的参数
|
|
139
116
|
*/
|
|
140
117
|
onInit(e, ...t) {
|
|
141
|
-
const
|
|
142
|
-
for (const [
|
|
143
|
-
|
|
144
|
-
return c(
|
|
118
|
+
const n = this.parent?.onInit(e, ...t), r = [];
|
|
119
|
+
for (const [i] of this.plugins)
|
|
120
|
+
i.onInit && r.push(i.onInit.bind(i));
|
|
121
|
+
return g(n, () => c(r, void 0, [e, ...t]));
|
|
145
122
|
}
|
|
146
123
|
/**
|
|
147
124
|
* 插件宿主被销毁时调用
|
|
@@ -152,12 +129,21 @@ class $ extends M {
|
|
|
152
129
|
*/
|
|
153
130
|
onDestroy(e) {
|
|
154
131
|
const t = [];
|
|
155
|
-
for (const [
|
|
156
|
-
|
|
157
|
-
|
|
132
|
+
for (const [i] of this.plugins)
|
|
133
|
+
i.onDestroy && t.push(i.onDestroy.bind(i));
|
|
134
|
+
t.reverse();
|
|
135
|
+
const n = c(t, void 0, [e]), { parent: r } = this;
|
|
136
|
+
return r ? g(n, () => r.onDestroy(e)) : n;
|
|
158
137
|
}
|
|
159
138
|
}
|
|
160
|
-
class
|
|
139
|
+
class R extends O {
|
|
140
|
+
/**
|
|
141
|
+
* 父级插件管理者
|
|
142
|
+
*
|
|
143
|
+
* @remarks
|
|
144
|
+
* 当子类创建了子类插件管理者时,为了能让父类插件管理者的插件生效,需要将父类插件管理者设置为其 parent
|
|
145
|
+
*/
|
|
146
|
+
parent;
|
|
161
147
|
/**
|
|
162
148
|
* 插件的宿主
|
|
163
149
|
*/
|
|
@@ -168,9 +154,10 @@ class W extends M {
|
|
|
168
154
|
plugins = /* @__PURE__ */ new Set();
|
|
169
155
|
/**
|
|
170
156
|
* @param host - 插件的宿主
|
|
157
|
+
* @param parent - 父级插件管理者
|
|
171
158
|
*/
|
|
172
|
-
constructor(e) {
|
|
173
|
-
super(), e && (this.host = e);
|
|
159
|
+
constructor(e, t) {
|
|
160
|
+
super(), this.parent = t, e && (this.host = e);
|
|
174
161
|
}
|
|
175
162
|
destroyThis() {
|
|
176
163
|
return this.plugins.clear(), this.host = null, super.destroyThis();
|
|
@@ -181,7 +168,7 @@ class W extends M {
|
|
|
181
168
|
* @returns 是否注册了插件
|
|
182
169
|
*/
|
|
183
170
|
hasUsed(e) {
|
|
184
|
-
return this.plugins.has(e);
|
|
171
|
+
return this.parent?.hasUsed(e) || this.plugins.has(e);
|
|
185
172
|
}
|
|
186
173
|
/**
|
|
187
174
|
* 使用插件、注册插件
|
|
@@ -189,8 +176,7 @@ class W extends M {
|
|
|
189
176
|
* @returns 返回插件对象本身
|
|
190
177
|
*/
|
|
191
178
|
use(e) {
|
|
192
|
-
|
|
193
|
-
return t.has(e) || (x(this.host.prototype, e), t.add(e)), e;
|
|
179
|
+
return this.hasUsed(e) || (y(this.host.prototype, e), this.plugins.add(e)), e;
|
|
194
180
|
}
|
|
195
181
|
/**
|
|
196
182
|
* 插件宿主实例的注册插件的方法
|
|
@@ -199,9 +185,8 @@ class W extends M {
|
|
|
199
185
|
* 会调用每个插件的 {@link IExtend.use } 方法
|
|
200
186
|
* @param hostInst - 插件宿主的新实例
|
|
201
187
|
*/
|
|
202
|
-
instUse(e, t, ...
|
|
203
|
-
|
|
204
|
-
return r.has(t) || (this.use(t), t.onCreate?.call(e, e, ...s)), t;
|
|
188
|
+
instUse(e, t, ...n) {
|
|
189
|
+
return this.hasUsed(t) || (this.use(t), t.onCreate?.call(e, e, ...n)), t;
|
|
205
190
|
}
|
|
206
191
|
/**
|
|
207
192
|
* 插件宿主创建实例时调用
|
|
@@ -212,10 +197,10 @@ class W extends M {
|
|
|
212
197
|
* @param hostInst - 插件宿主的新实例
|
|
213
198
|
*/
|
|
214
199
|
onCreate(e, ...t) {
|
|
215
|
-
const
|
|
216
|
-
for (const
|
|
217
|
-
|
|
218
|
-
return c(
|
|
200
|
+
const n = this.parent?.onCreate(e, ...t), r = [];
|
|
201
|
+
for (const i of this.plugins)
|
|
202
|
+
i.onCreate && r.push(i.onCreate);
|
|
203
|
+
return g(n, () => c(r, e, [e, ...t]));
|
|
219
204
|
}
|
|
220
205
|
/**
|
|
221
206
|
* 插件宿主创建实例时调用
|
|
@@ -226,10 +211,10 @@ class W extends M {
|
|
|
226
211
|
* @param args - 初始化宿主实例时的参数
|
|
227
212
|
*/
|
|
228
213
|
onInit(e, ...t) {
|
|
229
|
-
const
|
|
230
|
-
for (const
|
|
231
|
-
|
|
232
|
-
return c(
|
|
214
|
+
const n = this.parent?.onInit(e, ...t), r = [];
|
|
215
|
+
for (const i of this.plugins)
|
|
216
|
+
i.onInit && r.push(i.onInit);
|
|
217
|
+
return g(n, () => c(r, e, [e, ...t]));
|
|
233
218
|
}
|
|
234
219
|
/**
|
|
235
220
|
* 插件宿主被销毁时调用
|
|
@@ -240,91 +225,93 @@ class W extends M {
|
|
|
240
225
|
*/
|
|
241
226
|
onDestroy(e) {
|
|
242
227
|
const t = [];
|
|
243
|
-
for (const
|
|
244
|
-
|
|
245
|
-
|
|
228
|
+
for (const i of this.plugins)
|
|
229
|
+
i.onDestroy && t.push(i.onDestroy);
|
|
230
|
+
t.reverse();
|
|
231
|
+
const n = c(t, e, [e]), { parent: r } = this;
|
|
232
|
+
return r ? g(n, () => r.onDestroy(e)) : n;
|
|
246
233
|
}
|
|
247
234
|
}
|
|
248
|
-
function
|
|
249
|
-
const t = [{ target:
|
|
250
|
-
let
|
|
251
|
-
for (;
|
|
252
|
-
const { target: r, props: i } =
|
|
253
|
-
for (const [p,
|
|
254
|
-
if (
|
|
255
|
-
t.push({ target: r[p], props:
|
|
235
|
+
function m(s, e) {
|
|
236
|
+
const t = [{ target: s, props: e }];
|
|
237
|
+
let n;
|
|
238
|
+
for (; n = t.shift(); ) {
|
|
239
|
+
const { target: r, props: i } = n;
|
|
240
|
+
for (const [p, o] of Object.entries(i)) {
|
|
241
|
+
if (o != null && typeof o == "object" && (!o.constructor || o.constructor === Object)) {
|
|
242
|
+
t.push({ target: r[p], props: o });
|
|
256
243
|
continue;
|
|
257
244
|
}
|
|
258
|
-
r[p] =
|
|
245
|
+
r[p] = o;
|
|
259
246
|
}
|
|
260
247
|
}
|
|
261
|
-
return
|
|
248
|
+
return s;
|
|
262
249
|
}
|
|
263
|
-
function
|
|
264
|
-
const t = {},
|
|
250
|
+
function x(s, e) {
|
|
251
|
+
const t = {}, n = [{ target: s, props: e, targetProps: t }];
|
|
265
252
|
let r;
|
|
266
|
-
for (; r =
|
|
267
|
-
const { target: i, props: p, targetProps:
|
|
268
|
-
for (const [
|
|
269
|
-
if (
|
|
270
|
-
|
|
253
|
+
for (; r = n.shift(); ) {
|
|
254
|
+
const { target: i, props: p, targetProps: o } = r;
|
|
255
|
+
for (const [h, l] of Object.entries(p)) {
|
|
256
|
+
if (l != null && typeof l == "object" && (!l.constructor || l.constructor === Object)) {
|
|
257
|
+
n.push({ target: i[h], props: l, targetProps: o[h] = {} });
|
|
271
258
|
continue;
|
|
272
259
|
}
|
|
273
|
-
|
|
260
|
+
o[h] = i[h];
|
|
274
261
|
}
|
|
275
262
|
}
|
|
276
263
|
return t;
|
|
277
264
|
}
|
|
278
|
-
function
|
|
279
|
-
const t =
|
|
280
|
-
function
|
|
281
|
-
|
|
265
|
+
function k(s, e) {
|
|
266
|
+
const t = x(s, e);
|
|
267
|
+
function n() {
|
|
268
|
+
m(s, e);
|
|
282
269
|
}
|
|
283
270
|
function r() {
|
|
284
|
-
|
|
271
|
+
m(s, t);
|
|
285
272
|
}
|
|
286
|
-
return { set:
|
|
273
|
+
return { set: n, unset: r };
|
|
287
274
|
}
|
|
288
|
-
function
|
|
289
|
-
const t = e ?? "defaultOptions",
|
|
275
|
+
function B(s, e) {
|
|
276
|
+
const t = e ?? "defaultOptions", n = `_${t}`;
|
|
290
277
|
return function(i) {
|
|
291
|
-
const p =
|
|
278
|
+
const p = u(i, {
|
|
292
279
|
/**
|
|
293
280
|
* 全局级别的默认选项
|
|
294
281
|
*/
|
|
295
282
|
get [t]() {
|
|
296
|
-
return
|
|
283
|
+
return s;
|
|
297
284
|
}
|
|
298
285
|
});
|
|
299
|
-
|
|
286
|
+
u(p.prototype, {
|
|
300
287
|
/**
|
|
301
288
|
* 实例级的默认选项
|
|
302
289
|
*/
|
|
303
290
|
get [t]() {
|
|
304
|
-
return this[
|
|
291
|
+
return this[n] || (this[n] = structuredClone(p.defaultOptions));
|
|
305
292
|
}
|
|
306
293
|
});
|
|
307
294
|
};
|
|
308
295
|
}
|
|
309
|
-
function
|
|
310
|
-
const
|
|
311
|
-
return
|
|
296
|
+
function N(s, e, t) {
|
|
297
|
+
const n = `_${e}`;
|
|
298
|
+
return u(s.prototype, {
|
|
312
299
|
/**
|
|
313
300
|
* 实例级的默认选项
|
|
314
301
|
*/
|
|
315
302
|
get [e]() {
|
|
316
|
-
return this[
|
|
303
|
+
return this[n] || (this[n] = structuredClone(s[e]));
|
|
317
304
|
}
|
|
318
305
|
}), t;
|
|
319
306
|
}
|
|
320
|
-
function
|
|
321
|
-
const
|
|
307
|
+
function V(s, e, t) {
|
|
308
|
+
const n = u(s, {
|
|
322
309
|
/**
|
|
323
310
|
* 全局级别的默认选项
|
|
324
311
|
*/
|
|
325
312
|
modeOptions: new d(e, t)
|
|
326
313
|
});
|
|
327
|
-
return
|
|
314
|
+
return u(n.prototype, {
|
|
328
315
|
/**
|
|
329
316
|
* 实例级的默认选项
|
|
330
317
|
*/
|
|
@@ -340,20 +327,20 @@ function J(n, e, t) {
|
|
|
340
327
|
get options() {
|
|
341
328
|
return this.modeOptions.fullOption;
|
|
342
329
|
}
|
|
343
|
-
}),
|
|
330
|
+
}), s;
|
|
344
331
|
}
|
|
345
|
-
const
|
|
346
|
-
onUse(
|
|
347
|
-
const
|
|
348
|
-
|
|
332
|
+
const q = {
|
|
333
|
+
onUse(s, e, t) {
|
|
334
|
+
const n = e ?? P;
|
|
335
|
+
a(s, {
|
|
349
336
|
modeOptions: new d(
|
|
350
|
-
|
|
337
|
+
n,
|
|
351
338
|
void 0,
|
|
352
339
|
t
|
|
353
340
|
)
|
|
354
|
-
}),
|
|
341
|
+
}), a(s.prototype, {
|
|
355
342
|
get modeOptions() {
|
|
356
|
-
const r = this, i =
|
|
343
|
+
const r = this, i = s;
|
|
357
344
|
return r._modeOptions || (r._modeOptions = new d(
|
|
358
345
|
i.modeOptions.mode,
|
|
359
346
|
void 0,
|
|
@@ -372,47 +359,47 @@ const Q = {
|
|
|
372
359
|
}
|
|
373
360
|
});
|
|
374
361
|
},
|
|
375
|
-
onCreate(
|
|
376
|
-
|
|
362
|
+
onCreate(s, e) {
|
|
363
|
+
s.modeOptions.setOption(e);
|
|
377
364
|
}
|
|
378
|
-
},
|
|
379
|
-
onUse(
|
|
380
|
-
|
|
365
|
+
}, F = {
|
|
366
|
+
onUse(s, e, t) {
|
|
367
|
+
a(s, {
|
|
381
368
|
/**
|
|
382
369
|
* 全局级别的默认选项
|
|
383
370
|
*/
|
|
384
371
|
defaultOptions: new f(e, t)
|
|
385
|
-
}),
|
|
372
|
+
}), a(s.prototype, {
|
|
386
373
|
/**
|
|
387
374
|
* 实例级的默认选项
|
|
388
375
|
*/
|
|
389
376
|
get defaultOptions() {
|
|
390
|
-
return this._defaultOptions || (this._defaultOptions = new f(void 0,
|
|
377
|
+
return this._defaultOptions || (this._defaultOptions = new f(void 0, s.defaultOptions));
|
|
391
378
|
}
|
|
392
379
|
});
|
|
393
380
|
},
|
|
394
|
-
onCreate(
|
|
395
|
-
|
|
381
|
+
onCreate(s, e) {
|
|
382
|
+
s.defaultOptions.option = e;
|
|
396
383
|
}
|
|
397
384
|
};
|
|
398
|
-
function
|
|
399
|
-
const t =
|
|
385
|
+
function A(s, e) {
|
|
386
|
+
const t = u(s, {
|
|
400
387
|
/**
|
|
401
388
|
* 全局级别的默认选项
|
|
402
389
|
*/
|
|
403
390
|
defaultOptions: new f(e)
|
|
404
391
|
});
|
|
405
|
-
return
|
|
392
|
+
return u(t.prototype, {
|
|
406
393
|
/**
|
|
407
394
|
* 实例级的默认选项
|
|
408
395
|
*/
|
|
409
396
|
get defaultOptions() {
|
|
410
397
|
return this._defaultOptions || (this._defaultOptions = new f(void 0, this.constructor.defaultOptions));
|
|
411
398
|
}
|
|
412
|
-
}),
|
|
399
|
+
}), s;
|
|
413
400
|
}
|
|
414
|
-
function T(
|
|
415
|
-
const e =
|
|
401
|
+
function T(s) {
|
|
402
|
+
const e = u(s, {
|
|
416
403
|
/**
|
|
417
404
|
* 是否使用独立的插件管理器
|
|
418
405
|
* @defaultValue false
|
|
@@ -422,14 +409,14 @@ function T(n) {
|
|
|
422
409
|
* PluginHost 的插件管理器
|
|
423
410
|
*/
|
|
424
411
|
get pluginManager() {
|
|
425
|
-
return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new
|
|
412
|
+
return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new M(this, this._pluginManager)), this._pluginManager;
|
|
426
413
|
},
|
|
427
414
|
// _pluginManager: PluginManager<HOST,Plugin>;
|
|
428
415
|
/**
|
|
429
416
|
* {@inheritDoc PluginExtendManager.usePlugin}
|
|
430
417
|
*/
|
|
431
|
-
usePlugin(t, ...
|
|
432
|
-
return this.pluginManager.usePlugin(t, ...
|
|
418
|
+
usePlugin(t, ...n) {
|
|
419
|
+
return this.pluginManager.usePlugin(t, ...n);
|
|
433
420
|
},
|
|
434
421
|
/**
|
|
435
422
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
@@ -446,7 +433,7 @@ function T(n) {
|
|
|
446
433
|
return this.pluginManager.hasUsed(t);
|
|
447
434
|
}
|
|
448
435
|
});
|
|
449
|
-
return
|
|
436
|
+
return u(e.prototype, {
|
|
450
437
|
/**
|
|
451
438
|
* 插件管理器
|
|
452
439
|
*/
|
|
@@ -459,14 +446,14 @@ function T(n) {
|
|
|
459
446
|
* @param options
|
|
460
447
|
* @returns
|
|
461
448
|
*/
|
|
462
|
-
usePlugin(t, ...
|
|
463
|
-
return this.pluginManager.instUsePlugin(this, t, ...
|
|
449
|
+
usePlugin(t, ...n) {
|
|
450
|
+
return this.pluginManager.instUsePlugin(this, t, ...n);
|
|
464
451
|
},
|
|
465
452
|
/**
|
|
466
453
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
467
454
|
*/
|
|
468
|
-
useExtend(t, ...
|
|
469
|
-
return this.pluginManager.instUseExtend(this, t, ...
|
|
455
|
+
useExtend(t, ...n) {
|
|
456
|
+
return this.pluginManager.instUseExtend(this, t, ...n);
|
|
470
457
|
},
|
|
471
458
|
/**
|
|
472
459
|
* 初始化实例
|
|
@@ -482,19 +469,19 @@ function T(n) {
|
|
|
482
469
|
async destroy() {
|
|
483
470
|
if (await this.pluginManager.onDestroy(this), super.destroy) return super.destroy();
|
|
484
471
|
}
|
|
485
|
-
}),
|
|
472
|
+
}), s;
|
|
486
473
|
}
|
|
487
|
-
function
|
|
488
|
-
const e = T(
|
|
474
|
+
function S(s) {
|
|
475
|
+
const e = T(s);
|
|
489
476
|
return new Proxy(e, {
|
|
490
|
-
construct: function(t,
|
|
491
|
-
const i = new t(...
|
|
492
|
-
return e.pluginManager.onCreate(this, ...
|
|
477
|
+
construct: function(t, n, r) {
|
|
478
|
+
const i = new t(...n);
|
|
479
|
+
return e.pluginManager.onCreate(this, ...n), i;
|
|
493
480
|
}
|
|
494
481
|
});
|
|
495
482
|
}
|
|
496
|
-
function
|
|
497
|
-
return class extends
|
|
483
|
+
function z(s) {
|
|
484
|
+
return class extends s {
|
|
498
485
|
/**
|
|
499
486
|
* 是否使用独立的插件管理器
|
|
500
487
|
* @defaultValue false
|
|
@@ -504,9 +491,9 @@ function L(n) {
|
|
|
504
491
|
* 插件管理器
|
|
505
492
|
*/
|
|
506
493
|
static get pluginManager() {
|
|
507
|
-
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new
|
|
494
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new M(this, this._pluginManager)), this._pluginManager;
|
|
508
495
|
}
|
|
509
|
-
static _pluginManager = new
|
|
496
|
+
static _pluginManager = new M(this);
|
|
510
497
|
/**
|
|
511
498
|
* 插件管理器 {@link PluginHostExtends.pluginManager}
|
|
512
499
|
*/
|
|
@@ -516,8 +503,8 @@ function L(n) {
|
|
|
516
503
|
/**
|
|
517
504
|
* {@inheritDoc PluginExtendManager.usePlugin}
|
|
518
505
|
*/
|
|
519
|
-
static usePlugin(t, ...
|
|
520
|
-
return this.pluginManager.usePlugin(t, ...
|
|
506
|
+
static usePlugin(t, ...n) {
|
|
507
|
+
return this.pluginManager.usePlugin(t, ...n);
|
|
521
508
|
}
|
|
522
509
|
/**
|
|
523
510
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
@@ -542,14 +529,14 @@ function L(n) {
|
|
|
542
529
|
* @param args
|
|
543
530
|
* @returns
|
|
544
531
|
*/
|
|
545
|
-
usePlugin(t, ...
|
|
546
|
-
return this.pluginManager.instUsePlugin(this, t, ...
|
|
532
|
+
usePlugin(t, ...n) {
|
|
533
|
+
return this.pluginManager.instUsePlugin(this, t, ...n);
|
|
547
534
|
}
|
|
548
535
|
/**
|
|
549
536
|
* {@inheritDoc PluginExtendManager.useExtend}
|
|
550
537
|
*/
|
|
551
|
-
useExtend(t, ...
|
|
552
|
-
return this.pluginManager.instUseExtend(this, t, ...
|
|
538
|
+
useExtend(t, ...n) {
|
|
539
|
+
return this.pluginManager.instUseExtend(this, t, ...n);
|
|
553
540
|
}
|
|
554
541
|
/**
|
|
555
542
|
* 初始化实例
|
|
@@ -559,9 +546,9 @@ function L(n) {
|
|
|
559
546
|
*/
|
|
560
547
|
init(...t) {
|
|
561
548
|
if (super.init) {
|
|
562
|
-
const
|
|
563
|
-
if (
|
|
564
|
-
return
|
|
549
|
+
const n = super.init(...t);
|
|
550
|
+
if (n instanceof Promise)
|
|
551
|
+
return n.then(() => this.pluginManager.onInit(this, ...t));
|
|
565
552
|
}
|
|
566
553
|
return this.pluginManager.onInit(this, ...t);
|
|
567
554
|
}
|
|
@@ -576,55 +563,61 @@ function L(n) {
|
|
|
576
563
|
};
|
|
577
564
|
}
|
|
578
565
|
export {
|
|
579
|
-
|
|
580
|
-
|
|
581
|
-
|
|
582
|
-
|
|
583
|
-
|
|
566
|
+
R as ExtendManager,
|
|
567
|
+
J as ModeOptions,
|
|
568
|
+
M as PluginExtendManager,
|
|
569
|
+
Q as PluginHost,
|
|
570
|
+
I as PluginManager,
|
|
584
571
|
d as TierModeOptions,
|
|
585
|
-
|
|
572
|
+
X as TierModeOptionsPluginHost,
|
|
586
573
|
f as TierOptions,
|
|
587
|
-
|
|
588
|
-
|
|
589
|
-
|
|
574
|
+
Y as TierOptionsPluginHost,
|
|
575
|
+
B as addDefaultOptions,
|
|
576
|
+
N as addInstOptions,
|
|
590
577
|
T as becomePluginHost,
|
|
591
|
-
|
|
592
|
-
|
|
593
|
-
|
|
594
|
-
|
|
595
|
-
|
|
596
|
-
|
|
597
|
-
|
|
598
|
-
|
|
599
|
-
|
|
600
|
-
|
|
601
|
-
|
|
602
|
-
|
|
603
|
-
|
|
604
|
-
|
|
605
|
-
|
|
606
|
-
|
|
607
|
-
|
|
578
|
+
z as becomePluginHost_Extends,
|
|
579
|
+
S as becomePluginHost_Proxy,
|
|
580
|
+
V as becomeTierModeOptionsHost,
|
|
581
|
+
A as becomeTierOptionsHost,
|
|
582
|
+
P as commonModeName,
|
|
583
|
+
b as createDefineExtend,
|
|
584
|
+
Z as createDefineIExtend,
|
|
585
|
+
L as createDefineMixin,
|
|
586
|
+
j as createExtendTarget,
|
|
587
|
+
K as createIExtendTarget,
|
|
588
|
+
tt as createMixinTarget,
|
|
589
|
+
et as createPluginHost,
|
|
590
|
+
k as createPropertySetter,
|
|
591
|
+
v as createTargetExtend,
|
|
592
|
+
nt as createTargetIExtend,
|
|
593
|
+
st as createTargetMixin,
|
|
594
|
+
rt as createTierModeOptionsPluginHost,
|
|
595
|
+
it as createTierOptionsPluginHost,
|
|
596
|
+
C as defineExtend,
|
|
597
|
+
ot as defineIExtend,
|
|
598
|
+
ut as defineMixin,
|
|
608
599
|
at as extendMark,
|
|
609
|
-
|
|
600
|
+
H as extendTarget,
|
|
610
601
|
pt as getPropertyValue,
|
|
611
602
|
ct as getPropertyValueByPath,
|
|
612
|
-
|
|
613
|
-
gt as
|
|
614
|
-
|
|
615
|
-
|
|
616
|
-
|
|
617
|
-
|
|
618
|
-
|
|
619
|
-
|
|
620
|
-
|
|
621
|
-
|
|
622
|
-
|
|
623
|
-
|
|
624
|
-
|
|
625
|
-
|
|
626
|
-
|
|
627
|
-
|
|
628
|
-
|
|
629
|
-
|
|
603
|
+
x as getTargetProperties,
|
|
604
|
+
gt as iextendTarget,
|
|
605
|
+
lt as isPlugin,
|
|
606
|
+
m as mergeProperties,
|
|
607
|
+
a as mixin,
|
|
608
|
+
ht as mixinByOmit,
|
|
609
|
+
dt as mixinByPick,
|
|
610
|
+
y as mixinIExtend,
|
|
611
|
+
u as mixinTarget,
|
|
612
|
+
ft as parsePropertyPath,
|
|
613
|
+
Mt as pickHostExtendMembers,
|
|
614
|
+
mt as setPropertyValue,
|
|
615
|
+
Ot as setPropertyValueByPath,
|
|
616
|
+
D as targetExtend,
|
|
617
|
+
yt as targetIExtend,
|
|
618
|
+
Pt as targetMixin,
|
|
619
|
+
xt as tierModeOptionsDecorator,
|
|
620
|
+
q as tierModeOptionsPlugin,
|
|
621
|
+
Tt as tierOptionsDecorator,
|
|
622
|
+
F as tierOptionsPlugin
|
|
630
623
|
};
|