Skip to content

JSDoc: add documentation for class @property declarations #141

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

Closed
wants to merge 3 commits into from

Conversation

Morfent
Copy link

@Morfent Morfent commented Jul 12, 2017

I noticed @property declarations appear to be supported, but are not
documented in the wiki.

I noticed @Property declarations appear to be supported, but are not
documented in the wiki.
@msftclas
Copy link

@Morfent,
Thanks for your contribution.
To ensure that the project team has proper rights to use your work, please complete the Contribution License Agreement at https://cla.microsoft.com.

It will cover your contributions to all Microsoft-managed open source projects.
Thanks,
Microsoft Pull Request Bot

@DanielRosenwasser
Copy link
Member

I started fixing up the document, but I realized that the @property annotations were not actually working; these only seem to work because you're assigning fields in the constructor.

For example, in the following:

/**
 * @property {string} name
 */
class Foo {
    constructor() {
        this.name = 100;
    }
}

new Foo().name

TypeScript currently thinks the type of name is number.

@mhegazy mhegazy closed this Aug 14, 2017
@mhegazy
Copy link
Contributor

mhegazy commented Aug 14, 2017

this should be tracked by microsoft/TypeScript#15715

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.

4 participants