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

feat: add ts typedefs #32

Merged
merged 5 commits into from
Feb 2, 2021
Merged

Conversation

Gozala
Copy link
Contributor

@Gozala Gozala commented Dec 18, 2020

Adds typedefs so that users of this library can get those out of the box. I have considered adding them via jsdoc systax as per #31, however given all the overloads used in the implementation it's impossible to type those in jsdoc syntax without additional type magic & @ts-ignore comments.

For this reasons and the minimal surface of this lib, I think it's more practical to just have index.d.ts file instead.

Copy link
Collaborator

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

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

This needs the type checker run over the tests to ensure the types are as intended, otherwise releasing future changes will be very error prone.

This should also go out as a major to avoid breaking projects that have types, use this module and suddenly discover the types are not quite as they expected.

index.d.ts Outdated Show resolved Hide resolved
index.d.ts Outdated Show resolved Hide resolved
index.d.ts Show resolved Hide resolved
@hugomrdias
Copy link

@Gozala ping

index.d.ts Outdated Show resolved Hide resolved
@Gozala Gozala requested a review from achingbrain January 20, 2021 05:56
@Gozala
Copy link
Contributor Author

Gozala commented Jan 20, 2021

Addressed review comments & is ready for another pass

Copy link
Collaborator

@achingbrain achingbrain left a comment

Choose a reason for hiding this comment

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

LGTM, thanks!

index.d.ts Outdated Show resolved Hide resolved
@achingbrain achingbrain requested a review from satazor January 23, 2021 08:23
Co-authored-by: Alex Potsides <alex@achingbrain.net>
@achingbrain achingbrain merged commit b8fcda8 into IndigoUnited:master Feb 2, 2021
@zorji
Copy link

zorji commented Apr 22, 2021

I'll need to deprecate the types in @types/err-code
#21

@zorji
Copy link

zorji commented Apr 22, 2021

PR created DefinitelyTyped/DefinitelyTyped#52518

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