UNPKG

plugin-tls

Version:

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

178 lines (80 loc) 2.5 kB
<!-- Do not edit this file. It is automatically generated by API Documenter. --> [Home](./index.md) &gt; [plugin-tls](./plugin-tls.md) &gt; [PluginHost](./plugin-tls.pluginhost.md) ## PluginHost class 插件的宿主 **Signature:** ```typescript export declare class PluginHost<Plugin extends IPlugin<typeof PluginHost, any> = IPlugin<typeof PluginHost, any>> extends WebDestroyable ``` **Extends:** WebDestroyable ## Remarks 插件宿主 就是 拥有插件机制的宿主 子类需要在构建函数中调用 `this.pluginManager.created(this);` 之所以没写在该类中的函数中,是因为 `this.pluginManager.created(this)` 通常会在构建函数执行的最后时才调用; 如果像下面写在该类的构建函数中,然后子类通过 `super()` 来调用,这样就会导致 `this.pluginManager.created(this)` 不是在最后的执行; ## Properties <table><thead><tr><th> Property </th><th> Modifiers </th><th> Type </th><th> Description </th></tr></thead> <tbody><tr><td> [\_pluginManager](./plugin-tls.pluginhost._pluginmanager.md) </td><td> `protected` `static` </td><td> [PluginManager](./plugin-tls.pluginmanager.md)<!-- -->&lt;any&gt; </td><td> </td></tr> <tr><td> [pluginManager](./plugin-tls.pluginhost.pluginmanager.md) </td><td> `readonly` </td><td> [PluginManager](./plugin-tls.pluginmanager.md)<!-- -->&lt;any, [IPlugin](./plugin-tls.iplugin.md)<!-- -->&lt;any, any&gt;&gt; </td><td> 插件管理器 </td></tr> <tr><td> [pluginManager](./plugin-tls.pluginhost.pluginmanager.md) </td><td> `static` `readonly` </td><td> [PluginManager](./plugin-tls.pluginmanager.md)<!-- -->&lt;any, [IPlugin](./plugin-tls.iplugin.md)<!-- -->&lt;any, any&gt;&gt; </td><td> 插件管理器 </td></tr> </tbody></table> ## Methods <table><thead><tr><th> Method </th><th> Modifiers </th><th> Description </th></tr></thead> <tbody><tr><td> [destroyThis()](./plugin-tls.pluginhost.destroythis.md) </td><td> </td><td> 销毁实例 </td></tr> <tr><td> [use(plugin, options)](./plugin-tls.pluginhost.use.md) </td><td> </td><td> 实例的注册插件的方法 </td></tr> <tr><td> [use(plugin, options)](./plugin-tls.pluginhost.use.md) </td><td> `static` </td><td> 使用插件、注册插件 </td></tr> </tbody></table>