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

support for const/type pairs as enums #66

Merged
merged 6 commits into from
May 10, 2018
Merged

support for const/type pairs as enums #66

merged 6 commits into from
May 10, 2018

Conversation

giladgray
Copy link
Contributor

@giladgray giladgray commented May 10, 2018

Fixes #61

support for the following syntax, exposed as Kind.Enum:

/** const/type pair: enum & string literals */
export const IconName = {
    ADD: "add" as "add",
    REMOVE: "remove" as "remove",
    PLUS: "plus" as "plus",
    MINUS: "minus" as "minus",
};
export type IconName = "add" | "remove" | "plus" | "minus";

@giladgray giladgray changed the title Gg/const type support for const/type pairs as enums May 10, 2018
@giladgray giladgray requested a review from themadcreator May 10, 2018 21:28
@blueprint-bot
Copy link

use blueprint's Intent style with default values

Preview: docs

Success,
Warning,
Danger,
}
export type IconName = "add" | "remove" | "plus" | "minus";
Copy link
Contributor

Choose a reason for hiding this comment

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

You move the test for the Intent enum to enums.ts but you left this unioned string type here and duplicated it in enums.ts

Copy link
Contributor Author

Choose a reason for hiding this comment

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

yes i moved all the enums to a separate test but i left just the union here so we're testing a non-basic type

@blueprint-bot
Copy link

Merge branch 'master' of github.com:palantir/documentalist into gg/const-type

Preview: docs

@giladgray giladgray merged commit c5c1180 into master May 10, 2018
@giladgray giladgray deleted the gg/const-type branch May 10, 2018 22:47
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.

3 participants