diff --git a/types/bluebird-global/bluebird-global-tests.ts b/types/bluebird-global/bluebird-global-tests.ts index 0464b188cd..b6bbb915e2 100644 --- a/types/bluebird-global/bluebird-global-tests.ts +++ b/types/bluebird-global/bluebird-global-tests.ts @@ -40,3 +40,7 @@ function testPromiseRejection() { return value.toUpperCase(); }); } + +function testGithubTicket28081Regression() { + Promise.resolve([3]).map((n: number) => true); +} diff --git a/types/bluebird-global/index.d.ts b/types/bluebird-global/index.d.ts index 0d8ac4eeb3..7f38f981f1 100644 --- a/types/bluebird-global/index.d.ts +++ b/types/bluebird-global/index.d.ts @@ -67,52 +67,52 @@ declare global { * Patch all instance method */ interface Promise { - all: typeof Bluebird.prototype.all; - any: typeof Bluebird.prototype.any; - asCallback: typeof Bluebird.prototype.asCallback; - bind: typeof Bluebird.prototype.bind; - call: typeof Bluebird.prototype.call; - cancel: typeof Bluebird.prototype.cancel; - // catch: typeof Bluebird.prototype.catch; - caught: typeof Bluebird.prototype.caught; - delay: typeof Bluebird.prototype.delay; - disposer: typeof Bluebird.prototype.disposer; - done: typeof Bluebird.prototype.done; - each: typeof Bluebird.prototype.each; - error: typeof Bluebird.prototype.error; - filter: typeof Bluebird.prototype.filter; - // finally: typeof Bluebird.prototype.finally; - get: typeof Bluebird.prototype.get; - isCancelled: typeof Bluebird.prototype.isCancelled; - isFulfilled: typeof Bluebird.prototype.isFulfilled; - isPending: typeof Bluebird.prototype.isPending; - isRejected: typeof Bluebird.prototype.isRejected; - isResolved: typeof Bluebird.prototype.isResolved; - lastly: typeof Bluebird.prototype.lastly; - map: typeof Bluebird.prototype.map; - mapSeries: typeof Bluebird.prototype.mapSeries; - nodeify: typeof Bluebird.prototype.nodeify; - props: typeof Bluebird.prototype.props; - race: typeof Bluebird.prototype.race; - reason: typeof Bluebird.prototype.reason; - reduce: typeof Bluebird.prototype.reduce; - reflect: typeof Bluebird.prototype.reflect; - return: typeof Bluebird.prototype.return; - some: typeof Bluebird.prototype.some; - spread: typeof Bluebird.prototype.spread; - suppressUnhandledRejections: typeof Bluebird.prototype.suppressUnhandledRejections; - tap: typeof Bluebird.prototype.tap; - tapCatch: typeof Bluebird.prototype.tapCatch; - // then: typeof Bluebird.prototype.then; - thenReturn: typeof Bluebird.prototype.thenReturn; - thenThrow: typeof Bluebird.prototype.thenThrow; - catchReturn: typeof Bluebird.prototype.catchReturn; - catchThrow: typeof Bluebird.prototype.catchThrow; - throw: typeof Bluebird.prototype.throw; - timeout: typeof Bluebird.prototype.timeout; - toJSON: typeof Bluebird.prototype.toJSON; - toString: typeof Bluebird.prototype.toString; - value: typeof Bluebird.prototype.value; + all: Bluebird["all"]; + any: Bluebird["any"]; + asCallback: Bluebird["asCallback"]; + bind: Bluebird["bind"]; + call: Bluebird["call"]; + cancel: Bluebird["cancel"]; + // catch: Bluebird["catch"]; + caught: Bluebird["caught"]; + delay: Bluebird["delay"]; + disposer: Bluebird["disposer"]; + done: Bluebird["done"]; + each: Bluebird["each"]; + error: Bluebird["error"]; + filter: Bluebird["filter"]; + // finally: Bluebird["finally"]; + get: Bluebird["get"]; + isCancelled: Bluebird["isCancelled"]; + isFulfilled: Bluebird["isFulfilled"]; + isPending: Bluebird["isPending"]; + isRejected: Bluebird["isRejected"]; + isResolved: Bluebird["isResolved"]; + lastly: Bluebird["lastly"]; + map: Bluebird["map"]; + mapSeries: Bluebird["mapSeries"]; + nodeify: Bluebird["nodeify"]; + props: Bluebird["props"]; + race: Bluebird["race"]; + reason: Bluebird["reason"]; + reduce: Bluebird["reduce"]; + reflect: Bluebird["reflect"]; + return: Bluebird["return"]; + some: Bluebird["some"]; + spread: Bluebird["spread"]; + suppressUnhandledRejections: Bluebird["suppressUnhandledRejections"]; + tap: Bluebird["tap"]; + tapCatch: Bluebird["tapCatch"]; + // then: Bluebird["then"]; + thenReturn: Bluebird["thenReturn"]; + thenThrow: Bluebird["thenThrow"]; + catchReturn: Bluebird["catchReturn"]; + catchThrow: Bluebird["catchThrow"]; + throw: Bluebird["throw"]; + timeout: Bluebird["timeout"]; + toJSON: Bluebird["toJSON"]; + toString: Bluebird["toString"]; + value: Bluebird["value"]; /* * Copy&paste ::then and ::catch from lib.es2015.promise.d.ts, because Bluebird's typings are not