mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Made $.when work with mixed type values without specifiying <any>
This commit is contained in:
@@ -2296,6 +2296,8 @@ function test_EventIsCallable() {
|
||||
var ev = jQuery.Event('click');
|
||||
}
|
||||
|
||||
var f1: JQueryPromise<string> = $.when("fetch");
|
||||
$.when(3, "asdf").then(x => x.asdf, x => x.length); // is type JQueryPromise<any>
|
||||
|
||||
var f1 = $.when("fetch"); // Is type JQueryPromise<string>
|
||||
var f2: JQueryPromise<string[]> = f1.then(s => [s, s]);
|
||||
var f3: JQueryPromise<number> = f2.then(v => 3);
|
||||
|
||||
Reference in New Issue
Block a user