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

JSON name conflicts with lib.es6.d.ts #8

Closed
sledorze opened this issue Oct 26, 2017 · 6 comments
Closed

JSON name conflicts with lib.es6.d.ts #8

sledorze opened this issue Oct 26, 2017 · 6 comments

Comments

@sledorze
Copy link
Collaborator

sledorze commented Oct 26, 2017

As a matter to help with auto import and the like it would be better to have a non conflicting name.
Maybe JSONType?

export type JSON = null | string | number | boolean | JSONArray | JSONObject

Also JSON is not exposed outside of the package and 'cannot be named'

@sledorze sledorze changed the title JSON name conflict with lib.es6.d.ts JSON name conflicts with lib.es6.d.ts Oct 26, 2017
@gcanti
Copy link
Owner

gcanti commented Oct 27, 2017

Maybe JSONType?

ok

Also JSON is not exposed outside of the package

What do you mean? The JSON type is exported

and 'cannot be named'

Found this microsoft/TypeScript#5711

@sledorze
Copy link
Collaborator Author

@gcanti yeah, I know one have to fully annotate the type for its types names to be exported correctly.
About JSON, it is annotated as export but not from here:
https://github.com/gcanti/io-ts-types/blob/master/src/index.ts#L10

so one has to do the heavy thing:

import { JSON as JSONType } from 'io-ts-types/lib/JSON/JSONFromString'

@gcanti
Copy link
Owner

gcanti commented Oct 27, 2017

About JSON, it is annotated as export but not from here

Ah! Sorry, I didn't realize that :)

@sledorze
Copy link
Collaborator Author

great!

@gcanti
Copy link
Owner

gcanti commented Oct 28, 2017

Fix released

@sledorze
Copy link
Collaborator Author

@gcanti thanks a lot

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