Merge pull request #5878 from MizardX/master

Three small fixes for jQuery and jQuery UI
This commit is contained in:
John Reilly
2015-09-20 14:09:21 +01:00
3 changed files with 21 additions and 12 deletions
+1 -1
View File
@@ -3359,7 +3359,7 @@ function test_promise_then_change_type() {
var def = $.Deferred<any>();
var promise = def.promise(null);
def.rejectWith(this, new Error());
def.rejectWith(this, [new Error()]);
return promise;
}
+4 -4
View File
@@ -241,7 +241,7 @@ interface JQueryCallback {
* @param context A reference to the context in which the callbacks in the list should be fired.
* @param arguments An argument, or array of arguments, to pass to the callbacks in the list.
*/
fireWith(context?: any, ...args: any[]): JQueryCallback;
fireWith(context?: any, args?: any[]): JQueryCallback;
/**
* Determine whether a supplied callback is in a list
@@ -395,7 +395,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the progressCallbacks as the this object.
* @param args Optional arguments that are passed to the progressCallbacks.
*/
notifyWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
notifyWith(context: any, value?: any[]): JQueryDeferred<T>;
/**
* Reject a Deferred object and call any failCallbacks with the given args.
@@ -409,7 +409,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the failCallbacks as the this object.
* @param args An optional array of arguments that are passed to the failCallbacks.
*/
rejectWith(context: any, value?: any, ...args: any[]): JQueryDeferred<T>;
rejectWith(context: any, value?: any[]): JQueryDeferred<T>;
/**
* Resolve a Deferred object and call any doneCallbacks with the given args.
@@ -425,7 +425,7 @@ interface JQueryDeferred<T> extends JQueryGenericPromise<T> {
* @param context Context passed to the doneCallbacks as the this object.
* @param args An optional array of arguments that are passed to the doneCallbacks.
*/
resolveWith(context: any, value?: T, ...args: any[]): JQueryDeferred<T>;
resolveWith(context: any, value?: T[]): JQueryDeferred<T>;
/**
* Return a Deferred's Promise object.
+16 -7
View File
@@ -9,7 +9,7 @@
declare module JQueryUI {
// Accordion //////////////////////////////////////////////////
interface AccordionOptions {
interface AccordionOptions extends AccordionEvents {
active?: any; // boolean or number
animate?: any; // boolean, number, string or object
collapsible?: boolean;
@@ -37,7 +37,7 @@ declare module JQueryUI {
create?: AccordionEvent;
}
interface Accordion extends Widget, AccordionOptions, AccordionEvents {
interface Accordion extends Widget, AccordionOptions {
}
@@ -342,7 +342,7 @@ declare module JQueryUI {
interface DialogOptions extends DialogEvents {
autoOpen?: boolean;
buttons?: { [buttonText: string]: (event?: Event) => void } | ButtonOptions[];
buttons?: { [buttonText: string]: (event?: Event) => void } | DialogButtonOptions[];
closeOnEscape?: boolean;
closeText?: string;
dialogClass?: string;
@@ -366,6 +366,14 @@ declare module JQueryUI {
close?: DialogEvent;
}
interface DialogButtonOptions {
icons?: any;
showText?: string | boolean;
text?: string;
click?: (eventObject: JQueryEventObject) => any;
[attr: string]: any; // attributes for the <button> element
}
interface DialogShowHideOptions {
effect: string;
delay?: number;
@@ -517,9 +525,10 @@ declare module JQueryUI {
// Progressbar //////////////////////////////////////////////////
interface ProgressbarOptions {
interface ProgressbarOptions extends ProgressbarEvents {
disabled?: boolean;
value?: number | boolean;
max?: number;
}
interface ProgressbarUIParams {
@@ -535,7 +544,7 @@ declare module JQueryUI {
create?: ProgressbarEvent;
}
interface Progressbar extends Widget, ProgressbarOptions, ProgressbarEvents {
interface Progressbar extends Widget, ProgressbarOptions {
}
@@ -793,7 +802,7 @@ declare module JQueryUI {
// Tooltip //////////////////////////////////////////////////
interface TooltipOptions {
interface TooltipOptions extends TooltipEvents {
content?: any; // () or string
disabled?: boolean;
hide?: any; // boolean, number, string or object
@@ -816,7 +825,7 @@ declare module JQueryUI {
open?: TooltipEvent;
}
interface Tooltip extends Widget, TooltipOptions, TooltipEvents {
interface Tooltip extends Widget, TooltipOptions {
}