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

[QUESTION] I'm a bit confused about new libdef creation process #4332

Closed
elenakrittik opened this issue Jun 10, 2022 · 3 comments
Closed

[QUESTION] I'm a bit confused about new libdef creation process #4332

elenakrittik opened this issue Jun 10, 2022 · 3 comments
Labels

Comments

@elenakrittik
Copy link

Am I right that when I need to make a libdef of a library that has TypeScript definitions, I need to look at each export of the library and port export's TypeScript definition to the Flow defenition?

@Brianzchen
Copy link
Member

More or less, their syntaxes are similar but not the same, generally in the areas of how they declare the package modules are different.

While a TS module can just write export const blah every definition for flow-typed must be wrapped in

declare module 'blah' {
 // ...
}

I'm not pro at TS but my general assumption is just that they have a looser syntax in general. TS also tends to have namespace's while flow doesn't so that also requires manual work

You can use tools out there that convert ts to flow but I've seen very little success of people doing that over the years and it usually just becomes abandoned because they don't want to overwrite the work their tool already put in.

@elenakrittik
Copy link
Author

Thanks! Also, I think it might be good to make an issue template for general questions instead of manually assigning the question label

@Brianzchen
Copy link
Member

You're welcome and appreciate that feedback I'll look into it!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants