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

Promises promises #45

Open
AGBrown opened this issue Sep 18, 2015 · 0 comments
Open

Promises promises #45

AGBrown opened this issue Sep 18, 2015 · 0 comments

Comments

@AGBrown
Copy link

AGBrown commented Sep 18, 2015

Could the best practices (or maybe contributing) guide be updated to include recommendations on how to use promises when building a d.ts file?

We ran into this on AGBrown/pouchdb.d.ts#18 (which we are working on for DefinitelyTyped/DefinitelyTyped#4328). There are 180 files in DT that refer to Promise or Thenable (some are implementation libs for promises, others are consumers of promises), and the styles vary wildly (from referencing various promise d.ts files to redefining their own promises)

It seems like a best practice might be something like:

  1. If the library that the d.ts is for uses a specific implementation of a promise lib, then /// that specific promise lib from inside the d.ts, and add a comment to that effect so nobody tries to change it later.
  2. Otherwise: do not /// a promise lib inside the d.ts; make a note in the readme that the user will need to do that themselves; and /// to es6-promise.d.ts inside the -tests.d.ts file.

However, I would be interested to hear if anyone has a preferred best practice that is different to this.

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

No branches or pull requests

1 participant