获取 typescript 工程中某个类型的信息,比如类型的字符表示及对应的 jsdoc comment。
npm install @findlay-best-wishes/easy-type
const { getTypeOption } = require('@findlay-best-wishes/easy-type')
const { Props } = getTypeOption({
entryFile: 'test.ts',
typeName: 'Props'
tsconfig: 'tsconfig'
})
const { name, type, comment } = Props
// 获取多个类型信息
const { getTypeOption } = require('@findlay-best-wishes/easy-type')
const { Props, State } = getTypeOption({
entryFile: 'button.ts',
typeName: ['Props', 'State']
tsconfig: 'tsconfig'
})