pify
pify copied to clipboard
Add TypeScript type definition
Would be nice to have TypeScript type definitions bundled in this package. The types should be strict and should be generic so it preserves the original function type.
The type definition should follow this styleguide, and should have full docs and type tests.
Some examples:
- https://github.com/sindresorhus/semver-regex/commit/039944bb5b3876913171b895488874b5c200e458
- https://github.com/sindresorhus/global-dirs/commit/0aae4d64887f77af94c4fb7ca12aa9f93c0a8291
- https://github.com/sindresorhus/md5-hex/commit/bbbfeff840f26973fbffc16d4863ae6d120079f3
Note that this is not an easy task and requires you to have advanced TypeScript experience. There have been multiple attempts and a lot of wasted time on my part in the past. If you intend to work on this, please look at the previous attempts and the feedback given there.
IssueHunt Summary
Backers (Total: $100.00)
-
issuehunt ($80.00)
-
omgimalexis ($20.00)
Submitted pull Requests
Become a backer now!
Or submit a pull request to get the deposits!
Tips
- Checkout the Issuehunt explorer to discover more funded issues.
- Need some help from other developers? Add your repositories on IssueHunt to raise funds.
@issuehunt has funded $80.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.
Working on this!
For anyone wanting to work on this, see the initial attempt and feedback in https://github.com/sindresorhus/pify/pull/76.
Note that this is not an easy task and requires you to have advanced TypeScript experience. There have been multiple attempts and a lot of wasted time on my part in the past. If you intend to work on this, please look at the previous attempts and the feedback given there.
@omgimalexis has funded $20.00 to this issue.
- Submit pull request via IssueHunt to receive this reward.
- Want to contribute? Chip in to this issue via IssueHunt.
- Checkout the IssueHunt Issue Explorer to see more funded issues.
- Need help from developers? Add your repository on IssueHunt to raise funds.
This may help someone trying to fix this https://github.com/AlCalzone/DefinitelyTyped/blob/139c1679ecb5c2a475639582b7a312e4e7a1cde5/types/node/util.promisify.d.ts
@sindresorhus I don't get it, is it still an issue? considering the existent type-definitions from https://github.com/DefinitelyTyped/DefinitelyTyped/tree/master/types/pify, I'm quite a bit confused 🤔
The best place for types is in the package itself. DefinitelyTyped is just a workaround until packages provide types themselves. Also, the types at DT are not very good.
fair enough @sindresorhus
indeed, those types seem incompleted!
@renatobenks check the link I gave. That's from a commit to update the built in utils's promisify so it should a good reference to base these on. So far while using the ones I linked manually I've had no edge cases come up.
Thank you for the suggestion @OmgImAlexis, I appreciate that! But unfortunately, I still didn't have a concise idea for moving forward from https://github.com/sindresorhus/pify/pull/76
@sindresorhus has rewarded $90.00 to @tom-sherman. See it on IssueHunt
- :moneybag: Total deposit: $100.00
- :tada: Repository reward(0%): $0.00
- :wrench: Service fee(10%): $10.00