mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-09-09 11:13:57 +08:00
Merge pull request #1467 from johnnyreilly/switch-0.9.5
Q: changed overload orders to fixes tests
This commit is contained in:
@@ -140,12 +140,12 @@ function test_validate() {
|
||||
}
|
||||
});
|
||||
$(".selector").validate({
|
||||
highlight: function (element, errorClass, validClass) {
|
||||
highlight: function (element: HTMLInputElement, errorClass, validClass) {
|
||||
$(element).addClass(errorClass).removeClass(validClass);
|
||||
$(element.form).find("label[for=" + element.id + "]")
|
||||
.addClass(errorClass);
|
||||
},
|
||||
unhighlight: function (element, errorClass, validClass) {
|
||||
unhighlight: function (element: HTMLInputElement, errorClass, validClass) {
|
||||
$(element).removeClass(errorClass).addClass(validClass);
|
||||
$(element.form).find("label[for=" + element.id + "]")
|
||||
.removeClass(errorClass);
|
||||
|
||||
@@ -2372,7 +2372,7 @@ function test_EventIsCallable() {
|
||||
var ev = jQuery.Event('click');
|
||||
}
|
||||
|
||||
$.when($.ajax("/my/page.json")).then((a,b,c) => a.asdf); // is type JQueryPromise<any>
|
||||
$.when($.ajax("/my/page.json")).then((a?,b?,c?) => a.asdf); // is type JQueryPromise<any>
|
||||
$.when("asdf", "jkl;").done((x,y) => x.length + y.length, (x,y) => x.length + y.length);
|
||||
|
||||
var f1 = $.when("fetch"); // Is type JQueryPromise<string>
|
||||
|
||||
+2
-2
@@ -23,7 +23,7 @@ Q.delay(8, 1000).then(x => x.toExponential());
|
||||
Q.delay(Q("asdf"), 1000).then(x => x.length);
|
||||
Q.delay("asdf", 1000).then(x => x.length);
|
||||
|
||||
var eventualAdd = Q.promised((a: number, b: number) => a + b);
|
||||
var eventualAdd = Q.promised((a?: number, b?: number) => a + b);
|
||||
eventualAdd(Q(1), Q(2)).then(x => x.toExponential());
|
||||
|
||||
var eventually = function (eventually) {
|
||||
@@ -90,7 +90,7 @@ Q.all(promiseArray).then(nums => nums.map(num => num.toPrecision(2)).join(','));
|
||||
|
||||
Q.all<number>(myNums).then(nums => nums.map(Math.round));
|
||||
|
||||
Q.fbind((dateString) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString());
|
||||
Q.fbind((dateString?: string) => new Date(dateString), "11/11/1991")().then(d => d.toLocaleDateString());
|
||||
|
||||
Q.when(8, num => num + "!");
|
||||
Q.when(Q(8), num => num + "!").then(str => str.split(','));
|
||||
|
||||
@@ -106,14 +106,14 @@ declare module Q {
|
||||
export function nsend<T>(nodeModule: any, functionName: string, ...args: any[]): Promise<T>;
|
||||
export function nmcall<T>(nodeModule: any, functionName: string, ...args: any[]): Promise<T>;
|
||||
|
||||
export function all<T>(promises: any[]): Promise<T[]>;
|
||||
export function all<T>(promises: IPromise<T>[]): Promise<T[]>;
|
||||
export function all<T>(promises: any[]): Promise<T[]>;
|
||||
|
||||
export function allSettled<T>(promises: any[]): Promise<PromiseState<T>[]>;
|
||||
export function allSettled<T>(promises: IPromise<T>[]): Promise<PromiseState<T>[]>;
|
||||
export function allSettled<T>(promises: any[]): Promise<PromiseState<T>[]>;
|
||||
|
||||
export function allResolved<T>(promises: any[]): Promise<Promise<T>[]>;
|
||||
export function allResolved<T>(promises: IPromise<T>[]): Promise<Promise<T>[]>;
|
||||
export function allResolved<T>(promises: any[]): Promise<Promise<T>[]>;
|
||||
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason: any) => IPromise<U>): Promise<U>;
|
||||
export function spread<U>(promises: any[], onFulfilled: (...args: any[]) => IPromise<U>, onRejected: (reason: any) => U): Promise<U>;
|
||||
|
||||
Reference in New Issue
Block a user