Created
January 30, 2019 06:15
-
-
Save ksaldana1/9414366df92cce98cb2da2e0494c0c86 to your computer and use it in GitHub Desktop.
checker
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
ts.forEachChild(source, node => { | |
if (ts.isTypeAliasDeclaration(node)) { | |
const symbol = checker.getSymbolAtLocation(node.name); | |
const type = checker.getDeclaredTypeOfSymbol(symbol); | |
const properties = checker.getPropertiesOfType(type); | |
properties.forEach(declaration => { | |
console.log(declaration.name); | |
// prints username, info | |
}); | |
} | |
}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment