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

Enum comment on properties should be preserved #111

Closed
ggrossetie opened this issue Jan 2, 2020 · 1 comment · Fixed by #116
Closed

Enum comment on properties should be preserved #111

ggrossetie opened this issue Jan 2, 2020 · 1 comment · Fixed by #116

Comments

@ggrossetie
Copy link
Contributor

Consider the following code:

/**
 * Enum for tri-state values.
 * @readonly
 * @enum {number}
 */
var triState = {
    /** The true value */
    TRUE: 1,
    /** The false value */
    FALSE: -1,
    /** @type {boolean} */
    MAYBE: true,
};

Currently the generated type definition is:

/**
 * Enum for tri-state values.
 * @readonly
 * @enum {number}
 */
declare enum triState {
    TRUE = 1,
    FALSE = -1,
    MAYBE = true
}

I think we should preserve comments on properties:

/**
 * Enum for tri-state values.
 * @readonly
 * @enum {number}
 */
declare enum triState {
    /** The true value */
    TRUE = 1,
    /** The false value */
    FALSE = -1,
    /** @type {boolean} */
    MAYBE = true
}
@englercj
Copy link
Owner

englercj commented Jan 2, 2020

👍

ggrossetie added a commit to ggrossetie/tsd-jsdoc that referenced this issue Jan 7, 2020
ggrossetie added a commit to ggrossetie/tsd-jsdoc that referenced this issue Jan 7, 2020
ggrossetie added a commit to ggrossetie/tsd-jsdoc that referenced this issue Jan 7, 2020
ggrossetie added a commit to ggrossetie/tsd-jsdoc that referenced this issue Jan 7, 2020
englercj added a commit that referenced this issue Apr 5, 2020
* resolves #111 preserve comment on enum members

* Clean type asertions and 'string' in obj checks

* Remove one more manual kind check

Co-authored-by: Guillaume Grossetie <ggrossetie@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
2 participants