如何解决用于导入类中的方法的 Typescript JSDoc @borrows
我在导入的类周围有一个非常薄的包装器,我想将该方法的文档复制到我用来包装它的文件中。
// node_modules/some-library/some-class.ts
/**
* Some excellently written description of the class
* @export
* @class SomeClass
* @extends {BaseClass}
*/
export declare class SomeClass extends BaseClass {
/**
* Some excellent description for ths method.
* @summary The summary
* @param {string} param1 The first parameter
* @param {string} param2 The second parameter
* @param {string} param3 The third parameter
* @throws {RequiredError}
* @memberof SomeClass
*/
someMethod(param1: string,param2: string,param3: string): boolean {
return true;
}
}
我有这个:
// src/wrapper.ts
/**
* A description of this class.
*/
export class MyWrapperClass {
/**
* @borrows SomeClass#someMethod as myWrappedMethod
*/
myWrappedMethod(param1: string,param3: string): boolean {
return someClass.someMethod(param1,param2,param3);
}
}
我想要将 SomeClass.someMethod 中的文档复制到 MyWrappedClass.myWrappedMethod 中。这可能吗?我尝试了一些东西,但都无济于事。
非常感谢任何帮助。
版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。