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