UNPKG

plugin-tls

Version:

plugin-tls 是插件系统相应的工具,可快速地让任何模块具备插件机制

77 lines (36 loc) 1.04 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [plugin-tls](./plugin-tls.md) &gt; [defineMixin](./plugin-tls.definemixin.md) ## defineMixin() function 定义混合的类型便利函数 **Signature:** ```typescript export declare function defineMixin<T, M>(target: T, mixin: M & ThisType<T & M>): M & ThisType<T & M>; ``` ## Parameters <table><thead><tr><th> Parameter </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> target </td><td> T </td><td> 混合的目标,用作 this 的类型 </td></tr> <tr><td> mixin </td><td> M &amp; ThisType&lt;T &amp; M&gt; </td><td> 混合对象,会自动更改其this的类型 </td></tr> </tbody></table> **Returns:** M &amp; ThisType&lt;T &amp; M&gt; 返回注入了 this 类型的 mixin 对象本身 ## Remarks 它会更改 mixin 中方法的this指向为 target &amp; mixin,不会真的执行混合操作