@types/bluebird-global
Advanced tools
Comparing version 3.5.8 to 3.5.9
@@ -32,2 +32,22 @@ // Type definitions for bluebird 3.5 | ||
* | ||
* 1.2. Further limitations of `bluebird-global` typings: the return type of Bluebird's methods. | ||
* | ||
* Due to the fact of how bluebird-specific methods are exposed on the global Promise, the | ||
* return type of those methods is Bluebird<T> instead of Promise<T>. This is relevant in the | ||
* following case: | ||
* | ||
* function createDelayedPromise(): Promise<void> { | ||
* return Promise.delay(250); | ||
* } | ||
* | ||
* Since Promise.delay() returns a Bluebird<void> and the function is typed to return a Promise<void>, | ||
* an implicit cast is performed from Bluebird<void> to Promise<void>. And since an instance | ||
* of Bluebird isn't and instance of Promise (due to how `bluebird-global` works), this implicit | ||
* cast fails to compile. In order to walk-around this problem, the following explicit cast should | ||
* be used: | ||
* | ||
* function createDelayedPromise(): Promise<void> { | ||
* return <Promise<void>> Promise.delay(250); | ||
* } | ||
* | ||
* 2. How to use it? | ||
@@ -34,0 +54,0 @@ * |
{ | ||
"name": "@types/bluebird-global", | ||
"version": "3.5.8", | ||
"version": "3.5.9", | ||
"description": "TypeScript definitions for bluebird", | ||
@@ -22,4 +22,4 @@ "license": "MIT", | ||
}, | ||
"typesPublisherContentHash": "0d3027d1b5111e12a2231047351043aeda72044802e14f86ff1b05a24f7324ab", | ||
"typesPublisherContentHash": "e403425935eada71195c6d6086734dd0c7104a6939fa3ed737bea3544f5c3960", | ||
"typeScriptVersion": "2.8" | ||
} |
@@ -11,3 +11,3 @@ # Installation | ||
Additional Details | ||
* Last updated: Mon, 27 Aug 2018 22:59:40 GMT | ||
* Last updated: Thu, 30 Aug 2018 18:48:13 GMT | ||
* Dependencies: bluebird | ||
@@ -14,0 +14,0 @@ * Global values: none |
Sorry, the diff of this file is not supported yet
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
License Policy Violation
LicenseThis package is not allowed per your license policy. Review the package's license to ensure compliance.
Found 1 instance in 1 package
18152
272