[英]how to generate doc for typescript enum type {[key]: value }?
I am writing a logger service for nodeJS in Typescript.我正在 Typescript 中为 nodeJS 编写记录器服务。 I have an enum as below:
我有一个枚举如下:
enum LOG_TYPES {
NONE = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
DEBUG = 4,
}
then I have an setLogType function:然后我有一个 setLogType 函数:
setLogType(type: LOG_TYPES) {
this.logType = type
}
My problem is I don't know how to make docs for the type
param.我的问题是我不知道如何为
type
参数制作文档。
My expectation is the recommendation would show like this我的期望是推荐会像这样显示
0 NONE
1 ERROR
2 WARN
3 INFO
4 DEBUG
...
enum LOG_TYPES {
NONE = 0,
ERROR = 1,
WARN = 2,
INFO = 3,
DEBUG = 4,
}
setLogType(type: keyof typeof LOG_TYPES) {
this.logType = type
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.