-
Notifications
You must be signed in to change notification settings - Fork 12.6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use type annotation in declarations emitter #1122
Conversation
Also removed the unnecessary error messages for type alias privacy check
case SyntaxKind.StringLiteral: | ||
return writeTextOfNode(type); | ||
case SyntaxKind.TypeReference: | ||
return emitTypeReference(<TypeReferenceNode>type); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
why not just write the text of teh node here? i.e. writeTextOfNode(type)? For that matter, why not just call writeTextOfNode for all TypeNode's?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
that's because we want to format how we are writing d.ts ... We do need to go deep in the type node though to check if it is referencing any type that is not visibile so it didn't seem much of a work writing the text to declaration file along with traversing.
…nsEmitter Use type annotation in declarations emitter
If user specified type annotation exists in the typescript file, use that instead of inferring the name from the symbol