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 TypeScript definition #4

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

qm3ster
Copy link

@qm3ster qm3ster commented Aug 28, 2018

No description provided.

@limulus
Copy link
Owner

limulus commented Aug 28, 2018

I kid you not, I was thinking I should look into doing this last night!

I’ll take a look at this later today.

@qm3ster
Copy link
Author

qm3ster commented Aug 28, 2018

It's a PR, not a feature request.
Not saying it so that you pull it faster, just so you don't end up doing the same work.
It took quite a few iterations with different arrangements of generics until it typed everything and never inferred Callback<{}>
For example, overloading the function totally didn't want to work.
Neither did making the return type a parameter, like <T, P extends Promise<T>>

@limulus
Copy link
Owner

limulus commented Aug 29, 2018

Thanks, @qm3ster! I’m new to TypeScript, so I’m glad you did this instead of me as my first experience with TS!

I’m starting to understand how this works. After I play around with it some I expect I will pull and publish this relatively soon.

@limulus limulus self-assigned this Aug 29, 2018
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.

2 participants