I'm using ts-morph to create API documentation, and I'm collecting type signatures. I have two functions defined like so:
export function aFunction(a: string): string {
return 'hi';
}
export const bFun = (a: string) => { return 'hi'; }
I'm using node.getType().getText() to grab the signature. This works on the arrow function, but it doesn't on the FunctionDeclaration. Using the ast debugger I can see the information I want, but node.getType().getText() gives me typeof aFunction, which is not what I want.

I'm assuming this information must be extractible somehow since you are displaying it in the ast viewer.
Any ideas? :)
I'm using ts-morph to create API documentation, and I'm collecting type signatures. I have two functions defined like so:
I'm using
node.getType().getText()to grab the signature. This works on the arrow function, but it doesn't on the FunctionDeclaration. Using the ast debugger I can see the information I want, butnode.getType().getText()gives metypeof aFunction, which is not what I want.I'm assuming this information must be extractible somehow since you are displaying it in the ast viewer.
Any ideas? :)