feat: improve and export typescript definitions #1393
Closed
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
What:
Add typings, improved based on DefinitelyTyped's implementation, and expose from this Library.
Why:
Now
@types/next-auth
is provided by DefinitelyTyped, but that implementation is behinded from this JS implementation. (such as new NextAuth configration, Requests, Responses and Providers)I improved type definitions and made pull request on DefinitelyTyped repository(DefinitelyTyped/DefinitelyTyped#51469), but as you see, result of CI is broken.
The reason is
next-auth
types depends onnext
types innext
package, not in@types/next
. Type definitions of next usests-ignore
in a few files, but DefinitelyTyped not allowts-ignore
and there is no way to avoidts-ignore
banning in contributor's config.As described above, now it is too difficult to pass all CI on DefinitelyTyped, maybe for everybody, without help and fixing DefinitelyTyped. This problem had been discussed in microsoft/dtslint#297 (comment) , but discussion seems to be stoped.
So I think this is the time to provide type definitions in
next-auth
own package.How:
I wrote types reading JS implementations honestly.
Checklist:
@lluia
Thanks to provide current type definitions!
I rewrited too much files, so I'll appreciate if you reviewed and checked there is no degrade.