plugin-tls
Version:
plugin-tls 是插件系统相应的工具,可快速地让任何模块具备插件机制
77 lines (36 loc) • 1.39 kB
Markdown
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [plugin-tls](./plugin-tls.md) > [targetExtendWithInit](./plugin-tls.targetextendwithinit.md)
## targetExtendWithInit() function
扩展目标
**Signature:**
```typescript
export declare function targetExtendWithInit<C extends ClassType, E>(cla: C, ext: E & ThisType<InstanceType<C> & E> & PrivateMemberOfExtendWithInit<C>): E & ThisType<InstanceType<C> & E>;
```
## Parameters
<table><thead><tr><th>
Parameter
</th><th>
Type
</th><th>
Description
</th></tr></thead>
<tbody><tr><td>
cla
</td><td>
C
</td><td>
扩展的目标,也用作 this 的类型
</td></tr>
<tr><td>
ext
</td><td>
E & ThisType<InstanceType<C> & E> & [PrivateMemberOfExtendWithInit](./plugin-tls.privatememberofextendwithinit.md)<!-- --><C>
</td><td>
扩展描述对象,会自动更改其this的类型
</td></tr>
</tbody></table>
**Returns:**
E & ThisType<InstanceType<C> & E>
返回注入了 this 类型的 ext 对象本身
## Remarks
与 [defineExtendWithInit()](./plugin-tls.defineextendwithinit.md) 的区别是:`targetExtend` 会执行对 cla 的扩展操作,而 [defineExtendWithInit()](./plugin-tls.defineextendwithinit.md) 不会