plugin-tls 2.0.0 → 3.0.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/extend/extend.d.ts +11 -19
- package/dist/extend/extend.d.ts.map +1 -1
- package/dist/extend/index.d.ts +3 -0
- package/dist/extend/index.d.ts.map +1 -0
- package/dist/extend/mixin.d.ts.map +1 -1
- package/dist/index.d.ts +6 -12
- package/dist/index.d.ts.map +1 -1
- package/dist/index.js +586 -263
- package/dist/index.umd.cjs +1 -1
- package/dist/options-manager/defaultOptions.d.ts +2 -2
- package/dist/options-manager/defaultOptions.d.ts.map +1 -1
- package/dist/options-manager/index.d.ts +6 -0
- package/dist/options-manager/index.d.ts.map +1 -0
- package/dist/options-plugin-host/index.d.ts +3 -0
- package/dist/options-plugin-host/index.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts +28 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHost.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts +29 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventEmitter.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts +28 -0
- package/dist/options-plugin-host/tier-mode-options/TierModeOptionsPluginHostEventTarget.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/createTierModeOptionsPluginHost.d.ts +58 -0
- package/dist/options-plugin-host/tier-mode-options/createTierModeOptionsPluginHost.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/index.d.ts +6 -0
- package/dist/options-plugin-host/tier-mode-options/index.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-mode-options/type.d.ts +7 -0
- package/dist/options-plugin-host/tier-mode-options/type.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts +25 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHost.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts +26 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHostEventEmitter.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts +25 -0
- package/dist/options-plugin-host/tier-options/TierOptionsPluginHostEventTarget.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-options/createTierOptionsPluginHost.d.ts +55 -0
- package/dist/options-plugin-host/tier-options/createTierOptionsPluginHost.d.ts.map +1 -0
- package/dist/options-plugin-host/tier-options/index.d.ts +5 -0
- package/dist/options-plugin-host/tier-options/index.d.ts.map +1 -0
- package/dist/plugin-host/PluginHost.d.ts +41 -187
- package/dist/plugin-host/PluginHost.d.ts.map +1 -1
- package/dist/plugin-host/PluginHostEventEmitter.d.ts +64 -0
- package/dist/plugin-host/PluginHostEventEmitter.d.ts.map +1 -0
- package/dist/plugin-host/PluginHostEventTarget.d.ts +62 -0
- package/dist/plugin-host/PluginHostEventTarget.d.ts.map +1 -0
- package/dist/plugin-host/createPluginHost.d.ts +87 -0
- package/dist/plugin-host/createPluginHost.d.ts.map +1 -0
- package/dist/plugin-host/decorator.d.ts +177 -0
- package/dist/plugin-host/decorator.d.ts.map +1 -0
- package/dist/plugin-host/index.d.ts +7 -0
- package/dist/plugin-host/index.d.ts.map +1 -0
- package/dist/plugin-host/type.d.ts +52 -0
- package/dist/plugin-host/type.d.ts.map +1 -0
- package/dist/plugin-manager/IPlugin.d.ts +47 -0
- package/dist/plugin-manager/IPlugin.d.ts.map +1 -0
- package/dist/plugin-manager/PluginManager.d.ts +27 -80
- package/dist/plugin-manager/PluginManager.d.ts.map +1 -1
- package/dist/plugin-manager/index.d.ts +3 -0
- package/dist/plugin-manager/index.d.ts.map +1 -0
- package/dist/plugins/index.d.ts +3 -0
- package/dist/plugins/index.d.ts.map +1 -0
- package/dist/plugins/tier-mode-options/decorator.d.ts +14 -0
- package/dist/plugins/tier-mode-options/decorator.d.ts.map +1 -0
- package/dist/plugins/tier-mode-options/plugin.d.ts +3 -0
- package/dist/plugins/tier-mode-options/plugin.d.ts.map +1 -0
- package/dist/plugins/tier-mode-options/type.d.ts +35 -0
- package/dist/plugins/tier-mode-options/type.d.ts.map +1 -0
- package/dist/plugins/tier-mode-options-plugin.d.ts +4 -0
- package/dist/plugins/tier-mode-options-plugin.d.ts.map +1 -0
- package/dist/plugins/tier-options/decorator.d.ts +14 -0
- package/dist/plugins/tier-options/decorator.d.ts.map +1 -0
- package/dist/plugins/tier-options/plugin.d.ts +11 -0
- package/dist/plugins/tier-options/plugin.d.ts.map +1 -0
- package/dist/plugins/tier-options/type.d.ts +36 -0
- package/dist/plugins/tier-options/type.d.ts.map +1 -0
- package/dist/plugins/tier-options-plugin.d.ts +4 -0
- package/dist/plugins/tier-options-plugin.d.ts.map +1 -0
- package/doc/api/plugin-tls.adddefaultoptions.md +2 -2
- package/doc/api/plugin-tls.addinstoptions.md +1 -1
- package/doc/api/plugin-tls.becomepluginhost.md +1 -1
- package/doc/api/plugin-tls.becomepluginhost_extends.md +9 -3
- package/doc/api/plugin-tls.becomepluginhost_proxy.md +1 -1
- package/doc/api/plugin-tls.becometiermodeoptionshost.md +1 -1
- package/doc/api/plugin-tls.becometieroptionshost.md +1 -1
- package/doc/api/plugin-tls.classextender.md +1 -1
- package/doc/api/plugin-tls.classextenderprivatemember.md +1 -1
- package/doc/api/plugin-tls.classextenderprivatememberwithinit.md +1 -1
- package/doc/api/plugin-tls.classextenderwithinit.md +1 -1
- package/doc/api/plugin-tls.createpluginhost.md +39 -6
- package/doc/api/plugin-tls.createtiermodeoptionspluginhost.md +41 -5
- package/doc/api/plugin-tls.createtieroptionspluginhost.md +41 -5
- package/doc/api/plugin-tls.hostinst.md +1 -1
- package/doc/api/plugin-tls.privatememberofextend.md +1 -1
- package/doc/api/plugin-tls.privatememberofextendwithinit.md +1 -1
- package/package.json +3 -3
- package/dist/plugin-host/TierModeOptionsPluginHost.d.ts +0 -131
- package/dist/plugin-host/TierModeOptionsPluginHost.d.ts.map +0 -1
- package/dist/plugin-host/TierOptionsPluginHost.d.ts +0 -117
- package/dist/plugin-host/TierOptionsPluginHost.d.ts.map +0 -1
- package/dist/plugin-manager/PluginManagerWithInit.d.ts +0 -36
- package/dist/plugin-manager/PluginManagerWithInit.d.ts.map +0 -1
package/dist/index.js
CHANGED
|
@@ -1,186 +1,185 @@
|
|
|
1
|
-
import { deepmergeInto as
|
|
2
|
-
import {
|
|
3
|
-
function
|
|
1
|
+
import { deepmergeInto as m, deepmerge as P } from "deepmerge-ts";
|
|
2
|
+
import { Destroyable as T, DestroyableEventEmitter as V, DestroyableEventTarget as I, createDestroyableSubClass as C } from "@gby/destroyable";
|
|
3
|
+
function d(n, ...t) {
|
|
4
4
|
for (const e of t) {
|
|
5
5
|
const i = Object.getOwnPropertyDescriptors(e);
|
|
6
6
|
Object.defineProperties(n, i);
|
|
7
7
|
}
|
|
8
8
|
return n;
|
|
9
9
|
}
|
|
10
|
-
function
|
|
10
|
+
function z(n, t) {
|
|
11
11
|
return t;
|
|
12
12
|
}
|
|
13
|
-
function
|
|
13
|
+
function $() {
|
|
14
14
|
return function(t, e) {
|
|
15
15
|
return e;
|
|
16
16
|
};
|
|
17
17
|
}
|
|
18
|
-
function
|
|
19
|
-
return
|
|
18
|
+
function q(n, t) {
|
|
19
|
+
return d(n, t), t;
|
|
20
20
|
}
|
|
21
|
-
function
|
|
21
|
+
function B(n) {
|
|
22
22
|
return function(e) {
|
|
23
|
-
return
|
|
23
|
+
return d(n, e), e;
|
|
24
24
|
};
|
|
25
25
|
}
|
|
26
|
-
function
|
|
27
|
-
return
|
|
26
|
+
function g(n, t) {
|
|
27
|
+
return d(n, t), n;
|
|
28
28
|
}
|
|
29
|
-
function
|
|
29
|
+
function K(n) {
|
|
30
30
|
return function(e) {
|
|
31
|
-
return
|
|
31
|
+
return d(n, e), n;
|
|
32
32
|
};
|
|
33
33
|
}
|
|
34
|
-
function
|
|
34
|
+
function R(n, t) {
|
|
35
35
|
return t;
|
|
36
36
|
}
|
|
37
37
|
function O(n, t) {
|
|
38
|
-
|
|
38
|
+
d(n.prototype, t);
|
|
39
39
|
const e = t._constructor;
|
|
40
40
|
typeof e == "function" && (n._constructors ?? (n._constructors = [])).push(e);
|
|
41
41
|
const i = t._destroy;
|
|
42
42
|
return typeof i == "function" && (n._destroys ?? (n._destroys = [])).push(i), t;
|
|
43
43
|
}
|
|
44
|
-
function
|
|
44
|
+
function G(n) {
|
|
45
45
|
return function(e) {
|
|
46
46
|
return O(n, e), e;
|
|
47
47
|
};
|
|
48
48
|
}
|
|
49
|
-
function
|
|
49
|
+
function b(n, t) {
|
|
50
50
|
return O(n, t), n;
|
|
51
51
|
}
|
|
52
|
-
function
|
|
52
|
+
function J(n) {
|
|
53
53
|
return function(e) {
|
|
54
54
|
return O(n, e), n;
|
|
55
55
|
};
|
|
56
56
|
}
|
|
57
|
-
function
|
|
57
|
+
function M(n, t, e) {
|
|
58
58
|
for (const i of n)
|
|
59
59
|
i.apply(t, e);
|
|
60
60
|
}
|
|
61
|
-
function
|
|
61
|
+
function Q(n) {
|
|
62
62
|
return {
|
|
63
63
|
constructed: function(t, e) {
|
|
64
|
-
|
|
64
|
+
M(n._constructors ?? [], t, e);
|
|
65
65
|
},
|
|
66
66
|
initialized: function(t, e) {
|
|
67
|
-
|
|
67
|
+
M(n._inits ?? [], t, e);
|
|
68
68
|
},
|
|
69
69
|
destroyed: function(t, e) {
|
|
70
|
-
|
|
70
|
+
M(n._destroys ?? [], t, e);
|
|
71
71
|
}
|
|
72
72
|
};
|
|
73
73
|
}
|
|
74
|
-
function
|
|
74
|
+
function X(n, t) {
|
|
75
75
|
return t;
|
|
76
76
|
}
|
|
77
|
-
function
|
|
77
|
+
function x(n, t) {
|
|
78
78
|
O(n, t);
|
|
79
79
|
const e = t._init;
|
|
80
80
|
return typeof e == "function" && (n._inits ?? (n._inits = [])).push(e), t;
|
|
81
81
|
}
|
|
82
|
-
function
|
|
82
|
+
function Y(n) {
|
|
83
83
|
return function(e) {
|
|
84
|
-
return
|
|
84
|
+
return x(n, e), e;
|
|
85
85
|
};
|
|
86
86
|
}
|
|
87
|
-
function
|
|
88
|
-
return
|
|
87
|
+
function Z(n, t) {
|
|
88
|
+
return x(n, t), n;
|
|
89
89
|
}
|
|
90
90
|
function L(n) {
|
|
91
91
|
return function(e) {
|
|
92
|
-
return
|
|
92
|
+
return x(n, e), n;
|
|
93
93
|
};
|
|
94
94
|
}
|
|
95
|
-
class
|
|
95
|
+
class l extends T {
|
|
96
96
|
/**
|
|
97
97
|
* 插件的宿主
|
|
98
98
|
*/
|
|
99
99
|
host;
|
|
100
100
|
/**
|
|
101
|
-
*
|
|
102
|
-
*/
|
|
103
|
-
pluginOptsMap = /* @__PURE__ */ new Map();
|
|
104
|
-
/**
|
|
105
|
-
* 注册的插件
|
|
101
|
+
* 所有注册的插件
|
|
106
102
|
*/
|
|
107
|
-
plugins =
|
|
103
|
+
plugins = /* @__PURE__ */ new Map();
|
|
108
104
|
/**
|
|
109
105
|
* @param host - 插件的宿主
|
|
110
106
|
*/
|
|
111
107
|
constructor(t) {
|
|
112
|
-
t && (this.host = t);
|
|
108
|
+
super(), t && (this.host = t);
|
|
109
|
+
}
|
|
110
|
+
destroyThis() {
|
|
111
|
+
return this.plugins.clear(), super.destroyThis();
|
|
113
112
|
}
|
|
114
113
|
/**
|
|
115
114
|
* 使用插件、注册插件
|
|
116
115
|
* @param plugin - 插件
|
|
117
|
-
* @param
|
|
116
|
+
* @param args - 传递给插件的选项
|
|
118
117
|
*/
|
|
119
118
|
use(t, ...e) {
|
|
120
|
-
const {
|
|
121
|
-
if (
|
|
122
|
-
|
|
119
|
+
const { plugins: i } = this;
|
|
120
|
+
if (i.has(t)) return i.get(t);
|
|
121
|
+
const s = t.onUse(this.host, ...e);
|
|
122
|
+
return i.set(t, s), s;
|
|
123
123
|
}
|
|
124
124
|
/**
|
|
125
125
|
* 插件宿主创建实例时调用
|
|
126
126
|
*
|
|
127
127
|
* @remarks
|
|
128
|
-
* 会调用每个插件的 {@link IPlugin.
|
|
128
|
+
* 会调用每个插件的 {@link IPlugin.onCreate} 方法
|
|
129
|
+
* 如果插件的 created 方法返回 Promise,则会等待 Promise resolve
|
|
129
130
|
* @param hostInst - 插件宿主的新实例
|
|
130
131
|
*/
|
|
131
|
-
|
|
132
|
-
const
|
|
133
|
-
|
|
134
|
-
|
|
135
|
-
s.created?.(t, o);
|
|
132
|
+
async onCreate(t, ...e) {
|
|
133
|
+
for (const [i] of this.plugins) {
|
|
134
|
+
const s = i.onCreate?.(t, ...e);
|
|
135
|
+
s instanceof Promise && await s;
|
|
136
136
|
}
|
|
137
137
|
}
|
|
138
138
|
/**
|
|
139
|
-
*
|
|
139
|
+
* 插件宿主创建实例时调用
|
|
140
140
|
*
|
|
141
141
|
* @remarks
|
|
142
|
-
* 会调用每个插件的 {@link IPlugin.
|
|
143
|
-
* @param hostInst -
|
|
142
|
+
* 会调用每个插件的 {@link IPlugin.onCreate } 方法
|
|
143
|
+
* @param hostInst - 插件宿主的新实例
|
|
144
|
+
* @param args - 初始化宿主实例时的参数
|
|
144
145
|
*/
|
|
145
|
-
|
|
146
|
-
const
|
|
147
|
-
|
|
148
|
-
|
|
149
|
-
s.destroyed?.(t, o);
|
|
146
|
+
async onInit(t, ...e) {
|
|
147
|
+
for (const [i] of this.plugins) {
|
|
148
|
+
const s = i.onInit?.(t, ...e);
|
|
149
|
+
s instanceof Promise && await s;
|
|
150
150
|
}
|
|
151
151
|
}
|
|
152
152
|
/**
|
|
153
|
-
*
|
|
153
|
+
* 插件宿主被销毁时调用
|
|
154
154
|
*
|
|
155
155
|
* @remarks
|
|
156
|
-
* 会调用每个插件的 {@link IPlugin.
|
|
157
|
-
* @param hostInst -
|
|
156
|
+
* 会调用每个插件的 {@link IPlugin.onDestroy} 方法
|
|
157
|
+
* @param hostInst - 被销毁的插件实例
|
|
158
158
|
*/
|
|
159
|
-
|
|
160
|
-
|
|
161
|
-
|
|
159
|
+
async onDestroy(t) {
|
|
160
|
+
for (const [e] of this.plugins) {
|
|
161
|
+
const i = e.onDestroy?.(t);
|
|
162
|
+
i instanceof Promise && await i;
|
|
163
|
+
}
|
|
162
164
|
}
|
|
163
|
-
}
|
|
164
|
-
class Q extends g {
|
|
165
165
|
/**
|
|
166
|
-
*
|
|
166
|
+
* 插件宿主实例的注册插件的方法
|
|
167
167
|
*
|
|
168
168
|
* @remarks
|
|
169
|
-
* 会调用每个插件的 {@link IPlugin.
|
|
169
|
+
* 会调用每个插件的 {@link IPlugin.use } 方法
|
|
170
170
|
* @param hostInst - 插件宿主的新实例
|
|
171
171
|
*/
|
|
172
|
-
|
|
173
|
-
const { plugins:
|
|
174
|
-
|
|
175
|
-
|
|
176
|
-
|
|
177
|
-
}
|
|
172
|
+
instUse(t, e, ...i) {
|
|
173
|
+
const { plugins: s } = this;
|
|
174
|
+
if (s.has(e)) return s.get(e);
|
|
175
|
+
const o = this.use(e, ...i);
|
|
176
|
+
return e.onCreate?.(t), o;
|
|
178
177
|
}
|
|
179
178
|
}
|
|
180
|
-
function
|
|
179
|
+
function tt(n, t) {
|
|
181
180
|
const e = t ?? "defaultOptions", i = `_${e}`;
|
|
182
181
|
return function(o) {
|
|
183
|
-
const r =
|
|
182
|
+
const r = g(o, {
|
|
184
183
|
/**
|
|
185
184
|
* 全局级别的默认选项
|
|
186
185
|
*/
|
|
@@ -188,7 +187,7 @@ function X(n, t) {
|
|
|
188
187
|
return n;
|
|
189
188
|
}
|
|
190
189
|
});
|
|
191
|
-
|
|
190
|
+
b(r, {
|
|
192
191
|
/**
|
|
193
192
|
* 实例级的默认选项
|
|
194
193
|
*/
|
|
@@ -198,9 +197,9 @@ function X(n, t) {
|
|
|
198
197
|
});
|
|
199
198
|
};
|
|
200
199
|
}
|
|
201
|
-
function
|
|
200
|
+
function et(n, t, e) {
|
|
202
201
|
const i = `_${t}`;
|
|
203
|
-
return
|
|
202
|
+
return b(n, {
|
|
204
203
|
/**
|
|
205
204
|
* 实例级的默认选项
|
|
206
205
|
*/
|
|
@@ -209,19 +208,19 @@ function Y(n, t, e) {
|
|
|
209
208
|
}
|
|
210
209
|
}), e;
|
|
211
210
|
}
|
|
212
|
-
function
|
|
211
|
+
function v(n) {
|
|
213
212
|
const t = n.split(".");
|
|
214
213
|
return t[0] === "" && t.shift(), t;
|
|
215
214
|
}
|
|
216
|
-
function
|
|
215
|
+
function y(n, t) {
|
|
217
216
|
for (const e of t)
|
|
218
217
|
if (n = n[e], n == null) return;
|
|
219
218
|
return n;
|
|
220
219
|
}
|
|
221
|
-
function
|
|
222
|
-
return
|
|
220
|
+
function nt(n, t) {
|
|
221
|
+
return y(n, v(t));
|
|
223
222
|
}
|
|
224
|
-
function
|
|
223
|
+
function F(n, t, e) {
|
|
225
224
|
const i = t.pop(), s = t.length;
|
|
226
225
|
let o = 0;
|
|
227
226
|
for (; o < s; ) {
|
|
@@ -234,8 +233,8 @@ function b(n, t, e) {
|
|
|
234
233
|
n = n[r] = {};
|
|
235
234
|
return n[i] = e, n;
|
|
236
235
|
}
|
|
237
|
-
function
|
|
238
|
-
return
|
|
236
|
+
function it(n, t, e) {
|
|
237
|
+
return F(n, v(t), e);
|
|
239
238
|
}
|
|
240
239
|
const _ = {
|
|
241
240
|
UndefinedAndNull: function(t) {
|
|
@@ -248,7 +247,7 @@ const _ = {
|
|
|
248
247
|
return t === null;
|
|
249
248
|
}
|
|
250
249
|
};
|
|
251
|
-
class
|
|
250
|
+
class E {
|
|
252
251
|
/**
|
|
253
252
|
* 是否要冻结 fullOption 的成员
|
|
254
253
|
* @remarks
|
|
@@ -300,7 +299,7 @@ class v {
|
|
|
300
299
|
* @param deep - 是否要进行深度合并
|
|
301
300
|
*/
|
|
302
301
|
setOption(t, e) {
|
|
303
|
-
const i = e ?
|
|
302
|
+
const i = e ? m(this.option, t) : Object.assign(this.option, t);
|
|
304
303
|
return this.updateFullOption(), i;
|
|
305
304
|
}
|
|
306
305
|
/**
|
|
@@ -337,7 +336,7 @@ class v {
|
|
|
337
336
|
delete s[t];
|
|
338
337
|
else {
|
|
339
338
|
const o = s[t];
|
|
340
|
-
i && o && typeof o == "object" ?
|
|
339
|
+
i && o && typeof o == "object" ? m(o, e) : s[t] = e;
|
|
341
340
|
}
|
|
342
341
|
this.updateFullOption();
|
|
343
342
|
}
|
|
@@ -347,7 +346,7 @@ class v {
|
|
|
347
346
|
* @returns
|
|
348
347
|
*/
|
|
349
348
|
getValue(t) {
|
|
350
|
-
return
|
|
349
|
+
return y(this.option, t);
|
|
351
350
|
}
|
|
352
351
|
/**
|
|
353
352
|
* 设置属性路径对应的值
|
|
@@ -359,10 +358,10 @@ class v {
|
|
|
359
358
|
setValue(t, e, i) {
|
|
360
359
|
const s = this.option;
|
|
361
360
|
let o;
|
|
362
|
-
i && (o =
|
|
361
|
+
i && (o = y(s, t)) && typeof o == "object" ? m(o, e) : F(this.option, t, e), this.updateFullOption();
|
|
363
362
|
}
|
|
364
363
|
}
|
|
365
|
-
class
|
|
364
|
+
class u extends E {
|
|
366
365
|
constructor(t, e) {
|
|
367
366
|
super(), t && (this.option = t), e && (this.extends = e);
|
|
368
367
|
}
|
|
@@ -391,7 +390,7 @@ class p extends v {
|
|
|
391
390
|
const { extends: e, option: i } = this;
|
|
392
391
|
if (t = i, e) {
|
|
393
392
|
const s = e.plainFullOption;
|
|
394
|
-
t =
|
|
393
|
+
t = P(s, i);
|
|
395
394
|
}
|
|
396
395
|
return this._plainFullOption = t;
|
|
397
396
|
}
|
|
@@ -427,15 +426,15 @@ class p extends v {
|
|
|
427
426
|
return i.getValue(t);
|
|
428
427
|
}
|
|
429
428
|
}
|
|
430
|
-
function
|
|
429
|
+
function st(n, t) {
|
|
431
430
|
const { name: e } = t, i = `_${e}`;
|
|
432
431
|
return {
|
|
433
432
|
get: function() {
|
|
434
|
-
return this[i] || (this[i] = new
|
|
433
|
+
return this[i] || (this[i] = new u(void 0, this.constructor[e]));
|
|
435
434
|
}
|
|
436
435
|
};
|
|
437
436
|
}
|
|
438
|
-
class
|
|
437
|
+
class j extends E {
|
|
439
438
|
constructor(t, e) {
|
|
440
439
|
super(), e && this.setModeOption(t, e), this.mode = t;
|
|
441
440
|
}
|
|
@@ -525,15 +524,15 @@ class E extends v {
|
|
|
525
524
|
* @param extend - 继承哪个模式
|
|
526
525
|
*/
|
|
527
526
|
setModeOption(t, e, i, s) {
|
|
528
|
-
const { modes: o } = this, r = o[t] || (o[t] = new
|
|
527
|
+
const { modes: o } = this, r = o[t] || (o[t] = new u());
|
|
529
528
|
if (r.setOption(e, i), s) {
|
|
530
|
-
const
|
|
531
|
-
|
|
529
|
+
const p = o[s];
|
|
530
|
+
p && (r.extends = p);
|
|
532
531
|
}
|
|
533
532
|
return this.updateFullOption(), r;
|
|
534
533
|
}
|
|
535
534
|
}
|
|
536
|
-
class
|
|
535
|
+
class a extends j {
|
|
537
536
|
constructor(t, e, i) {
|
|
538
537
|
super(t, e), i && (this.extends = i);
|
|
539
538
|
}
|
|
@@ -558,7 +557,7 @@ class c extends E {
|
|
|
558
557
|
const { modes: e, extends: i } = this, s = e[t]?.plainFullOption;
|
|
559
558
|
if (i) {
|
|
560
559
|
const o = i.getFullModeOption(t);
|
|
561
|
-
return s ?
|
|
560
|
+
return s ? P(o, s) : o;
|
|
562
561
|
}
|
|
563
562
|
return s;
|
|
564
563
|
}
|
|
@@ -622,23 +621,89 @@ class c extends E {
|
|
|
622
621
|
return i.getValue(t);
|
|
623
622
|
}
|
|
624
623
|
}
|
|
625
|
-
function
|
|
624
|
+
function ot(n, t) {
|
|
626
625
|
const { name: e } = t, i = `_${e}`;
|
|
627
626
|
return {
|
|
628
627
|
get: function() {
|
|
629
|
-
return this[i] || (this[i] = new
|
|
628
|
+
return this[i] || (this[i] = new a(this.constructor[e].mode, void 0, this.constructor[e]));
|
|
630
629
|
}
|
|
631
630
|
};
|
|
632
631
|
}
|
|
632
|
+
class U extends T {
|
|
633
|
+
/**
|
|
634
|
+
* 是否使用独立的插件管理器
|
|
635
|
+
* @defaultValue false
|
|
636
|
+
*/
|
|
637
|
+
static isolatedPluginManager = !1;
|
|
638
|
+
/**
|
|
639
|
+
* 插件管理器
|
|
640
|
+
*/
|
|
641
|
+
static get pluginManager() {
|
|
642
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new l(this)), this._pluginManager;
|
|
643
|
+
}
|
|
644
|
+
static _pluginManager = new l(this);
|
|
645
|
+
/**
|
|
646
|
+
* 插件管理器 {@link PluginHost.pluginManager}
|
|
647
|
+
*/
|
|
648
|
+
get pluginManager() {
|
|
649
|
+
return this.constructor.pluginManager;
|
|
650
|
+
}
|
|
651
|
+
/**
|
|
652
|
+
* {@inheritDoc PluginManager.use}
|
|
653
|
+
*/
|
|
654
|
+
static use(t, ...e) {
|
|
655
|
+
return this.pluginManager.use(t, ...e);
|
|
656
|
+
}
|
|
657
|
+
/**
|
|
658
|
+
* 需要在子类中调用
|
|
659
|
+
*
|
|
660
|
+
* 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
|
|
661
|
+
* 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
|
|
662
|
+
*/
|
|
663
|
+
// constructor(...args:any) {
|
|
664
|
+
// super();
|
|
665
|
+
// // @ts-ignore
|
|
666
|
+
// this.pluginManager.onCreate(this,...args);
|
|
667
|
+
// }
|
|
668
|
+
/**
|
|
669
|
+
* 实例的注册插件的方法
|
|
670
|
+
* @param plugin
|
|
671
|
+
* @param args
|
|
672
|
+
* @returns
|
|
673
|
+
*/
|
|
674
|
+
use(t, ...e) {
|
|
675
|
+
return this.pluginManager.instUse(this, t, ...e);
|
|
676
|
+
}
|
|
677
|
+
/**
|
|
678
|
+
* 初始化实例
|
|
679
|
+
* @remarks
|
|
680
|
+
* 会调用 {@link PluginManager.onInit}
|
|
681
|
+
* @param args
|
|
682
|
+
*/
|
|
683
|
+
init(...t) {
|
|
684
|
+
return this.pluginManager.onInit(this, ...t);
|
|
685
|
+
}
|
|
686
|
+
/**
|
|
687
|
+
* 销毁实例
|
|
688
|
+
* @returns
|
|
689
|
+
*/
|
|
690
|
+
async destroyThis() {
|
|
691
|
+
return await this.pluginManager.onDestroy(this), super.destroyThis();
|
|
692
|
+
}
|
|
693
|
+
}
|
|
633
694
|
class N extends V {
|
|
695
|
+
/**
|
|
696
|
+
* 是否使用独立的插件管理器
|
|
697
|
+
* @defaultValue false
|
|
698
|
+
*/
|
|
699
|
+
static isolatedPluginManager = !1;
|
|
634
700
|
/**
|
|
635
701
|
* 插件管理器
|
|
636
702
|
*/
|
|
637
703
|
static get pluginManager() {
|
|
638
|
-
|
|
639
|
-
return t || (t = this._pluginManager = new g(this)), t;
|
|
704
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new l(this)), this._pluginManager;
|
|
640
705
|
}
|
|
641
|
-
static _pluginManager;
|
|
706
|
+
static _pluginManager = new l(this);
|
|
642
707
|
/**
|
|
643
708
|
* 插件管理器 {@link PluginHost.pluginManager}
|
|
644
709
|
*/
|
|
@@ -654,42 +719,119 @@ class N extends V {
|
|
|
654
719
|
/**
|
|
655
720
|
* 需要在子类中调用
|
|
656
721
|
*
|
|
657
|
-
* 之所以没写在该类中的函数中,是因为 `this.pluginManager.
|
|
658
|
-
* 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.
|
|
722
|
+
* 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
|
|
723
|
+
* 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
|
|
659
724
|
*/
|
|
660
|
-
// constructor() {
|
|
661
|
-
//
|
|
725
|
+
// constructor(...args:any) {
|
|
726
|
+
// super();
|
|
727
|
+
// // @ts-ignore
|
|
728
|
+
// this.pluginManager.onCreate(this,...args);
|
|
662
729
|
// }
|
|
663
730
|
/**
|
|
664
731
|
* 实例的注册插件的方法
|
|
665
732
|
* @param plugin
|
|
666
|
-
* @param
|
|
733
|
+
* @param args
|
|
667
734
|
* @returns
|
|
668
735
|
*/
|
|
669
736
|
use(t, ...e) {
|
|
670
737
|
return this.pluginManager.instUse(this, t, ...e);
|
|
671
738
|
}
|
|
739
|
+
/**
|
|
740
|
+
* 初始化实例
|
|
741
|
+
* @remarks
|
|
742
|
+
* 会调用 {@link PluginManager.onInit}
|
|
743
|
+
* @param args
|
|
744
|
+
*/
|
|
745
|
+
init(...t) {
|
|
746
|
+
return this.pluginManager.onInit(this, ...t);
|
|
747
|
+
}
|
|
672
748
|
/**
|
|
673
749
|
* 销毁实例
|
|
674
750
|
* @returns
|
|
675
751
|
*/
|
|
676
|
-
destroyThis() {
|
|
677
|
-
return this.pluginManager.
|
|
752
|
+
async destroyThis() {
|
|
753
|
+
return await this.pluginManager.onDestroy(this), super.destroyThis();
|
|
678
754
|
}
|
|
679
755
|
}
|
|
680
|
-
|
|
681
|
-
|
|
756
|
+
class D extends I {
|
|
757
|
+
/**
|
|
758
|
+
* 是否使用独立的插件管理器
|
|
759
|
+
* @defaultValue false
|
|
760
|
+
*/
|
|
761
|
+
static isolatedPluginManager = !1;
|
|
762
|
+
/**
|
|
763
|
+
* 插件管理器
|
|
764
|
+
*/
|
|
765
|
+
static get pluginManager() {
|
|
766
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new l(this)), this._pluginManager;
|
|
767
|
+
}
|
|
768
|
+
static _pluginManager = new l(this);
|
|
769
|
+
/**
|
|
770
|
+
* 插件管理器 {@link PluginHost.pluginManager}
|
|
771
|
+
*/
|
|
772
|
+
get pluginManager() {
|
|
773
|
+
return this.constructor.pluginManager;
|
|
774
|
+
}
|
|
775
|
+
/**
|
|
776
|
+
* {@inheritDoc PluginManager.use}
|
|
777
|
+
*/
|
|
778
|
+
static use(t, ...e) {
|
|
779
|
+
return this.pluginManager.use(t, ...e);
|
|
780
|
+
}
|
|
781
|
+
/**
|
|
782
|
+
* 需要在子类中调用
|
|
783
|
+
*
|
|
784
|
+
* 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this,...args)` 通常会在构建函数执行的最后时才调用;
|
|
785
|
+
* 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this,...args)` 不是在最后的执行;
|
|
786
|
+
*/
|
|
787
|
+
// constructor(...args:any) {
|
|
788
|
+
// super();
|
|
789
|
+
// // @ts-ignore
|
|
790
|
+
// this.pluginManager.onCreate(this,...args);
|
|
791
|
+
// }
|
|
792
|
+
/**
|
|
793
|
+
* 实例的注册插件的方法
|
|
794
|
+
* @param plugin
|
|
795
|
+
* @param args
|
|
796
|
+
* @returns
|
|
797
|
+
*/
|
|
798
|
+
use(t, ...e) {
|
|
799
|
+
return this.pluginManager.instUse(this, t, ...e);
|
|
800
|
+
}
|
|
801
|
+
/**
|
|
802
|
+
* 初始化实例
|
|
803
|
+
* @remarks
|
|
804
|
+
* 会调用 {@link PluginManager.onInit}
|
|
805
|
+
* @param args
|
|
806
|
+
*/
|
|
807
|
+
init(...t) {
|
|
808
|
+
return this.pluginManager.onInit(this, ...t);
|
|
809
|
+
}
|
|
810
|
+
/**
|
|
811
|
+
* 销毁实例
|
|
812
|
+
* @returns
|
|
813
|
+
*/
|
|
814
|
+
async destroyThis() {
|
|
815
|
+
return await this.pluginManager.onDestroy(this), super.destroyThis();
|
|
816
|
+
}
|
|
817
|
+
}
|
|
818
|
+
function H(n) {
|
|
819
|
+
const t = C(n);
|
|
682
820
|
return class extends t {
|
|
683
821
|
/**
|
|
684
|
-
*
|
|
822
|
+
* 是否使用独立的插件管理器
|
|
823
|
+
* @defaultValue false
|
|
824
|
+
*/
|
|
825
|
+
static isolatedPluginManager = !1;
|
|
826
|
+
/**
|
|
827
|
+
* 插件管理器
|
|
685
828
|
*/
|
|
686
829
|
static get pluginManager() {
|
|
687
|
-
|
|
688
|
-
return i || (i = this._pluginManager = new g(this)), i;
|
|
830
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new l(this)), this._pluginManager;
|
|
689
831
|
}
|
|
690
|
-
static _pluginManager;
|
|
832
|
+
static _pluginManager = new l(this);
|
|
691
833
|
/**
|
|
692
|
-
*
|
|
834
|
+
* 插件管理器 {@link PluginHostSub.pluginManager}
|
|
693
835
|
*/
|
|
694
836
|
get pluginManager() {
|
|
695
837
|
return this.constructor.pluginManager;
|
|
@@ -700,46 +842,65 @@ function U(n) {
|
|
|
700
842
|
static use(i, ...s) {
|
|
701
843
|
return this.pluginManager.use(i, ...s);
|
|
702
844
|
}
|
|
845
|
+
/**
|
|
846
|
+
* 需要在子类中调用
|
|
847
|
+
*
|
|
848
|
+
* 之所以没写在该类中的函数中,是因为 `this.pluginManager.onCreate(this)` 通常会在构建函数执行的最后时才调用;
|
|
849
|
+
* 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.onCreate(this)` 不是在最后的执行;
|
|
850
|
+
*/
|
|
703
851
|
// constructor() {
|
|
704
|
-
//
|
|
852
|
+
// super();
|
|
853
|
+
// this.pluginManager.onCreate(this);
|
|
705
854
|
// }
|
|
706
|
-
/**
|
|
707
855
|
/**
|
|
708
856
|
* 实例的注册插件的方法
|
|
709
857
|
* @param plugin
|
|
710
|
-
* @param
|
|
858
|
+
* @param args
|
|
711
859
|
* @returns
|
|
712
860
|
*/
|
|
713
861
|
use(i, ...s) {
|
|
714
862
|
return this.pluginManager.instUse(this, i, ...s);
|
|
715
863
|
}
|
|
864
|
+
/**
|
|
865
|
+
* 初始化实例
|
|
866
|
+
* @remarks
|
|
867
|
+
* 会调用 {@link PluginManager.onInit}
|
|
868
|
+
* @param args
|
|
869
|
+
*/
|
|
870
|
+
init(...i) {
|
|
871
|
+
return this.pluginManager.onInit(this, ...i);
|
|
872
|
+
}
|
|
716
873
|
/**
|
|
717
874
|
* 销毁实例
|
|
718
875
|
* @returns
|
|
719
876
|
*/
|
|
720
|
-
destroyThis() {
|
|
721
|
-
return this.pluginManager.
|
|
877
|
+
async destroyThis() {
|
|
878
|
+
return await this.pluginManager.onDestroy(this), super.destroyThis();
|
|
722
879
|
}
|
|
723
880
|
};
|
|
724
881
|
}
|
|
725
|
-
function
|
|
726
|
-
const t =
|
|
882
|
+
function S(n) {
|
|
883
|
+
const t = g(n, {
|
|
884
|
+
/**
|
|
885
|
+
* 是否使用独立的插件管理器
|
|
886
|
+
* @defaultValue false
|
|
887
|
+
*/
|
|
888
|
+
isolatedPluginManager: !1,
|
|
727
889
|
/**
|
|
728
890
|
* PluginHost 的插件管理器
|
|
729
891
|
*/
|
|
730
892
|
get pluginManager() {
|
|
731
|
-
|
|
732
|
-
return e || (e = this._pluginManager = new g(this)), e;
|
|
893
|
+
return (!this._pluginManager || this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager")) && (this._pluginManager = new l(this)), this._pluginManager;
|
|
733
894
|
},
|
|
734
895
|
// _pluginManager: PluginManager<HOST,Plugin>;
|
|
735
896
|
/**
|
|
736
897
|
* {@inheritDoc PluginManager.use}
|
|
737
898
|
*/
|
|
738
|
-
use(e, i) {
|
|
739
|
-
return this.pluginManager.use(e, i);
|
|
899
|
+
use(e, ...i) {
|
|
900
|
+
return this.pluginManager.use(e, ...i);
|
|
740
901
|
}
|
|
741
902
|
});
|
|
742
|
-
return
|
|
903
|
+
return g(t.prototype, {
|
|
743
904
|
/**
|
|
744
905
|
* 插件管理器
|
|
745
906
|
*/
|
|
@@ -752,39 +913,50 @@ function D(n) {
|
|
|
752
913
|
* @param options
|
|
753
914
|
* @returns
|
|
754
915
|
*/
|
|
755
|
-
use(e, i) {
|
|
756
|
-
return this.pluginManager.instUse(this, e, i);
|
|
916
|
+
use(e, ...i) {
|
|
917
|
+
return this.pluginManager.instUse(this, e, ...i);
|
|
918
|
+
},
|
|
919
|
+
/**
|
|
920
|
+
* 初始化实例
|
|
921
|
+
* @param args
|
|
922
|
+
*/
|
|
923
|
+
async init(...e) {
|
|
924
|
+
return super.init && await super.init(...e), this.pluginManager.onInit(this, ...e);
|
|
757
925
|
},
|
|
758
926
|
/**
|
|
759
927
|
* 销毁实例
|
|
760
928
|
* @returns
|
|
761
929
|
*/
|
|
762
|
-
destroy() {
|
|
763
|
-
|
|
930
|
+
async destroy() {
|
|
931
|
+
if (await this.pluginManager.onDestroy(this), super.destroy) return super.destroy();
|
|
764
932
|
}
|
|
765
933
|
}), n;
|
|
766
934
|
}
|
|
767
|
-
function
|
|
768
|
-
const t =
|
|
769
|
-
return new Proxy(
|
|
935
|
+
function ut(n) {
|
|
936
|
+
const t = S(n);
|
|
937
|
+
return new Proxy(t, {
|
|
770
938
|
construct: function(e, i, s) {
|
|
771
939
|
const o = new e(...i);
|
|
772
|
-
return t.pluginManager.
|
|
940
|
+
return t.pluginManager.onCreate(this, ...i), o;
|
|
773
941
|
}
|
|
774
942
|
});
|
|
775
943
|
}
|
|
776
|
-
function
|
|
944
|
+
function pt(n) {
|
|
777
945
|
return class extends n {
|
|
946
|
+
/**
|
|
947
|
+
* 是否使用独立的插件管理器
|
|
948
|
+
* @defaultValue false
|
|
949
|
+
*/
|
|
950
|
+
static isolatedPluginManager = !1;
|
|
778
951
|
/**
|
|
779
952
|
* 插件管理器
|
|
780
953
|
*/
|
|
781
954
|
static get pluginManager() {
|
|
782
|
-
|
|
783
|
-
return e || (e = this._pluginManager = new g(this)), e;
|
|
955
|
+
return this.isolatedPluginManager && !this.hasOwnProperty("_pluginManager") && (this._pluginManager = new l(this)), this._pluginManager;
|
|
784
956
|
}
|
|
785
|
-
static _pluginManager;
|
|
957
|
+
static _pluginManager = new l(this);
|
|
786
958
|
/**
|
|
787
|
-
* 插件管理器 {@link
|
|
959
|
+
* 插件管理器 {@link PluginHostExtends.pluginManager}
|
|
788
960
|
*/
|
|
789
961
|
get pluginManager() {
|
|
790
962
|
return this.constructor.pluginManager;
|
|
@@ -796,54 +968,95 @@ function rt(n) {
|
|
|
796
968
|
return this.pluginManager.use(e, ...i);
|
|
797
969
|
}
|
|
798
970
|
constructor(...e) {
|
|
799
|
-
super(...e), this.pluginManager.
|
|
971
|
+
super(...e), this.pluginManager.onCreate(this, ...e);
|
|
800
972
|
}
|
|
801
973
|
/**
|
|
802
974
|
* 实例的注册插件的方法
|
|
803
975
|
* @param plugin
|
|
804
|
-
* @param
|
|
976
|
+
* @param args
|
|
805
977
|
* @returns
|
|
806
978
|
*/
|
|
807
979
|
use(e, ...i) {
|
|
808
980
|
return this.pluginManager.instUse(this, e, ...i);
|
|
809
981
|
}
|
|
982
|
+
/**
|
|
983
|
+
* 初始化实例
|
|
984
|
+
* @remarks
|
|
985
|
+
* 会调用 {@link PluginManager.onInit}
|
|
986
|
+
* @param args
|
|
987
|
+
*/
|
|
988
|
+
async init(...e) {
|
|
989
|
+
return super.init && await super.init(...e), this.pluginManager.onInit(this, ...e);
|
|
990
|
+
}
|
|
810
991
|
/**
|
|
811
992
|
* 销毁实例
|
|
812
993
|
* @returns
|
|
813
994
|
*/
|
|
814
|
-
destroy() {
|
|
815
|
-
|
|
995
|
+
async destroy() {
|
|
996
|
+
if (await this.pluginManager.onDestroy(this), super.destroy) return super.destroy();
|
|
816
997
|
}
|
|
817
998
|
};
|
|
818
999
|
}
|
|
819
|
-
class
|
|
1000
|
+
class lt extends U {
|
|
1001
|
+
/**
|
|
1002
|
+
* 全局级别的默认选项
|
|
1003
|
+
*/
|
|
1004
|
+
static defaultOptions = new u();
|
|
1005
|
+
/**
|
|
1006
|
+
* 实例级的默认选项
|
|
1007
|
+
*/
|
|
1008
|
+
get defaultOptions() {
|
|
1009
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
|
|
1010
|
+
}
|
|
1011
|
+
_defaultOptions;
|
|
1012
|
+
constructor(t) {
|
|
1013
|
+
super(), this.defaultOptions.option = t;
|
|
1014
|
+
}
|
|
1015
|
+
}
|
|
1016
|
+
class dt extends N {
|
|
1017
|
+
/**
|
|
1018
|
+
* 全局级别的默认选项
|
|
1019
|
+
*/
|
|
1020
|
+
static defaultOptions = new u();
|
|
1021
|
+
/**
|
|
1022
|
+
* 实例级的默认选项
|
|
1023
|
+
*/
|
|
1024
|
+
get defaultOptions() {
|
|
1025
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
|
|
1026
|
+
}
|
|
1027
|
+
_defaultOptions;
|
|
1028
|
+
constructor(t) {
|
|
1029
|
+
super(), this.defaultOptions.option = t;
|
|
1030
|
+
}
|
|
1031
|
+
}
|
|
1032
|
+
class ct extends D {
|
|
820
1033
|
/**
|
|
821
1034
|
* 全局级别的默认选项
|
|
822
1035
|
*/
|
|
823
|
-
static defaultOptions = new
|
|
1036
|
+
static defaultOptions = new u();
|
|
824
1037
|
/**
|
|
825
1038
|
* 实例级的默认选项
|
|
826
1039
|
*/
|
|
827
1040
|
get defaultOptions() {
|
|
828
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
1041
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
|
|
829
1042
|
}
|
|
830
1043
|
_defaultOptions;
|
|
831
1044
|
constructor(t) {
|
|
832
1045
|
super(), this.defaultOptions.option = t;
|
|
833
1046
|
}
|
|
834
1047
|
}
|
|
835
|
-
function
|
|
836
|
-
const t =
|
|
1048
|
+
function ht(n) {
|
|
1049
|
+
const t = H(n);
|
|
837
1050
|
return class extends t {
|
|
838
1051
|
/**
|
|
839
1052
|
* 全局级别的默认选项
|
|
840
1053
|
*/
|
|
841
|
-
static defaultOptions = new
|
|
1054
|
+
static defaultOptions = new u();
|
|
842
1055
|
/**
|
|
843
1056
|
* 实例级的默认选项
|
|
844
1057
|
*/
|
|
845
1058
|
get defaultOptions() {
|
|
846
|
-
return this._defaultOptions || (this._defaultOptions = new
|
|
1059
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
|
|
847
1060
|
}
|
|
848
1061
|
_defaultOptions;
|
|
849
1062
|
constructor(i) {
|
|
@@ -851,33 +1064,67 @@ function at(n) {
|
|
|
851
1064
|
}
|
|
852
1065
|
};
|
|
853
1066
|
}
|
|
854
|
-
|
|
855
|
-
|
|
856
|
-
|
|
857
|
-
|
|
858
|
-
|
|
859
|
-
|
|
860
|
-
|
|
861
|
-
|
|
862
|
-
|
|
863
|
-
|
|
864
|
-
|
|
865
|
-
|
|
866
|
-
|
|
867
|
-
|
|
868
|
-
|
|
1067
|
+
const c = "common";
|
|
1068
|
+
class ft extends U {
|
|
1069
|
+
/**
|
|
1070
|
+
* 全局级别的默认选项
|
|
1071
|
+
*/
|
|
1072
|
+
static modeOptions = new a(c);
|
|
1073
|
+
/**
|
|
1074
|
+
* 实例级的默认选项
|
|
1075
|
+
*/
|
|
1076
|
+
get modeOptions() {
|
|
1077
|
+
return this._modeOptions || (this._modeOptions = new a(c, void 0, this.constructor.modeOptions));
|
|
1078
|
+
}
|
|
1079
|
+
_modeOptions;
|
|
1080
|
+
get mode() {
|
|
1081
|
+
return this.modeOptions.mode;
|
|
1082
|
+
}
|
|
1083
|
+
set mode(t) {
|
|
1084
|
+
this.modeOptions.mode = t;
|
|
1085
|
+
}
|
|
1086
|
+
get options() {
|
|
1087
|
+
return this.modeOptions.plainFullOption;
|
|
1088
|
+
}
|
|
1089
|
+
constructor(t) {
|
|
1090
|
+
super(), this.modeOptions.setOption(t);
|
|
1091
|
+
}
|
|
869
1092
|
}
|
|
870
|
-
|
|
871
|
-
|
|
1093
|
+
class Ot extends N {
|
|
1094
|
+
/**
|
|
1095
|
+
* 全局级别的默认选项
|
|
1096
|
+
*/
|
|
1097
|
+
static modeOptions = new a(c);
|
|
1098
|
+
/**
|
|
1099
|
+
* 实例级的默认选项
|
|
1100
|
+
*/
|
|
1101
|
+
get modeOptions() {
|
|
1102
|
+
return this._modeOptions || (this._modeOptions = new a(c, void 0, this.constructor.modeOptions));
|
|
1103
|
+
}
|
|
1104
|
+
_modeOptions;
|
|
1105
|
+
get mode() {
|
|
1106
|
+
return this.modeOptions.mode;
|
|
1107
|
+
}
|
|
1108
|
+
set mode(t) {
|
|
1109
|
+
this.modeOptions.mode = t;
|
|
1110
|
+
}
|
|
1111
|
+
get options() {
|
|
1112
|
+
return this.modeOptions.plainFullOption;
|
|
1113
|
+
}
|
|
1114
|
+
constructor(t) {
|
|
1115
|
+
super(), this.modeOptions.setOption(t);
|
|
1116
|
+
}
|
|
1117
|
+
}
|
|
1118
|
+
class mt extends D {
|
|
872
1119
|
/**
|
|
873
1120
|
* 全局级别的默认选项
|
|
874
1121
|
*/
|
|
875
|
-
static modeOptions = new c
|
|
1122
|
+
static modeOptions = new a(c);
|
|
876
1123
|
/**
|
|
877
1124
|
* 实例级的默认选项
|
|
878
1125
|
*/
|
|
879
1126
|
get modeOptions() {
|
|
880
|
-
return this._modeOptions || (this._modeOptions = new c
|
|
1127
|
+
return this._modeOptions || (this._modeOptions = new a(c, void 0, this.constructor.modeOptions));
|
|
881
1128
|
}
|
|
882
1129
|
_modeOptions;
|
|
883
1130
|
get mode() {
|
|
@@ -893,18 +1140,18 @@ class dt extends N {
|
|
|
893
1140
|
super(), this.modeOptions.setOption(t);
|
|
894
1141
|
}
|
|
895
1142
|
}
|
|
896
|
-
function
|
|
897
|
-
const t =
|
|
1143
|
+
function _t(n) {
|
|
1144
|
+
const t = H(n);
|
|
898
1145
|
return class extends t {
|
|
899
1146
|
/**
|
|
900
1147
|
* 全局级别的默认选项
|
|
901
1148
|
*/
|
|
902
|
-
static modeOptions = new c
|
|
1149
|
+
static modeOptions = new a(c);
|
|
903
1150
|
/**
|
|
904
1151
|
* 实例级的默认选项
|
|
905
1152
|
*/
|
|
906
1153
|
get modeOptions() {
|
|
907
|
-
return this._modeOptions || (this._modeOptions = new c
|
|
1154
|
+
return this._modeOptions || (this._modeOptions = new a(c, void 0, this.constructor.modeOptions));
|
|
908
1155
|
}
|
|
909
1156
|
_modeOptions;
|
|
910
1157
|
get mode() {
|
|
@@ -921,118 +1168,194 @@ function gt(n) {
|
|
|
921
1168
|
}
|
|
922
1169
|
};
|
|
923
1170
|
}
|
|
924
|
-
function
|
|
925
|
-
const i = a(n, {
|
|
926
|
-
/**
|
|
927
|
-
* 全局级别的默认选项
|
|
928
|
-
*/
|
|
929
|
-
modeOptions: new c(t, e)
|
|
930
|
-
});
|
|
931
|
-
return a(i.prototype, {
|
|
932
|
-
/**
|
|
933
|
-
* 实例级的默认选项
|
|
934
|
-
*/
|
|
935
|
-
get modeOptions() {
|
|
936
|
-
return this._modeOptions || (this._modeOptions = new c(t, void 0, this.constructor.modeOptions));
|
|
937
|
-
},
|
|
938
|
-
get mode() {
|
|
939
|
-
return this.modeOptions.mode;
|
|
940
|
-
},
|
|
941
|
-
set mode(s) {
|
|
942
|
-
this.modeOptions.mode = s;
|
|
943
|
-
},
|
|
944
|
-
get options() {
|
|
945
|
-
return this.modeOptions.fullOption;
|
|
946
|
-
}
|
|
947
|
-
}), n;
|
|
948
|
-
}
|
|
949
|
-
function P(n, t) {
|
|
1171
|
+
function w(n, t) {
|
|
950
1172
|
const e = [{ target: n, props: t }];
|
|
951
1173
|
let i;
|
|
952
1174
|
for (; i = e.shift(); ) {
|
|
953
1175
|
const { target: s, props: o } = i;
|
|
954
|
-
for (const [r,
|
|
955
|
-
if (
|
|
956
|
-
e.push({ target: s[r], props:
|
|
1176
|
+
for (const [r, p] of Object.entries(o)) {
|
|
1177
|
+
if (p != null && typeof p == "object" && (!p.constructor || p.constructor === Object)) {
|
|
1178
|
+
e.push({ target: s[r], props: p });
|
|
957
1179
|
continue;
|
|
958
1180
|
}
|
|
959
|
-
s[r] =
|
|
1181
|
+
s[r] = p;
|
|
960
1182
|
}
|
|
961
1183
|
}
|
|
962
1184
|
return n;
|
|
963
1185
|
}
|
|
964
|
-
function
|
|
1186
|
+
function W(n, t) {
|
|
965
1187
|
const e = {}, i = [{ target: n, props: t, targetProps: e }];
|
|
966
1188
|
let s;
|
|
967
1189
|
for (; s = i.shift(); ) {
|
|
968
|
-
const { target: o, props: r, targetProps:
|
|
969
|
-
for (const [f,
|
|
970
|
-
if (
|
|
971
|
-
i.push({ target: o[f], props:
|
|
1190
|
+
const { target: o, props: r, targetProps: p } = s;
|
|
1191
|
+
for (const [f, h] of Object.entries(r)) {
|
|
1192
|
+
if (h != null && typeof h == "object" && (!h.constructor || h.constructor === Object)) {
|
|
1193
|
+
i.push({ target: o[f], props: h, targetProps: p[f] = {} });
|
|
972
1194
|
continue;
|
|
973
1195
|
}
|
|
974
|
-
|
|
1196
|
+
p[f] = o[f];
|
|
975
1197
|
}
|
|
976
1198
|
}
|
|
977
1199
|
return e;
|
|
978
1200
|
}
|
|
979
|
-
function
|
|
980
|
-
const e =
|
|
1201
|
+
function yt(n, t) {
|
|
1202
|
+
const e = W(n, t);
|
|
981
1203
|
function i() {
|
|
982
|
-
|
|
1204
|
+
w(n, t);
|
|
983
1205
|
}
|
|
984
1206
|
function s() {
|
|
985
|
-
|
|
1207
|
+
w(n, e);
|
|
986
1208
|
}
|
|
987
1209
|
return { set: i, unset: s };
|
|
988
1210
|
}
|
|
1211
|
+
function xt(n, t, e) {
|
|
1212
|
+
const i = g(n, {
|
|
1213
|
+
/**
|
|
1214
|
+
* 全局级别的默认选项
|
|
1215
|
+
*/
|
|
1216
|
+
modeOptions: new a(t, e)
|
|
1217
|
+
});
|
|
1218
|
+
return g(i.prototype, {
|
|
1219
|
+
/**
|
|
1220
|
+
* 实例级的默认选项
|
|
1221
|
+
*/
|
|
1222
|
+
get modeOptions() {
|
|
1223
|
+
return this._modeOptions || (this._modeOptions = new a(t, void 0, this.constructor.modeOptions));
|
|
1224
|
+
},
|
|
1225
|
+
get mode() {
|
|
1226
|
+
return this.modeOptions.mode;
|
|
1227
|
+
},
|
|
1228
|
+
set mode(s) {
|
|
1229
|
+
this.modeOptions.mode = s;
|
|
1230
|
+
},
|
|
1231
|
+
get options() {
|
|
1232
|
+
return this.modeOptions.fullOption;
|
|
1233
|
+
}
|
|
1234
|
+
}), n;
|
|
1235
|
+
}
|
|
1236
|
+
const wt = {
|
|
1237
|
+
onUse(n, t, e) {
|
|
1238
|
+
const i = t ?? c;
|
|
1239
|
+
d(n, {
|
|
1240
|
+
modeOptions: new a(
|
|
1241
|
+
i,
|
|
1242
|
+
void 0,
|
|
1243
|
+
e
|
|
1244
|
+
)
|
|
1245
|
+
}), d(n.prototype, {
|
|
1246
|
+
get modeOptions() {
|
|
1247
|
+
const s = this, o = n;
|
|
1248
|
+
return s._modeOptions || (s._modeOptions = new a(
|
|
1249
|
+
o.modeOptions.mode,
|
|
1250
|
+
void 0,
|
|
1251
|
+
o.modeOptions
|
|
1252
|
+
));
|
|
1253
|
+
},
|
|
1254
|
+
get mode() {
|
|
1255
|
+
return this.modeOptions.mode;
|
|
1256
|
+
},
|
|
1257
|
+
set mode(s) {
|
|
1258
|
+
const o = this;
|
|
1259
|
+
o.modeOptions.mode = s;
|
|
1260
|
+
},
|
|
1261
|
+
get options() {
|
|
1262
|
+
return this.modeOptions.plainFullOption;
|
|
1263
|
+
}
|
|
1264
|
+
});
|
|
1265
|
+
},
|
|
1266
|
+
onCreate(n, t) {
|
|
1267
|
+
n.modeOptions.setOption(t);
|
|
1268
|
+
}
|
|
1269
|
+
}, Pt = {
|
|
1270
|
+
onUse(n, t, e) {
|
|
1271
|
+
d(n, {
|
|
1272
|
+
/**
|
|
1273
|
+
* 全局级别的默认选项
|
|
1274
|
+
*/
|
|
1275
|
+
defaultOptions: new u(t, e)
|
|
1276
|
+
}), d(n.prototype, {
|
|
1277
|
+
/**
|
|
1278
|
+
* 实例级的默认选项
|
|
1279
|
+
*/
|
|
1280
|
+
get defaultOptions() {
|
|
1281
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, n.defaultOptions));
|
|
1282
|
+
}
|
|
1283
|
+
});
|
|
1284
|
+
},
|
|
1285
|
+
onCreate(n, t) {
|
|
1286
|
+
n.defaultOptions.option = t;
|
|
1287
|
+
}
|
|
1288
|
+
};
|
|
1289
|
+
function Tt(n, t) {
|
|
1290
|
+
const e = g(n, {
|
|
1291
|
+
/**
|
|
1292
|
+
* 全局级别的默认选项
|
|
1293
|
+
*/
|
|
1294
|
+
defaultOptions: new u(t)
|
|
1295
|
+
});
|
|
1296
|
+
return g(e.prototype, {
|
|
1297
|
+
/**
|
|
1298
|
+
* 实例级的默认选项
|
|
1299
|
+
*/
|
|
1300
|
+
get defaultOptions() {
|
|
1301
|
+
return this._defaultOptions || (this._defaultOptions = new u(void 0, this.constructor.defaultOptions));
|
|
1302
|
+
}
|
|
1303
|
+
}), n;
|
|
1304
|
+
}
|
|
989
1305
|
export {
|
|
990
|
-
|
|
991
|
-
|
|
992
|
-
|
|
993
|
-
|
|
994
|
-
|
|
995
|
-
|
|
996
|
-
|
|
997
|
-
|
|
998
|
-
|
|
999
|
-
|
|
1000
|
-
|
|
1001
|
-
|
|
1002
|
-
|
|
1003
|
-
|
|
1004
|
-
|
|
1005
|
-
|
|
1006
|
-
|
|
1007
|
-
|
|
1008
|
-
|
|
1009
|
-
|
|
1306
|
+
j as ModeOptions,
|
|
1307
|
+
U as PluginHost,
|
|
1308
|
+
N as PluginHostEventEmitter,
|
|
1309
|
+
D as PluginHostEventTarget,
|
|
1310
|
+
l as PluginManager,
|
|
1311
|
+
a as TierModeOptions,
|
|
1312
|
+
ft as TierModeOptionsPluginHost,
|
|
1313
|
+
Ot as TierModeOptionsPluginHostEventEmitter,
|
|
1314
|
+
mt as TierModeOptionsPluginHostEventTarget,
|
|
1315
|
+
u as TierOptions,
|
|
1316
|
+
lt as TierOptionsPluginHost,
|
|
1317
|
+
dt as TierOptionsPluginHostEventEmitter,
|
|
1318
|
+
ct as TierOptionsPluginHostEventTarget,
|
|
1319
|
+
tt as addDefaultOptions,
|
|
1320
|
+
et as addInstOptions,
|
|
1321
|
+
M as allFunctionApply,
|
|
1322
|
+
S as becomePluginHost,
|
|
1323
|
+
pt as becomePluginHost_Extends,
|
|
1324
|
+
ut as becomePluginHost_Proxy,
|
|
1325
|
+
xt as becomeTierModeOptionsHost,
|
|
1326
|
+
Tt as becomeTierOptionsHost,
|
|
1327
|
+
c as commonModeName,
|
|
1328
|
+
Q as createCallerOfPrivateMemberOfExtend,
|
|
1329
|
+
$ as createDefineMixin,
|
|
1330
|
+
J as createExtendTarget,
|
|
1010
1331
|
L as createExtendTargetWithInit,
|
|
1011
|
-
|
|
1012
|
-
|
|
1013
|
-
|
|
1014
|
-
|
|
1015
|
-
|
|
1016
|
-
|
|
1017
|
-
|
|
1018
|
-
|
|
1019
|
-
|
|
1020
|
-
|
|
1021
|
-
|
|
1022
|
-
|
|
1023
|
-
|
|
1024
|
-
|
|
1025
|
-
|
|
1026
|
-
|
|
1027
|
-
|
|
1028
|
-
|
|
1029
|
-
|
|
1030
|
-
|
|
1031
|
-
|
|
1032
|
-
|
|
1332
|
+
K as createMixinTarget,
|
|
1333
|
+
H as createPluginHost,
|
|
1334
|
+
yt as createPropertySetter,
|
|
1335
|
+
G as createTargetExtend,
|
|
1336
|
+
Y as createTargetExtendWithInit,
|
|
1337
|
+
B as createTargetMixin,
|
|
1338
|
+
_t as createTierModeOptionsPluginHost,
|
|
1339
|
+
ht as createTierOptionsPluginHost,
|
|
1340
|
+
R as defineExtend,
|
|
1341
|
+
X as defineExtendWithInit,
|
|
1342
|
+
z as defineMixin,
|
|
1343
|
+
b as extendTarget,
|
|
1344
|
+
Z as extendTargetWithInit,
|
|
1345
|
+
y as getPropertyValue,
|
|
1346
|
+
nt as getPropertyValueByPath,
|
|
1347
|
+
W as getTargetProperties,
|
|
1348
|
+
w as mergeProperties,
|
|
1349
|
+
d as mixin,
|
|
1350
|
+
g as mixinTarget,
|
|
1351
|
+
v as parsePropertyPath,
|
|
1352
|
+
F as setPropertyValue,
|
|
1353
|
+
it as setPropertyValueByPath,
|
|
1033
1354
|
O as targetExtend,
|
|
1034
|
-
|
|
1035
|
-
|
|
1036
|
-
|
|
1037
|
-
|
|
1355
|
+
x as targetExtendWithInit,
|
|
1356
|
+
q as targetMixin,
|
|
1357
|
+
ot as tierModeOptionsDecorator,
|
|
1358
|
+
wt as tierModeOptionsPlugin,
|
|
1359
|
+
st as tierOptionsDecorator,
|
|
1360
|
+
Pt as tierOptionsPlugin
|
|
1038
1361
|
};
|