plugin-tls 1.0.0 → 1.1.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 +222 -0
- package/dist/extend/extend.d.ts.map +1 -0
- package/dist/extend/mixin.d.ts +105 -0
- package/dist/extend/mixin.d.ts.map +1 -0
- package/dist/index.d.ts +29 -251
- package/dist/index.d.ts.map +1 -0
- package/dist/options-manager/ModeOptions.d.ts +88 -0
- package/dist/options-manager/ModeOptions.d.ts.map +1 -0
- package/dist/options-manager/OptionsManager.d.ts +105 -0
- package/dist/options-manager/OptionsManager.d.ts.map +1 -0
- package/dist/options-manager/TierModeOptions.d.ts +69 -0
- package/dist/options-manager/TierModeOptions.d.ts.map +1 -0
- package/dist/options-manager/TierOptions.d.ts +48 -0
- package/dist/options-manager/TierOptions.d.ts.map +1 -0
- package/dist/options-manager/defaultOptions.d.ts +34 -0
- package/dist/options-manager/defaultOptions.d.ts.map +1 -0
- package/dist/options-manager/tools.d.ts +35 -0
- package/dist/options-manager/tools.d.ts.map +1 -0
- package/dist/plugin-host/PluginHost.d.ts +184 -0
- package/dist/plugin-host/PluginHost.d.ts.map +1 -0
- package/dist/plugin-host/TierModeOptionsPluginHost.d.ts +102 -0
- package/dist/plugin-host/TierModeOptionsPluginHost.d.ts.map +1 -0
- package/dist/plugin-host/TierOptionsPluginHost.d.ts +83 -0
- package/dist/plugin-host/TierOptionsPluginHost.d.ts.map +1 -0
- package/dist/plugin-manager/PluginManager.d.ts +119 -0
- package/dist/plugin-manager/PluginManager.d.ts.map +1 -0
- package/dist/plugin-manager/PluginManagerWithInit.d.ts +36 -0
- package/dist/plugin-manager/PluginManagerWithInit.d.ts.map +1 -0
- package/dist/plugin-tls.d.ts +1216 -160
- package/dist/plugin-tls.iife.js +1 -0
- package/dist/plugin-tls.mjs +1011 -102
- package/dist/plugin-tls.umd.js +1 -1
- package/dist/properties.d.ts +30 -0
- package/dist/properties.d.ts.map +1 -0
- package/dist/tsdoc-metadata.json +1 -1
- package/doc/api/index.md +1 -1
- package/doc/api/plugin-tls.adddefaultoptions.md +3 -3
- package/doc/api/plugin-tls.addinstoptions.md +2 -2
- package/doc/api/plugin-tls.allfunctionapply.md +26 -0
- package/doc/api/plugin-tls.becomepluginhost.md +15 -0
- package/doc/api/plugin-tls.becomepluginhost_extends.md +38 -0
- package/doc/api/plugin-tls.becomepluginhost_proxy.md +29 -0
- package/doc/api/plugin-tls.becometiermodeoptionshost.md +15 -0
- package/doc/api/plugin-tls.becometieroptionshost.md +15 -0
- package/doc/api/plugin-tls.classextender.md +15 -0
- package/doc/api/plugin-tls.classextenderprivatemember._constructors.md +13 -0
- package/doc/api/plugin-tls.classextenderprivatemember._destroys.md +13 -0
- package/doc/api/plugin-tls.classextenderprivatemember.md +21 -0
- package/doc/api/plugin-tls.classextenderprivatememberwithinit._inits.md +13 -0
- package/doc/api/plugin-tls.classextenderprivatememberwithinit.md +21 -0
- package/doc/api/plugin-tls.classextenderwithinit.md +15 -0
- package/doc/api/plugin-tls.classtype._new_.md +22 -0
- package/doc/api/plugin-tls.classtype.md +20 -0
- package/doc/api/plugin-tls.commonmodename.md +18 -0
- package/doc/api/plugin-tls.createcallerofprivatememberofextend.md +30 -0
- package/doc/api/plugin-tls.createdefinemixin.md +23 -0
- package/doc/api/plugin-tls.createextendtarget.md +30 -0
- package/doc/api/plugin-tls.createextendtargetwithinit.md +30 -0
- package/doc/api/plugin-tls.createmixintarget.md +30 -0
- package/doc/api/plugin-tls.createpluginhost.md +16 -11
- package/doc/api/plugin-tls.createpropertysetter.md +30 -0
- package/doc/api/plugin-tls.createtargetextend.md +30 -0
- package/doc/api/plugin-tls.createtargetextendwithinit.md +30 -0
- package/doc/api/plugin-tls.createtargetmixin.md +30 -0
- package/doc/api/plugin-tls.createtiermodeoptionspluginhost.md +32 -0
- package/doc/api/plugin-tls.createtieroptionspluginhost.md +30 -0
- package/doc/api/plugin-tls.defineextend.md +35 -0
- package/doc/api/plugin-tls.defineextendwithinit.md +35 -0
- package/doc/api/plugin-tls.definemixin.md +31 -0
- package/doc/api/plugin-tls.extendtarget.md +31 -0
- package/doc/api/plugin-tls.extendtargetwithinit.md +31 -0
- package/doc/api/plugin-tls.formatuseparameters.md +13 -0
- package/doc/api/plugin-tls.formatusepluginparameters.md +15 -0
- package/doc/api/plugin-tls.getnormalizepluginoptions.md +15 -0
- package/doc/api/plugin-tls.getpluginoptions.md +15 -0
- package/doc/api/plugin-tls.getpropertyvalue.md +26 -0
- package/doc/api/plugin-tls.getpropertyvaluebypath.md +26 -0
- package/doc/api/plugin-tls.gettargetproperties.md +26 -0
- package/doc/api/plugin-tls.hostinst.md +2 -2
- package/doc/api/plugin-tls.idefaultoptionshost.defaultoptions.md +1 -1
- package/doc/api/plugin-tls.idefaultoptionshost.md +1 -1
- package/doc/api/plugin-tls.iidefaultoptionshostconstructor.md +1 -1
- package/doc/api/plugin-tls.iplugin.created.md +4 -4
- package/doc/api/plugin-tls.iplugin.destroyed.md +25 -0
- package/doc/api/plugin-tls.iplugin.md +4 -3
- package/doc/api/plugin-tls.iplugin.used.md +4 -4
- package/doc/api/plugin-tls.ipluginhost.md +2 -2
- package/doc/api/plugin-tls.ipluginhost.use.md +6 -6
- package/doc/api/plugin-tls.ipluginhostconstructor.md +2 -2
- package/doc/api/plugin-tls.ipluginhostconstructor.use.md +6 -6
- package/doc/api/plugin-tls.ipluginwithinit.inited.md +25 -0
- package/doc/api/plugin-tls.ipluginwithinit.md +21 -0
- package/doc/api/plugin-tls.itiermodeoptionshost.md +21 -0
- package/doc/api/plugin-tls.itiermodeoptionshost.mode.md +11 -0
- package/doc/api/plugin-tls.itiermodeoptionshost.modeoptions.md +11 -0
- package/doc/api/plugin-tls.itiermodeoptionshostconstructor.md +13 -0
- package/doc/api/plugin-tls.itiermodeoptionspluginhost.md +15 -0
- package/doc/api/plugin-tls.itiermodeoptionspluginhostconstructor.md +15 -0
- package/doc/api/plugin-tls.itieroptionshost.defaultoptions.md +11 -0
- package/doc/api/plugin-tls.itieroptionshost.md +20 -0
- package/doc/api/plugin-tls.itieroptionshostconstructor.md +13 -0
- package/doc/api/plugin-tls.itieroptionspluginhost.md +15 -0
- package/doc/api/plugin-tls.itieroptionspluginhostconstructor.md +15 -0
- package/doc/api/plugin-tls.md +82 -6
- package/doc/api/plugin-tls.mergeproperties.md +25 -0
- package/doc/api/plugin-tls.mixin_4.md +33 -0
- package/doc/api/plugin-tls.mixintarget.md +31 -0
- package/doc/api/plugin-tls.modeoptions._constructor_.md +20 -0
- package/doc/api/plugin-tls.modeoptions._constructor__1.md +21 -0
- package/doc/api/plugin-tls.modeoptions._mode.md +11 -0
- package/doc/api/plugin-tls.modeoptions._modenames.md +11 -0
- package/doc/api/plugin-tls.modeoptions._plainfulloption.md +11 -0
- package/doc/api/plugin-tls.modeoptions.getfullmodeoption.md +29 -0
- package/doc/api/plugin-tls.modeoptions.getmodenames.md +18 -0
- package/doc/api/plugin-tls.modeoptions.getmodeoption.md +29 -0
- package/doc/api/plugin-tls.modeoptions.hasmode.md +25 -0
- package/doc/api/plugin-tls.modeoptions.md +57 -0
- package/doc/api/plugin-tls.modeoptions.mode.md +15 -0
- package/doc/api/plugin-tls.modeoptions.modenames.md +13 -0
- package/doc/api/plugin-tls.modeoptions.modes.md +13 -0
- package/doc/api/plugin-tls.modeoptions.option.md +13 -0
- package/doc/api/plugin-tls.modeoptions.optionmanager.md +13 -0
- package/doc/api/plugin-tls.modeoptions.plainfulloption.md +11 -0
- package/doc/api/plugin-tls.modeoptions.setmodeoption.md +27 -0
- package/doc/api/plugin-tls.modeoptions.updatefulloption.md +17 -0
- package/doc/api/plugin-tls.normalizepluginoptions.md +18 -0
- package/doc/api/plugin-tls.parsepropertypath.md +25 -0
- package/doc/api/plugin-tls.plugincreatedreturntype.md +3 -3
- package/doc/api/plugin-tls.pluginhost._pluginmanager.md +2 -2
- package/doc/api/plugin-tls.pluginhost.destroy.md +18 -0
- package/doc/api/plugin-tls.pluginhost.md +24 -11
- package/doc/api/plugin-tls.pluginhost.pluginmanager.md +2 -2
- package/doc/api/plugin-tls.pluginhost.use.md +5 -5
- package/doc/api/plugin-tls.pluginmanager._constructor_.md +20 -0
- package/doc/api/plugin-tls.pluginmanager.created.md +4 -4
- package/doc/api/plugin-tls.pluginmanager.destroyed.md +28 -0
- package/doc/api/plugin-tls.pluginmanager.host.md +2 -2
- package/doc/api/plugin-tls.pluginmanager.instuse.md +8 -8
- package/doc/api/plugin-tls.pluginmanager.md +12 -5
- package/doc/api/plugin-tls.pluginmanager.pluginoptsmap.md +2 -2
- package/doc/api/plugin-tls.pluginmanager.plugins.md +2 -2
- package/doc/api/plugin-tls.pluginmanager.use.md +6 -6
- package/doc/api/plugin-tls.pluginmanagerwithinit.inited.md +28 -0
- package/doc/api/plugin-tls.pluginmanagerwithinit.md +25 -0
- package/doc/api/plugin-tls.pluginusereturntype.md +3 -3
- package/doc/api/plugin-tls.privatememberofextend._constructor.md +32 -0
- package/doc/api/plugin-tls.privatememberofextend._destroy.md +25 -0
- package/doc/api/plugin-tls.privatememberofextend.md +21 -0
- package/doc/api/plugin-tls.privatememberofextendwithinit._init.md +28 -0
- package/doc/api/plugin-tls.privatememberofextendwithinit.md +21 -0
- package/doc/api/plugin-tls.replaceconstructorparameters.md +13 -0
- package/doc/api/plugin-tls.replaceconstructorreturn.md +13 -0
- package/doc/api/plugin-tls.setpropertyvalue.md +27 -0
- package/doc/api/plugin-tls.setpropertyvaluebypath.md +27 -0
- package/doc/api/plugin-tls.targetextend.md +31 -0
- package/doc/api/plugin-tls.targetextendwithinit.md +31 -0
- package/doc/api/plugin-tls.targetmixin.md +31 -0
- package/doc/api/plugin-tls.tiermodeoptions._constructor_.md +20 -0
- package/doc/api/plugin-tls.tiermodeoptions._constructor__1.md +22 -0
- package/doc/api/plugin-tls.tiermodeoptions._extends.md +11 -0
- package/doc/api/plugin-tls.tiermodeoptions.extends.md +15 -0
- package/doc/api/plugin-tls.tiermodeoptions.getfullmodeoption.md +29 -0
- package/doc/api/plugin-tls.tiermodeoptions.getmember.md +25 -0
- package/doc/api/plugin-tls.tiermodeoptions.getmodenames.md +18 -0
- package/doc/api/plugin-tls.tiermodeoptions.getmodeoptionmanager.md +25 -0
- package/doc/api/plugin-tls.tiermodeoptions.getvalue.md +25 -0
- package/doc/api/plugin-tls.tiermodeoptions.hasmodeontier.md +25 -0
- package/doc/api/plugin-tls.tiermodeoptions.md +45 -0
- package/doc/api/plugin-tls.tiermodeoptions.optionmanager.md +13 -0
- package/doc/api/plugin-tls.tiermodeoptionsdecorator.md +30 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost._constructor_.md +20 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost._modeoptions.md +11 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost.md +37 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost.mode.md +13 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost.modeoptions.md +13 -0
- package/doc/api/plugin-tls.tiermodeoptionspluginhost.options.md +11 -0
- package/doc/api/plugin-tls.tieroptions._constructor_.md +21 -0
- package/doc/api/plugin-tls.tieroptions._extends.md +11 -0
- package/doc/api/plugin-tls.tieroptions._plainfulloption.md +11 -0
- package/doc/api/plugin-tls.tieroptions.extends.md +15 -0
- package/doc/api/plugin-tls.tieroptions.getmember.md +25 -0
- package/doc/api/plugin-tls.tieroptions.getvalue.md +25 -0
- package/doc/api/plugin-tls.tieroptions.md +37 -0
- package/doc/api/plugin-tls.tieroptions.option.md +13 -0
- package/doc/api/plugin-tls.tieroptions.plainfulloption.md +18 -0
- package/doc/api/plugin-tls.tieroptions.updatefulloption.md +17 -0
- package/doc/api/plugin-tls.tieroptionsdecorator.md +30 -0
- package/doc/api/plugin-tls.tieroptionspluginhost._constructor_.md +20 -0
- package/doc/api/plugin-tls.tieroptionspluginhost._defaultoptions.md +11 -0
- package/doc/api/plugin-tls.tieroptionspluginhost.defaultoptions.md +13 -0
- package/doc/api/plugin-tls.tieroptionspluginhost.md +35 -0
- package/package.json +23 -15
- package/doc/api/plugin-tls.createoptionspluginhost.md +0 -29
- package/doc/api/plugin-tls.ioptionspluginhost.defaultoptions.md +0 -11
- package/doc/api/plugin-tls.ioptionspluginhost.md +0 -21
- package/doc/api/plugin-tls.ioptionspluginhostconstructor.md +0 -15
- package/doc/api/plugin-tls.optionspluginhost._defaultoptions.md +0 -11
- package/doc/api/plugin-tls.optionspluginhost.defaultoptions.md +0 -13
- package/doc/api/plugin-tls.optionspluginhost.md +0 -21
- package/doc/api/plugin-tls.pluginhost._constructor_.md +0 -13
- package/doc/api/plugin-tls.pluginoptions.md +0 -11
package/dist/plugin-tls.umd.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
(function(s,i){typeof exports=="object"&&typeof module<"u"?i(exports,require("type-tls"),require("@gby/deep-copy")):typeof define=="function"&&define.amd?define(["exports","type-tls","@gby/deep-copy"],i):(s=typeof globalThis<"u"?globalThis:s||self,i(s.PluginTls={},s.typeTls,s.deepCopy))})(this,function(s,i,a){"use strict";var P=Object.defineProperty;var H=(s,i,a)=>i in s?P(s,i,{enumerable:!0,configurable:!0,writable:!0,value:a}):s[i]=a;var r=(s,i,a)=>(H(s,typeof i!="symbol"?i+"":i,a),a);class o{constructor(){r(this,"host");r(this,"pluginOptsMap",new Map);r(this,"plugins",[])}use(n,t){const e=this.pluginOptsMap;if(!e.has(n))return this.plugins.push(n),e.set(n,t),n.used(this.host,t)}created(n){var t;for(const e of this.plugins){const p=this.pluginOptsMap.get(e);(t=e.created)==null||t.call(e,n,p)}}instUse(n,t,e){var g;if(!this.pluginOptsMap.has(t))return this.use(t,e),(g=t.created)==null?void 0:g.call(t,n,e)}}class l{static get pluginManager(){let n=this._pluginManager;return n||(n=new o,n.host=this,this._pluginManager=n),n}get pluginManager(){return this.constructor.pluginManager}static use(n,t){return this.pluginManager.use(n,t)}constructor(){this.pluginManager.created(this)}use(n,t){return this.constructor.pluginManager.instUse(this,n,t)}}r(l,"_pluginManager");function c(){var u;return u=class{static get pluginManager(){let t=this._pluginManager;return t||(t=new o,t.host=this,this._pluginManager=t),t}get pluginManager(){return this.constructor.pluginManager}static use(t,e){return this.pluginManager.use(t,e)}constructor(){this.pluginManager.created(this)}use(t,e){return this.pluginManager.instUse(this,t,e)}},r(u,"_pluginManager"),u}function f(u){const n=i.mixinTarget(u,{get pluginManager(){let t=this._pluginManager;return t||(t=new o,t.host=this,this._pluginManager=t),t},use(t,e){return this.pluginManager.use(t,e)}});return i.mixinTarget(n.prototype,{get pluginManager(){return this.constructor.pluginManager},use(t,e){return this.pluginManager.instUse(this,t,e)}}),new Proxy(u,{construct:function(t,e,p){const g=new t(...e);return n.pluginManager.created(this),g}})}class h extends l{constructor(){super(...arguments);r(this,"_defaultOptions")}get defaultOptions(){return this._defaultOptions||(this._defaultOptions=a.deepCopy(this.constructor.defaultOptions))}}r(h,"defaultOptions",{});function M(){var n;const u=c();return n=class extends u{constructor(){super(...arguments);r(this,"_defaultOptions")}get defaultOptions(){return this._defaultOptions||(this._defaultOptions=a.deepCopy(this.constructor.defaultOptions))}},r(n,"defaultOptions",{}),n}function O(u,n){const t=n!=null?n:"defaultOptions",e=`_${t}`;return function(g){const d=i.mixinTarget(g,{get[t](){return u}});i.extendTarget(d,{get[t](){return this[e]||(this[e]=structuredClone(d.defaultOptions))}})}}function _(u,n,t){const e=`_${n}`;return i.extendTarget(u,{get[n](){return this[e]||(this[e]=structuredClone(u[n]))}}),t}s.OptionsPluginHost=h,s.PluginHost=l,s.PluginManager=o,s.addDefaultOptions=O,s.addInstOptions=_,s.createOptionsPluginHost=M,s.createPluginHost=c,s.pluginHost=f,Object.defineProperties(s,{__esModule:{value:!0},[Symbol.toStringTag]:{value:"Module"}})});
|
|
1
|
+
(function(o,d){typeof exports=="object"&&typeof module<"u"?d(exports,require("deepmerge-ts")):typeof define=="function"&&define.amd?define(["exports","deepmerge-ts"],d):(o=typeof globalThis<"u"?globalThis:o||self,d(o.PluginTls={},o.deepmergeTs))})(this,function(o,d){"use strict";var dt=Object.defineProperty;var ct=(o,d,l)=>d in o?dt(o,d,{enumerable:!0,configurable:!0,writable:!0,value:l}):o[d]=l;var u=(o,d,l)=>(ct(o,typeof d!="symbol"?d+"":d,l),l);function l(n,...e){for(const t of e){const i=Object.getOwnPropertyDescriptors(t);Object.defineProperties(n,i)}return n}function j(n,e){return e}function A(){return function(e,t){return t}}function S(n,e){return l(n,e),e}function k(n){return function(t){return l(n,t),t}}function g(n,e){return l(n,e),n}function z(n){return function(t){return l(n,t),n}}function B(n,e){return e}function M(n,e){l(n.prototype,e);const t=e._constructor;typeof t=="function"&&(n._constructors??(n._constructors=[])).push(t);const i=e._destroy;return typeof i=="function"&&(n._destroys??(n._destroys=[])).push(i),e}function C(n){return function(t){return M(n,t),t}}function w(n,e){return M(n,e),n}function $(n){return function(t){return M(n,t),n}}function P(n,e,t){for(const i of n)i.apply(e,t)}function q(n){return{constructed:function(e,t){P(n._constructors??[],e,t)},initialized:function(e,t){P(n._inits??[],e,t)},destroyed:function(e,t){P(n._destroys??[],e,t)}}}function K(n,e){return e}function y(n,e){M(n,e);const t=e._init;return typeof t=="function"&&(n._inits??(n._inits=[])).push(t),e}function R(n){return function(t){return y(n,t),t}}function G(n,e){return y(n,e),n}function J(n){return function(t){return y(n,t),n}}class O{constructor(e){u(this,"host");u(this,"pluginOptsMap",new Map);u(this,"plugins",[]);e&&(this.host=e)}use(e,...t){const{pluginOptsMap:i,plugins:r,host:s}=this;if(!r.includes(e))return r.push(e),i.set(e,t[0]),e.used(s,t[0])}created(e){var r;const{plugins:t,pluginOptsMap:i}=this;for(const s of t){const a=i.get(s);(r=s.created)==null||r.call(s,e,a)}}destroyed(e){var r;const{plugins:t,pluginOptsMap:i}=this;for(const s of t){const a=i.get(s);(r=s.destroyed)==null||r.call(s,e,a)}}instUse(e,t,...i){var s;if(!this.pluginOptsMap.has(t))return this.use(t,...i),(s=t.created)==null?void 0:s.call(t,e,...i)}}class L extends O{inited(e){var r;const{plugins:t,pluginOptsMap:i}=this;for(const s of t){const a=i.get(s);(r=s.inited)==null||r.call(s,e,a)}}}function Q(n,e){const t=e??"defaultOptions",i=`_${t}`;return function(s){const a=g(s,{get[t](){return n}});w(a,{get[t](){return this[i]||(this[i]=structuredClone(a.defaultOptions))}})}}function X(n,e,t){const i=`_${e}`;return w(n,{get[e](){return this[i]||(this[i]=structuredClone(n[e]))}}),t}function b(n){const e=n.split(".");return e[0]===""&&e.shift(),e}function T(n,e){for(const t of e)if(n=n[t],n==null)return;return n}function Y(n,e){return T(n,b(e))}function F(n,e,t){const i=e.pop(),r=e.length;let s=0;for(;s<r;){const a=n[e[s]];if(a==null)break;n=a,s++}e=e.slice(s);for(const a of e)n=n[a]={};return n[i]=t,n}function Z(n,e,t){return F(n,b(e),t)}const v={UndefinedAndNull:function(e){return e==null},Undefined:function(e){return e===void 0},Null:function(e){return e===null}};class V{constructor(){u(this,"freezeMember",!0);u(this,"fullOption",new Proxy(this,{get:function(e,t,i){const r=e.plainFullOption[t];return e.freezeMember?Object.freeze(r):r},set:function(e,t,i,r){return e.setMember(t,i,!1),!0},has:function(e,t){return t in e.plainFullOption},getOwnPropertyDescriptor:function(e,t){return Object.getOwnPropertyDescriptor(e.plainFullOption,t)},ownKeys:function(e){return Reflect.ownKeys(e.plainFullOption)},deleteProperty:function(e,t){return e.setMember(t,void 0),!0},defineProperty:function(e,t,i){return Object.defineProperty(e.option,t,i),!0}}));u(this,"_undefinedValue","UndefinedAndNull");u(this,"isUndefined",v.UndefinedAndNull)}setOption(e,t){const i=t?d.deepmergeInto(this.option,e):Object.assign(this.option,e);return this.updateFullOption(),i}get undefinedValue(){return this._undefinedValue}set undefinedValue(e){this._undefinedValue=e,this.isUndefined=v[e]||v.UndefinedAndNull}getMember(e){return this.option[e]}setMember(e,t,i){const r=this.option;if(t===void 0)delete r[e];else{const s=r[e];i&&s&&typeof s=="object"?d.deepmergeInto(s,t):r[e]=t}this.updateFullOption()}getValue(e){return T(this.option,e)}setValue(e,t,i){const r=this.option;let s;i&&(s=T(r,e))&&typeof s=="object"?d.deepmergeInto(s,t):F(this.option,e,t),this.updateFullOption()}}class p extends V{constructor(t,i){super();u(this,"_extends",null);u(this,"option",{});u(this,"_plainFullOption",null);t&&(this.option=t),i&&(this.extends=i)}get extends(){return this._extends}set extends(t){this._extends=t,this.updateFullOption()}get plainFullOption(){let t=this._plainFullOption;if(t)return t;const{extends:i,option:r}=this;if(t=r,i){const s=i.plainFullOption;t=d.deepmerge(s,r)}return this._plainFullOption=t}updateFullOption(){this._plainFullOption=null}getMember(t){const i=this.option[t];if(!this.isUndefined(i))return i;const r=this.extends;if(r)return r.getMember(t)}getValue(t){const i=super.getValue(t);if(!this.isUndefined(i))return i;const r=this.extends;if(r)return r.getValue(t)}}function tt(n,e){const{name:t}=e,i=`_${t}`;return{get:function(){return this[i]||(this[i]=new p(void 0,this.constructor[t]))}}}class E extends V{constructor(t,i){super();u(this,"modes",{});u(this,"_mode");u(this,"_modeNames",null);u(this,"_plainFullOption",null);i&&this.setModeOption(t,i),this.mode=t}get mode(){return this._mode||(this.mode=this.modeNames[0])}set mode(t){this._mode=t,this.hasMode(t)||this.setModeOption(t,{}),this.updateFullOption()}get modeNames(){return this._modeNames||(this._modeNames=this.getModeNames())}getModeNames(){return Object.keys(this.modes)}hasMode(t){return!!this.modes[t]}get optionManager(){return this.modes[this.mode]}get option(){return this.optionManager.option}get plainFullOption(){return this._plainFullOption??(this._plainFullOption=this.getFullModeOption(this.mode))}updateFullOption(){this._plainFullOption=null,this._modeNames=null}getModeOption(t){return this.modes[t].option}getFullModeOption(t){var i;return(i=this.modes[t])==null?void 0:i.plainFullOption}setModeOption(t,i,r,s){const{modes:a}=this,c=a[t]||(a[t]=new p);if(c.setOption(i,r),s){const h=a[s];h&&(c.extends=h)}return this.updateFullOption(),c}}class f extends E{constructor(t,i,r){super(t,i);u(this,"_extends",null);r&&(this.extends=r)}get extends(){return this._extends}set extends(t){this._extends=t,this.updateFullOption()}getFullModeOption(t){var a;const{modes:i,extends:r}=this,s=(a=i[t])==null?void 0:a.plainFullOption;if(r){const c=r.getFullModeOption(t);return s?d.deepmerge(c,s):c}return s}getModeNames(){const{modes:t,extends:i}=this,r=Object.keys(t);if(!i)return r;const s=i.getModeNames();return[...new Set([...r,...s])]}hasModeOnTier(t){if(this.hasMode(t))return!0;const i=this.extends;return i?i.hasModeOnTier(t):!1}get optionManager(){return this.getModeOptionManager(this.mode)}getModeOptionManager(t){var s;const i=this.modes[t];return i||(((s=this.extends)==null?void 0:s.getModeOptionManager(t))?this.setModeOption(t,{}):null)}getMember(t){const i=this.optionManager.getMember(t);if(!this.isUndefined(i))return i;const r=this.extends;if(r)return r.getMember(t)}getValue(t){const i=this.optionManager.getValue(t);if(!this.isUndefined(i))return i;const r=this.extends;if(r)return r.getValue(t)}}function et(n,e){const{name:t}=e,i=`_${t}`;return{get:function(){return this[i]||(this[i]=new f(this.constructor[t].mode,void 0,this.constructor[t]))}}}class x{static get pluginManager(){let e=this._pluginManager;return e||(e=this._pluginManager=new O(this)),e}get pluginManager(){return this.constructor.pluginManager}static use(e,...t){return this.pluginManager.use(e,...t)}use(e,...t){return this.pluginManager.instUse(this,e,...t)}destroy(){return this.pluginManager.destroyed(this)}}u(x,"_pluginManager");function H(){var n;return n=class{static get pluginManager(){let t=this._pluginManager;return t||(t=this._pluginManager=new O(this)),t}get pluginManager(){return this.constructor.pluginManager}static use(t,...i){return this.pluginManager.use(t,...i)}use(t,...i){return this.pluginManager.instUse(this,t,...i)}destroy(){return this.pluginManager.destroyed(this)}},u(n,"_pluginManager"),n}function U(n){const e=g(n,{get pluginManager(){let t=this._pluginManager;return t||(t=this._pluginManager=new O(this)),t},use(t,i){return this.pluginManager.use(t,i)}});return g(e.prototype,{get pluginManager(){return this.constructor.pluginManager},use(t,i){return this.pluginManager.instUse(this,t,i)},destroy(){return this.pluginManager.destroyed(this)}}),n}function nt(n){const e=U(n);return new Proxy(n,{construct:function(t,i,r){const s=new t(...i);return e.pluginManager.created(this),s}})}function it(n){var e;return e=class extends n{static get pluginManager(){let i=this._pluginManager;return i||(i=this._pluginManager=new O(this)),i}get pluginManager(){return this.constructor.pluginManager}static use(i,...r){return this.pluginManager.use(i,...r)}constructor(...i){super(...i),this.pluginManager.created(this)}use(i,...r){return this.pluginManager.instUse(this,i,...r)}destroy(){return this.pluginManager.destroyed(this)}},u(e,"_pluginManager"),e}class I extends x{constructor(t){super();u(this,"_defaultOptions");this.defaultOptions.option=t}get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new p(void 0,this.constructor.defaultOptions))}}u(I,"defaultOptions",new p);function rt(){var e;const n=H();return e=class extends n{constructor(r){super();u(this,"_defaultOptions");this.defaultOptions.option=r}get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new p(void 0,this.constructor.defaultOptions))}},u(e,"defaultOptions",new p),e}function ot(n,e){const t=g(n,{defaultOptions:new p(e)});return g(t.prototype,{get defaultOptions(){return this._defaultOptions||(this._defaultOptions=new p(void 0,this.constructor.defaultOptions))}}),n}const m="common";class D extends x{constructor(t){super();u(this,"_modeOptions");this.modeOptions.setOption(t)}get modeOptions(){return this._modeOptions||(this._modeOptions=new f(m,void 0,this.constructor.modeOptions))}get mode(){return this.modeOptions.mode}set mode(t){this.modeOptions.mode=t}get options(){return this.modeOptions.plainFullOption}}u(D,"modeOptions",new f(m));function st(){var e;const n=H();return e=class extends n{constructor(r){super();u(this,"_modeOptions");this.modeOptions.setOption(r)}get modeOptions(){return this._modeOptions||(this._modeOptions=new f(m,void 0,this.constructor.modeOptions))}get mode(){return this.modeOptions.mode}set mode(r){this.modeOptions.mode=r}get options(){return this.modeOptions.plainFullOption}},u(e,"modeOptions",new f(m)),e}function ut(n,e,t){const i=g(n,{modeOptions:new f(e,t)});return g(i.prototype,{get modeOptions(){return this._modeOptions||(this._modeOptions=new f(e,void 0,this.constructor.modeOptions))},get mode(){return this.modeOptions.mode},set mode(r){this.modeOptions.mode=r},get options(){return this.modeOptions.fullOption}}),n}function N(n,e){const t=[{target:n,props:e}];let i;for(;i=t.shift();){const{target:r,props:s}=i;for(const[a,c]of Object.entries(s)){if(c!=null&&typeof c=="object"&&(!c.constructor||c.constructor===Object)){t.push({target:r[a],props:c});continue}r[a]=c}}return n}function W(n,e){const t={},i=[{target:n,props:e,targetProps:t}];let r;for(;r=i.shift();){const{target:s,props:a,targetProps:c}=r;for(const[h,_]of Object.entries(a)){if(_!=null&&typeof _=="object"&&(!_.constructor||_.constructor===Object)){i.push({target:s[h],props:_,targetProps:c[h]={}});continue}c[h]=s[h]}}return t}function at(n,e){const t=W(n,e);function i(){N(n,e)}function r(){N(n,t)}return{set:i,unset:r}}o.ModeOptions=E,o.PluginHost=x,o.PluginManager=O,o.PluginManagerWithInit=L,o.TierModeOptions=f,o.TierModeOptionsPluginHost=D,o.TierOptions=p,o.TierOptionsPluginHost=I,o.addDefaultOptions=Q,o.addInstOptions=X,o.allFunctionApply=P,o.becomePluginHost=U,o.becomePluginHost_Extends=it,o.becomePluginHost_Proxy=nt,o.becomeTierModeOptionsHost=ut,o.becomeTierOptionsHost=ot,o.commonModeName=m,o.createCallerOfPrivateMemberOfExtend=q,o.createDefineMixin=A,o.createExtendTarget=$,o.createExtendTargetWithInit=J,o.createMixinTarget=z,o.createPluginHost=H,o.createPropertySetter=at,o.createTargetExtend=C,o.createTargetExtendWithInit=R,o.createTargetMixin=k,o.createTierModeOptionsPluginHost=st,o.createTierOptionsPluginHost=rt,o.defineExtend=B,o.defineExtendWithInit=K,o.defineMixin=j,o.extendTarget=w,o.extendTargetWithInit=G,o.getPropertyValue=T,o.getPropertyValueByPath=Y,o.getTargetProperties=W,o.mergeProperties=N,o.mixin=l,o.mixinTarget=g,o.parsePropertyPath=b,o.setPropertyValue=F,o.setPropertyValueByPath=Z,o.targetExtend=M,o.targetExtendWithInit=y,o.targetMixin=S,o.tierModeOptionsDecorator=et,o.tierOptionsDecorator=tt,Object.defineProperty(o,Symbol.toStringTag,{value:"Module"})});
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* 合并属性
|
|
3
|
+
* 该方法会将 props 深度合并到 target 中,
|
|
4
|
+
* - 所有 纯对象 的属性值都会被作为 props 进行深度合并
|
|
5
|
+
* - 对于不是纯对象的属性,会将其视为属性值设置到到目标中对应的属性上
|
|
6
|
+
*
|
|
7
|
+
* @param target
|
|
8
|
+
* @param props
|
|
9
|
+
*/
|
|
10
|
+
export declare function mergeProperties(target: any, props: any): any;
|
|
11
|
+
/**
|
|
12
|
+
* 按照 props 的结构,获取 target 的 属性对象
|
|
13
|
+
* - props 中所有 纯对象 都会被作为 props 进行递归地获取
|
|
14
|
+
* @param target
|
|
15
|
+
* @param props
|
|
16
|
+
* @returns
|
|
17
|
+
*/
|
|
18
|
+
export declare function getTargetProperties<Props>(target: any, props: Props): Props;
|
|
19
|
+
/**
|
|
20
|
+
* 创建属性设置器
|
|
21
|
+
*
|
|
22
|
+
* @param target
|
|
23
|
+
* @param props
|
|
24
|
+
* @returns 会返回一个 set 和 unset 方法,set 方法用户将 props 中描述的属性值设置到 target 中, unset 方法用于恢复成原来的值
|
|
25
|
+
*/
|
|
26
|
+
export declare function createPropertySetter(target: any, props: any): {
|
|
27
|
+
set: () => void;
|
|
28
|
+
unset: () => void;
|
|
29
|
+
};
|
|
30
|
+
//# sourceMappingURL=properties.d.ts.map
|
|
@@ -0,0 +1 @@
|
|
|
1
|
+
{"version":3,"file":"properties.d.ts","sourceRoot":"","sources":["../src/properties.ts"],"names":[],"mappings":"AACA;;;;;;;;GAQG;AACH,wBAAgB,eAAe,CAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG,OAenD;AAGD;;;;;;GAMG;AACH,wBAAgB,mBAAmB,CAAC,KAAK,EAAE,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,KAAK,GAAE,KAAK,CAiBvE;AAGD;;;;;;GAMG;AACH,wBAAgB,oBAAoB,CAAC,MAAM,EAAC,GAAG,EAAC,KAAK,EAAC,GAAG;;;EAYxD"}
|
package/dist/tsdoc-metadata.json
CHANGED
package/doc/api/index.md
CHANGED
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
创建增加带有选项机制的装饰器
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
export declare function addDefaultOptions<Options>(options: Options, name?: Optional<string>): <Clas extends new (...args: any) => any>(target: Clas) => void;
|
|
@@ -17,9 +17,9 @@ export declare function addDefaultOptions<Options>(options: Options, name?: Opti
|
|
|
17
17
|
| Parameter | Type | Description |
|
|
18
18
|
| --- | --- | --- |
|
|
19
19
|
| options | Options | 选项内容 |
|
|
20
|
-
| name | Optional<string> |
|
|
20
|
+
| name | Optional<string> | _(Optional)_ |
|
|
21
21
|
|
|
22
|
-
|
|
22
|
+
**Returns:**
|
|
23
23
|
|
|
24
24
|
<Clas extends new (...args: any) => any>(target: Clas) => void
|
|
25
25
|
|
|
@@ -6,7 +6,7 @@
|
|
|
6
6
|
|
|
7
7
|
创建增加带有选项机制的装饰器
|
|
8
8
|
|
|
9
|
-
|
|
9
|
+
**Signature:**
|
|
10
10
|
|
|
11
11
|
```typescript
|
|
12
12
|
export declare function addInstOptions<Clas extends new (...args: any) => any>(target: Clas, propertyKey: string, descriptor: PropertyDescriptor): PropertyDescriptor;
|
|
@@ -20,7 +20,7 @@ export declare function addInstOptions<Clas extends new (...args: any) => any>(t
|
|
|
20
20
|
| propertyKey | string | |
|
|
21
21
|
| descriptor | PropertyDescriptor | |
|
|
22
22
|
|
|
23
|
-
|
|
23
|
+
**Returns:**
|
|
24
24
|
|
|
25
25
|
PropertyDescriptor
|
|
26
26
|
|
|
@@ -0,0 +1,26 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [allFunctionApply](./plugin-tls.allfunctionapply.md)
|
|
4
|
+
|
|
5
|
+
## allFunctionApply() function
|
|
6
|
+
|
|
7
|
+
对一组函数批量调用 apply
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function allFunctionApply<T, A extends any[], R>(funArr: ((this: T, ...args: A) => void)[], thisArg: T, args: A): void;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| funArr | ((this: T, ...args: A) => void)\[\] | |
|
|
20
|
+
| thisArg | T | |
|
|
21
|
+
| args | A | |
|
|
22
|
+
|
|
23
|
+
**Returns:**
|
|
24
|
+
|
|
25
|
+
void
|
|
26
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [BecomePluginHost](./plugin-tls.becomepluginhost.md)
|
|
4
|
+
|
|
5
|
+
## BecomePluginHost type
|
|
6
|
+
|
|
7
|
+
将 HOST 变成插件宿主类型
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type BecomePluginHost<HOST extends new (...args: any) => any, Plugin extends IPlugin<HOST, any> = IPlugin<HOST, any>> = HOST & IPluginHostConstructor<HOST & IPluginHostConstructor<HOST, Plugin>, Plugin> & ReplaceConstructorReturn<HOST, InstanceType<HOST> & IPluginHost<HOST & IPluginHostConstructor<HOST & IPluginHostConstructor<HOST, Plugin>, Plugin>>>;
|
|
13
|
+
```
|
|
14
|
+
**References:** [IPlugin](./plugin-tls.iplugin.md)<!-- -->, [IPluginHostConstructor](./plugin-tls.ipluginhostconstructor.md)<!-- -->, [ReplaceConstructorReturn](./plugin-tls.replaceconstructorreturn.md)<!-- -->, [IPluginHost](./plugin-tls.ipluginhost.md)
|
|
15
|
+
|
|
@@ -0,0 +1,38 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [becomePluginHost\_Extends](./plugin-tls.becomepluginhost_extends.md)
|
|
4
|
+
|
|
5
|
+
## becomePluginHost\_Extends() function
|
|
6
|
+
|
|
7
|
+
插件缩主类的装饰器(继承版)
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function becomePluginHost_Extends<HOST extends new (...args: any) => any>(target: HOST): {
|
|
13
|
+
new (...args: any): {
|
|
14
|
+
[x: string]: any;
|
|
15
|
+
readonly pluginManager: PluginManager<any & HOST, IPlugin<any & HOST, any>>;
|
|
16
|
+
use<Plugin_1 extends IPlugin<any & HOST, any>>(plugin: Plugin_1, ...options: FormatUsePluginParameters<Plugin_1>): void | PluginCreatedReturnType<Plugin_1>;
|
|
17
|
+
destroy(): void;
|
|
18
|
+
};
|
|
19
|
+
readonly pluginManager: PluginManager<any & HOST, IPlugin<any & HOST, any>>;
|
|
20
|
+
_pluginManager: PluginManager<any & HOST, IPlugin<any & HOST, any>>;
|
|
21
|
+
use<Plugin_2 extends IPlugin<any & HOST, any>>(plugin: Plugin_2, ...options: FormatUsePluginParameters<Plugin_2>): void | ReturnType<Plugin_2["used"]>;
|
|
22
|
+
} & HOST;
|
|
23
|
+
```
|
|
24
|
+
|
|
25
|
+
## Parameters
|
|
26
|
+
|
|
27
|
+
| Parameter | Type | Description |
|
|
28
|
+
| --- | --- | --- |
|
|
29
|
+
| target | HOST | |
|
|
30
|
+
|
|
31
|
+
**Returns:**
|
|
32
|
+
|
|
33
|
+
{ new (...args: any): { \[x: string\]: any; readonly pluginManager: [PluginManager](./plugin-tls.pluginmanager.md)<!-- --><any & HOST, [IPlugin](./plugin-tls.iplugin.md)<!-- --><any & HOST, any>>; use<Plugin\_1 extends [IPlugin](./plugin-tls.iplugin.md)<!-- --><any & HOST, any>>(plugin: Plugin\_1, ...options: [FormatUsePluginParameters](./plugin-tls.formatusepluginparameters.md)<!-- --><Plugin\_1>): void \| [PluginCreatedReturnType](./plugin-tls.plugincreatedreturntype.md)<!-- --><Plugin\_1>; destroy(): void; }; readonly pluginManager: [PluginManager](./plugin-tls.pluginmanager.md)<!-- --><any & HOST, [IPlugin](./plugin-tls.iplugin.md)<!-- --><any & HOST, any>>; \_pluginManager: [PluginManager](./plugin-tls.pluginmanager.md)<!-- --><any & HOST, [IPlugin](./plugin-tls.iplugin.md)<!-- --><any & HOST, any>>; use<Plugin\_2 extends [IPlugin](./plugin-tls.iplugin.md)<!-- --><any & HOST, any>>(plugin: Plugin\_2, ...options: [FormatUsePluginParameters](./plugin-tls.formatusepluginparameters.md)<!-- --><Plugin\_2>): void \| ReturnType<Plugin\_2\["used"\]>; } & HOST
|
|
34
|
+
|
|
35
|
+
## Remarks
|
|
36
|
+
|
|
37
|
+
通过继承实现
|
|
38
|
+
|
|
@@ -0,0 +1,29 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [becomePluginHost\_Proxy](./plugin-tls.becomepluginhost_proxy.md)
|
|
4
|
+
|
|
5
|
+
## becomePluginHost\_Proxy() function
|
|
6
|
+
|
|
7
|
+
变成插件宿主
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function becomePluginHost_Proxy<HOST extends new (...args: any) => any, Plugin extends IPlugin<HOST, any> = IPlugin<HOST, any>>(target: HOST): HOST;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| target | HOST | |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
HOST
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Remarks
|
|
27
|
+
|
|
28
|
+
也可作为装饰器
|
|
29
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [BecomeTierModeOptionsHost](./plugin-tls.becometiermodeoptionshost.md)
|
|
4
|
+
|
|
5
|
+
## BecomeTierModeOptionsHost type
|
|
6
|
+
|
|
7
|
+
使 HOST 变成 层级选项的宿主类型
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type BecomeTierModeOptionsHost<HOST extends new (...args: any) => any, Options extends {} = any, Mode extends string | number = string> = HOST & ITierModeOptionsHostConstructor<Options, Mode> & ReplaceConstructorReturn<HOST, InstanceType<HOST> & ITierModeOptionsHost<Options, Mode>>;
|
|
13
|
+
```
|
|
14
|
+
**References:** [ITierModeOptionsHostConstructor](./plugin-tls.itiermodeoptionshostconstructor.md)<!-- -->, [ReplaceConstructorReturn](./plugin-tls.replaceconstructorreturn.md)<!-- -->, [ITierModeOptionsHost](./plugin-tls.itiermodeoptionshost.md)
|
|
15
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [BecomeTierOptionsHost](./plugin-tls.becometieroptionshost.md)
|
|
4
|
+
|
|
5
|
+
## BecomeTierOptionsHost type
|
|
6
|
+
|
|
7
|
+
使 HOST 变成 层级选项的宿主类型
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type BecomeTierOptionsHost<HOST extends new (...args: any) => any, Options extends {} = any> = HOST & ITierOptionsHostConstructor<Options> & ReplaceConstructorReturn<HOST, InstanceType<HOST> & ITierOptionsHost<Options>>;
|
|
13
|
+
```
|
|
14
|
+
**References:** [ITierOptionsHostConstructor](./plugin-tls.itieroptionshostconstructor.md)<!-- -->, [ReplaceConstructorReturn](./plugin-tls.replaceconstructorreturn.md)<!-- -->, [ITierOptionsHost](./plugin-tls.itieroptionshost.md)
|
|
15
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtender](./plugin-tls.classextender.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtender type
|
|
6
|
+
|
|
7
|
+
类扩展者
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type ClassExtender<C extends new (...args: any) => any> = C & ClassExtenderPrivateMember<C>;
|
|
13
|
+
```
|
|
14
|
+
**References:** [ClassExtenderPrivateMember](./plugin-tls.classextenderprivatemember.md)
|
|
15
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderPrivateMember](./plugin-tls.classextenderprivatemember.md) > [\_constructors](./plugin-tls.classextenderprivatemember._constructors.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderPrivateMember.\_constructors property
|
|
6
|
+
|
|
7
|
+
保存扩展类自定义的构建函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly _constructors: ((this: InstanceType<C>, ...args: ConstructorParameters<C>) => void)[];
|
|
13
|
+
```
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderPrivateMember](./plugin-tls.classextenderprivatemember.md) > [\_destroys](./plugin-tls.classextenderprivatemember._destroys.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderPrivateMember.\_destroys property
|
|
6
|
+
|
|
7
|
+
保存扩展类自定义的销毁函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly _destroys: ((this: InstanceType<C>) => void)[];
|
|
13
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderPrivateMember](./plugin-tls.classextenderprivatemember.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderPrivateMember interface
|
|
6
|
+
|
|
7
|
+
类扩展者的私有方法
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export interface ClassExtenderPrivateMember<C extends new (...args: any) => any>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Properties
|
|
16
|
+
|
|
17
|
+
| Property | Modifiers | Type | Description |
|
|
18
|
+
| --- | --- | --- | --- |
|
|
19
|
+
| [\_constructors](./plugin-tls.classextenderprivatemember._constructors.md) | <code>readonly</code> | ((this: InstanceType<C>, ...args: ConstructorParameters<C>) => void)\[\] | 保存扩展类自定义的构建函数 |
|
|
20
|
+
| [\_destroys](./plugin-tls.classextenderprivatemember._destroys.md) | <code>readonly</code> | ((this: InstanceType<C>) => void)\[\] | 保存扩展类自定义的销毁函数 |
|
|
21
|
+
|
|
@@ -0,0 +1,13 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderPrivateMemberWithInit](./plugin-tls.classextenderprivatememberwithinit.md) > [\_inits](./plugin-tls.classextenderprivatememberwithinit._inits.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderPrivateMemberWithInit.\_inits property
|
|
6
|
+
|
|
7
|
+
保存扩展类中自定义的初始化方法
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
readonly _inits: ((this: InstanceType<C>, ...args: InitParams) => void)[];
|
|
13
|
+
```
|
|
@@ -0,0 +1,21 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderPrivateMemberWithInit](./plugin-tls.classextenderprivatememberwithinit.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderPrivateMemberWithInit interface
|
|
6
|
+
|
|
7
|
+
类扩展者的私有方法
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export interface ClassExtenderPrivateMemberWithInit<C extends new (...args: any) => any, InitParams extends any[] = any> extends ClassExtenderPrivateMember<C>
|
|
13
|
+
```
|
|
14
|
+
**Extends:** [ClassExtenderPrivateMember](./plugin-tls.classextenderprivatemember.md)<!-- --><C>
|
|
15
|
+
|
|
16
|
+
## Properties
|
|
17
|
+
|
|
18
|
+
| Property | Modifiers | Type | Description |
|
|
19
|
+
| --- | --- | --- | --- |
|
|
20
|
+
| [\_inits](./plugin-tls.classextenderprivatememberwithinit._inits.md) | <code>readonly</code> | ((this: InstanceType<C>, ...args: InitParams) => void)\[\] | 保存扩展类中自定义的初始化方法 |
|
|
21
|
+
|
|
@@ -0,0 +1,15 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassExtenderWithInit](./plugin-tls.classextenderwithinit.md)
|
|
4
|
+
|
|
5
|
+
## ClassExtenderWithInit type
|
|
6
|
+
|
|
7
|
+
类扩展者
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export type ClassExtenderWithInit<C extends new (...args: any) => any, InitParams extends any[] = any> = C & ClassExtenderPrivateMemberWithInit<C, InitParams>;
|
|
13
|
+
```
|
|
14
|
+
**References:** [ClassExtenderPrivateMemberWithInit](./plugin-tls.classextenderprivatememberwithinit.md)
|
|
15
|
+
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassType](./plugin-tls.classtype.md) > [(new)](./plugin-tls.classtype._new_.md)
|
|
4
|
+
|
|
5
|
+
## ClassType.(new)
|
|
6
|
+
|
|
7
|
+
**Signature:**
|
|
8
|
+
|
|
9
|
+
```typescript
|
|
10
|
+
new (...args: Arg): Instance;
|
|
11
|
+
```
|
|
12
|
+
|
|
13
|
+
## Parameters
|
|
14
|
+
|
|
15
|
+
| Parameter | Type | Description |
|
|
16
|
+
| --- | --- | --- |
|
|
17
|
+
| args | Arg | |
|
|
18
|
+
|
|
19
|
+
**Returns:**
|
|
20
|
+
|
|
21
|
+
Instance
|
|
22
|
+
|
|
@@ -0,0 +1,20 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [ClassType](./plugin-tls.classtype.md)
|
|
4
|
+
|
|
5
|
+
## ClassType interface
|
|
6
|
+
|
|
7
|
+
类的类型、构造函数的类型
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export interface ClassType<Arg extends any[] = any, Instance = any>
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Methods
|
|
16
|
+
|
|
17
|
+
| Method | Description |
|
|
18
|
+
| --- | --- |
|
|
19
|
+
| [(new)(args)](./plugin-tls.classtype._new_.md) | |
|
|
20
|
+
|
|
@@ -0,0 +1,18 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [commonModeName](./plugin-tls.commonmodename.md)
|
|
4
|
+
|
|
5
|
+
## commonModeName variable
|
|
6
|
+
|
|
7
|
+
一般模式的名字
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
commonModeName = "common"
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Remarks
|
|
16
|
+
|
|
17
|
+
一般模式,其它模式可以继承该模式
|
|
18
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [createCallerOfPrivateMemberOfExtend](./plugin-tls.createcallerofprivatememberofextend.md)
|
|
4
|
+
|
|
5
|
+
## createCallerOfPrivateMemberOfExtend() function
|
|
6
|
+
|
|
7
|
+
创建扩展的私有方法的调用者
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function createCallerOfPrivateMemberOfExtend<C extends ClassType>(cla: C): {
|
|
13
|
+
constructed: (thisArg: any, args: any[]) => void;
|
|
14
|
+
initialized: (thisArg: any, args: any[]) => void;
|
|
15
|
+
destroyed: (thisArg: any, args: any[]) => void;
|
|
16
|
+
};
|
|
17
|
+
```
|
|
18
|
+
|
|
19
|
+
## Parameters
|
|
20
|
+
|
|
21
|
+
| Parameter | Type | Description |
|
|
22
|
+
| --- | --- | --- |
|
|
23
|
+
| cla | C | |
|
|
24
|
+
|
|
25
|
+
**Returns:**
|
|
26
|
+
|
|
27
|
+
{ constructed: (thisArg: any, args: any\[\]) => void; initialized: (thisArg: any, args: any\[\]) => void; destroyed: (thisArg: any, args: any\[\]) => void; }
|
|
28
|
+
|
|
29
|
+
constructed:执行所有 `_constructor` 的便利函数;initialized:执行所有 `_inits` 的便利函数
|
|
30
|
+
|
|
@@ -0,0 +1,23 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [createDefineMixin](./plugin-tls.createdefinemixin.md)
|
|
4
|
+
|
|
5
|
+
## createDefineMixin() function
|
|
6
|
+
|
|
7
|
+
创建定义混合的类型便利函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function createDefineMixin<T>(): <M>(target: T, mixin: M & ThisType<T & M>) => M & ThisType<T & M>;
|
|
13
|
+
```
|
|
14
|
+
**Returns:**
|
|
15
|
+
|
|
16
|
+
<M>(target: T, mixin: M & ThisType<T & M>) => M & ThisType<T & M>
|
|
17
|
+
|
|
18
|
+
可以用于 定义混合的 类型便利函数
|
|
19
|
+
|
|
20
|
+
## Remarks
|
|
21
|
+
|
|
22
|
+
它返回的便利函数的功能与 [defineMixin()](./plugin-tls.definemixin.md) 的功能一样,唯一区别是不再需要接收 target 参数了
|
|
23
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [createExtendTarget](./plugin-tls.createextendtarget.md)
|
|
4
|
+
|
|
5
|
+
## createExtendTarget() function
|
|
6
|
+
|
|
7
|
+
创建用于扩展目标工具函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function createExtendTarget<C extends ClassType>(cla: C): <E>(ext: E & ThisType<InstanceType<C> & E> & PrivateMemberOfExtend<C>) => ClassType<ConstructorParameters<C>, E & ThisType<InstanceType<C> & E>>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| cla | C | 扩展的目标,也用作 this 的类型 |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
<E>(ext: E & ThisType<InstanceType<C> & E> & [PrivateMemberOfExtend](./plugin-tls.privatememberofextend.md)<!-- --><C>) => [ClassType](./plugin-tls.classtype.md)<!-- --><ConstructorParameters<C>, E & ThisType<InstanceType<C> & E>>
|
|
24
|
+
|
|
25
|
+
可以用于 扩展目标 的便利函数
|
|
26
|
+
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
它返回的便利函数的功能与 [extendTarget()](./plugin-tls.extendtarget.md) 的功能一样,唯一区别是不再需要接收 cla 参数了
|
|
30
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [createExtendTargetWithInit](./plugin-tls.createextendtargetwithinit.md)
|
|
4
|
+
|
|
5
|
+
## createExtendTargetWithInit() function
|
|
6
|
+
|
|
7
|
+
创建用于扩展目标工具函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function createExtendTargetWithInit<C extends ClassType>(cla: C): <E>(ext: E & ThisType<InstanceType<C> & E> & PrivateMemberOfExtendWithInit<C, any>) => ClassType<ConstructorParameters<C>, E & ThisType<InstanceType<C> & E>>;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| cla | C | 扩展的目标,也用作 this 的类型 |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
<E>(ext: E & ThisType<InstanceType<C> & E> & [PrivateMemberOfExtendWithInit](./plugin-tls.privatememberofextendwithinit.md)<!-- --><C, any>) => [ClassType](./plugin-tls.classtype.md)<!-- --><ConstructorParameters<C>, E & ThisType<InstanceType<C> & E>>
|
|
24
|
+
|
|
25
|
+
可以用于 扩展目标 的便利函数
|
|
26
|
+
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
它返回的便利函数的功能与 [extendTargetWithInit()](./plugin-tls.extendtargetwithinit.md) 的功能一样,唯一区别是不再需要接收 cla 参数了
|
|
30
|
+
|
|
@@ -0,0 +1,30 @@
|
|
|
1
|
+
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
|
|
2
|
+
|
|
3
|
+
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [createMixinTarget](./plugin-tls.createmixintarget.md)
|
|
4
|
+
|
|
5
|
+
## createMixinTarget() function
|
|
6
|
+
|
|
7
|
+
创建用于混合目标工具函数
|
|
8
|
+
|
|
9
|
+
**Signature:**
|
|
10
|
+
|
|
11
|
+
```typescript
|
|
12
|
+
export declare function createMixinTarget<T>(target: T): <M>(m: M & ThisType<T & M>) => M & ThisType<T & M> & T;
|
|
13
|
+
```
|
|
14
|
+
|
|
15
|
+
## Parameters
|
|
16
|
+
|
|
17
|
+
| Parameter | Type | Description |
|
|
18
|
+
| --- | --- | --- |
|
|
19
|
+
| target | T | |
|
|
20
|
+
|
|
21
|
+
**Returns:**
|
|
22
|
+
|
|
23
|
+
<M>(m: M & ThisType<T & M>) => M & ThisType<T & M> & T
|
|
24
|
+
|
|
25
|
+
可以用于 混合目标 的便利函数
|
|
26
|
+
|
|
27
|
+
## Remarks
|
|
28
|
+
|
|
29
|
+
它返回的便利函数的功能与 [mixinTarget()](./plugin-tls.mixintarget.md) 的功能一样,唯一区别是不再需要接收 target 参数了
|
|
30
|
+
|