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

Allow Bluebird to be assignable to ES2016 Promise. #11036

Merged
merged 2 commits into from Sep 7, 2016
Merged

Allow Bluebird to be assignable to ES2016 Promise. #11036

merged 2 commits into from Sep 7, 2016

Conversation

Strate
Copy link
Contributor

@Strate Strate commented Sep 5, 2016

See ##11027

Add yet another one `.then` overloadings.
@dt-bot
Copy link
Member

dt-bot commented Sep 5, 2016

bluebird/bluebird.d.ts

to author (@lhecker). Could you review this PR?
👍 or 👎?

Checklist

  • pass the Travis CI test?

@lhecker
Copy link
Contributor

lhecker commented Sep 5, 2016

@Strate LGTM 🎉

To fix the failing tests I recommend replacing the return; etc. with e.g. return bar;. After that you can use npm test before pushing something to check if it works properly. (I think force-pushing with git commit --amend should be fine too.)

@Strate
Copy link
Contributor Author

Strate commented Sep 5, 2016

@vvakame vvakame merged commit 9b111fd into DefinitelyTyped:master Sep 7, 2016
@OliverJAsh
Copy link
Contributor

Unfortunately the Promise typings have changed in TS version 2 and so these typings no longer correspond: https://github.com/Microsoft/TypeScript/blob/070aa83cc06b2974639bbefcde98e6e2fb5fe693/src/lib/es2015.promise.d.ts

@albertkim
Copy link

^ What is the solution around this now?

@nfantone
Copy link
Contributor

nfantone commented Nov 7, 2016

I'm working on a PR right now. I made the declaration of class Bluebird implement Promise from lib.es6.d.ts.

declare class Bluebird<R> implements Promise<R>, Bluebird.Inspection<R> {

Problem is, I'm unsure as to how to get a reference to that Promise type from within DT. Can I add this to the tsconfig.json file? Is that allowed?

  "lib": [
    "es2015.promise"
  ],

Pinging @lhecker, @Strate and @vvakame.

@Strate
Copy link
Contributor Author

Strate commented Nov 8, 2016

@nfantone Don't forget to implement overloadings for all methods, which returns Promise, to force them to return Bluebird

@mnahkies mnahkies mentioned this pull request Nov 8, 2016
10 tasks
@nfantone
Copy link
Contributor

nfantone commented Nov 8, 2016

Yes, that's done. But still, I don't know what's the proper way of getting a reference to the native Promise library.

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.

None yet

7 participants