Figure out how to determine class type parameters
This commit is contained in:
parent
d7b2ad7a38
commit
472c7b3574
@ -64,6 +64,21 @@ export function typecheck() {
|
|||||||
// }
|
// }
|
||||||
|
|
||||||
const type = checker.getDeclaredTypeOfSymbol(symbol)
|
const type = checker.getDeclaredTypeOfSymbol(symbol)
|
||||||
|
|
||||||
|
if (type.isClassOrInterface() && type.typeParameters) {
|
||||||
|
type.typeParameters.forEach(tp => {
|
||||||
|
console.log('tp.symbol.name', tp.symbol.name)
|
||||||
|
const constraint = tp.getConstraint()
|
||||||
|
if (constraint) {
|
||||||
|
console.log('tp.constraint', checker.typeToString(constraint))
|
||||||
|
}
|
||||||
|
const def = tp.getDefault()
|
||||||
|
if (def) {
|
||||||
|
console.log('tp.default', checker.typeToString(def))
|
||||||
|
}
|
||||||
|
})
|
||||||
|
}
|
||||||
|
|
||||||
// const properties = checker.getPropertiesOfType(type)
|
// const properties = checker.getPropertiesOfType(type)
|
||||||
const properties = type.getApparentProperties()
|
const properties = type.getApparentProperties()
|
||||||
|
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user