Skip to content

Exposing TypeOverrides from the library's root #2369

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

Closed
wants to merge 1 commit into from

Conversation

vitaly-t
Copy link
Contributor

@vitaly-t vitaly-t commented Oct 8, 2020

TypeOverrides is too important not to expose it. It should be available from the root.

It is essential part of custom type parsing, for which singleton types is exposed, while TypeOverrides is not.

One of the big issues the current implementation has - impossible to properly declare the type in TypeScript, since it is a class, which we have to use as any interface instead (it's awkward).

Related: #1838, #2363

`TypeOverrides` is too important not to expose it. It should be available from the root.

Related: brianc#1838, brianc#2363
@brianc
Copy link
Owner

brianc commented Oct 9, 2020

Thanks for this - this seems reasonable, but could you write some tests which will both prevent this from regressing & also demonstrate how this would be useful?

@vitaly-t
Copy link
Contributor Author

vitaly-t commented Oct 12, 2020

It's just type exposure through variable, why do you need tests for that?

And as for how this is help full, I explained it from start:

One of the big issues the current implementation has - impossible to properly declare the type in TypeScript, since it is a class, which we have to use as any interface instead (it's awkward).

i.e. the lack of the type makes it very awkward to use it from TypeScript, with direct file inclusion and all. Especially because that extension is a class, and needs proper TypeScript class declaration.

@brianc
Copy link
Owner

brianc commented Oct 12, 2020

It's just type exposure through variable, why do you need tests for that?

Otherwise in the future it might get unexposed & then we wouldn't know we're breaking anything until we release a version w/o it exposed. So just a simple check to make sure it's there is fine.

@gabegorelick
Copy link
Contributor

It would be great to get this merged. @types/pg has had to add this path to their type definitions: DefinitelyTyped/DefinitelyTyped#51175

but could you write some tests which will both prevent this from regressing & also demonstrate how this would be useful

Are there existing tests for exports that this can be added to?

@B4nan B4nan mentioned this pull request Apr 23, 2025
@mesqueeb
Copy link
Contributor

@vitaly-t can you update this PR so the new esm index files also expose TypeOverrides.

@brianc this one could also get some love now that the esm index files are in! 🎉

@brianc
Copy link
Owner

brianc commented Apr 23, 2025

this one could also get some love now that the esm index files are in!

definitely. I'll have to redo this since there's a merge conflict & its lacking tests, but its a very small change. I'll get a PR put up today & reference this one.

@brianc
Copy link
Owner

brianc commented Apr 23, 2025

@mesqueeb - see new PR 😄

@brianc
Copy link
Owner

brianc commented Apr 23, 2025

closed in #3433

@brianc brianc closed this Apr 23, 2025
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.

4 participants