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

Add support for types #48

Closed
escapade1990 opened this issue Dec 27, 2021 · 1 comment
Closed

Add support for types #48

escapade1990 opened this issue Dec 27, 2021 · 1 comment

Comments

@escapade1990
Copy link

Is it possible to add configuration to generate type alias instead of interface for props? Like this:
type ComponentProps = {} instead of interface ComponentProps {}

@escapade1990 escapade1990 changed the title Add support for types Add support for types label:enhancement Dec 27, 2021
@escapade1990 escapade1990 changed the title Add support for types label:enhancement Add support for types Dec 27, 2021
@nitzanhen
Copy link
Owner

Hi!
See #41. This feature will be implemented in v1.4.0, but it's already out as an unstable version.

As I commented there:

Ok, it's implemented in version 1.4.0-alpha.1. You can install it using npm i -g agrippa@1.4.0-alpha.1, please test it out!

The new flag is tsPropsDeclaration (--ts-props-declaration in the command line), and it can receive either interface (the default) or type; the corresponding Typescript structure is then used. Note that using this flag in a non-TS environment will raise an error.

It's technically an unstable version, but the tests I set up for the feature pass and it seems to behave smoothly. Either way, if you come across any bugs or have any other feedback, please reply here!

Thanks for reaching out!

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

No branches or pull requests

2 participants