Skip to content
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

feat: support TypeScript constructor params #267

Merged
merged 1 commit into from Jul 26, 2022

Conversation

kitsonk
Copy link
Contributor

@kitsonk kitsonk commented Jul 26, 2022

Closes #192

This is an alternative to #196. Like the recent has_body change, instead of inferring, the doc nodes returned more reflect the code as written, and it is up to the printers to determine how to display that to the user.

In this situation, printers need to decide how to display a public constructor param, along with the other accessibility keywords, override and readonly, which is to likely reflect them in the constructor signature as well as the properties documented on the class.

Copy link
Member

@bartlomieju bartlomieju left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

Copy link
Member

@dsherret dsherret left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM too

@@ -95,13 +95,19 @@ export interface ClassDef {
decorators?: DecoratorDef[];
}

export type ClassConstructorParamDef = ParamDef & {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Nitpick: seems more consistent to use an interface?

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can't here, because ParamDef is a tagged union type alias and interfaces can't extend type aliases.

@kitsonk kitsonk merged commit 0da2e4c into denoland:main Jul 26, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Parameter properties are ignored
3 participants