-
Notifications
You must be signed in to change notification settings - Fork 1.4k
Add Flow type definition #1007
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 Flow type definition #1007
Conversation
Btw the reason for this file's location and naming is so that Flow doesn't require any configuration in order to use the type definitions for AVA. |
Awesome! You also need to add this file to the |
onFulfill?: (value: R) => Promise<U> | U, | ||
onReject?: (error: any) => Promise<U> | U | ||
): Promise<U>; | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any plan to have this builtin in Flow? Kinda weird having to define it manually in every type definition.
Sidenote: Someone really needs to submit Flow syntax highlighting to the syntax highlighter GitHub uses. |
@thejameskyle Do you know anyone familiar with Flow that could review? |
Will have a look! It's very similar to tape's API anyways |
@thejameskyle @sindresorhus Looking good! Seriously, I really tried to break the flow definitions... instead it safely lead me through the Other than that: Is there a reason why you don't put this in |
NOTE: I found one case which wasn't really supported by flow:
|
Thanks for pointing that out @ryyppy, this actually uncovers a really interesting problem with intersection types that needs to be fixed. For now I've worked around the issue with a bit more repetitive of a type definition. Once we fix the issue I can revert the previous change. |
@thejameskyle Is this good to merge? |
Yeah, this is good for now. But should update with no repetition once facebook/flow#2358 is fixed. |
Yay \o/ Thank you @thejameskyle :) |
Resolves #986
I wanted to test Flow against one of AVA's test files but it looks like the test suite isn't self-hosted and there doesn't appear to be any integration-like tests for the public api.
I would suggest doing something along those lines and testing both Flow and TypeScript against it, otherwise you'll end up with out of date type definitions like what has already happened with the TS definition and
.always