希望 api文档 支持管道,常量,箭头函数,枚举,函数等的注释导出
chensi66666 opened this issue · comments
chensi66666 commented
封装组件库时,除类和接口等外,还会封装其他的一些东西,如管道,常量,箭头函数,枚举,函数等,可以考虑为他们实现通过注释生成 api 文档
1.管道
/**
* 这是一个管道
* @public
*/
@Pipe({
name: 'test',
standalone: true
})
export class TestPipe implements PipeTransform {
// eslint-disable-next-line @typescript-eslint/no-unused-vars
transform(value: any, args?: unknown[]): unknown {
return value;
}
}
2.常量
/**
* 这个一个常量
* @public
*/
export const PI = 3.14;
3.箭头函数
/**
* 这是一个工具函数
* @param p1 参数1
* @param p2 参数2
* @return 返回值
* @public
*/
export const test = (p1: string, p2: string): string => {
return p1 + p2;
}
4.枚举
/**
* 枚举值
*
* @public
*/
export enum TestType {
/**
* A
*/
A = '123',
/**
* B
*/
B = '456',
/**
* C
*/
C = '789',
}
5.函数
/**
* 这是一个工具函数
* @param p1 参数1
* @param p2 参数2
* @return 返回值
* @public
*/
export function test(p1: string, p2: string): string {
return p1 + p2;
}
stale commented
This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.