Skip to content

Instantly share code, notes, and snippets.

@ksaldana1
Created January 30, 2019 06:15
Show Gist options
  • Save ksaldana1/9414366df92cce98cb2da2e0494c0c86 to your computer and use it in GitHub Desktop.
Save ksaldana1/9414366df92cce98cb2da2e0494c0c86 to your computer and use it in GitHub Desktop.
checker
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