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 a libdef for the mozlog library #3615

Merged
merged 1 commit into from
Oct 25, 2019

Conversation

julienw
Copy link
Contributor

@julienw julienw commented Oct 25, 2019

Other notes:
This is a mozilla tool that wraps intel with some specifics.


declare type LoggerCreator = (string) => Logger;

declare export default function mozlog(options: string | {|
Copy link
Contributor Author

Choose a reason for hiding this comment

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

To be honest I don't know if this is "legit" to use the es module style of exporting if the module itself is using the traditional exports object. I did that here so that the types don't leak outside of the libdef.

Copy link
Member

Choose a reason for hiding this comment

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

It's fine in most cases, and even preferred.
The commonjs form can make certain types of API difficult if not impossible to model in Flow.

Also there's the argument that Flow users should most likely be using transpilation, so ES modules...

@pascalduez pascalduez merged commit 8007623 into flow-typed:master Oct 25, 2019
@julienw
Copy link
Contributor Author

julienw commented Oct 25, 2019

Thanks for the quick review!

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.

None yet

2 participants