Merge pull request #1534 from johnnyreilly/master

jQuery: fadeIn / fadeOut / animate JSDoc'd
This commit is contained in:
John Reilly
2014-01-13 04:59:48 -08:00
+160 -8
View File
@@ -356,6 +356,53 @@ interface JQueryCoordinates {
top: number;
}
interface JQueryAnimationOptions {
/**
* A string or number determining how long the animation will run.
*/
duration?: any;
/**
* A string indicating which easing function to use for the transition.
*/
easing?: string;
/**
* A function to call once the animation is complete.
*/
complete?: Function;
/**
* A function to be called for each animated property of each animated element. This function provides an opportunity to modify the Tween object to change the value of the property before it is set.
*/
step?: (now: number, tween: any) => any;
/**
* A function to be called after each step of the animation, only once per animated element regardless of the number of animated properties. (version added: 1.8)
*/
progress?: (animation: JQueryPromise<any>, progress: number, remainingMs: number) => any;
/**
* A function to call when the animation begins. (version added: 1.8)
*/
start?: (animation: JQueryPromise<any>) => any;
/**
* A function to be called when the animation completes (its Promise object is resolved). (version added: 1.8)
*/
done?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* A function to be called when the animation fails to complete (its Promise object is rejected). (version added: 1.8)
*/
fail?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* A function to be called when the animation completes or stops without completing (its Promise object is either resolved or rejected). (version added: 1.8)
*/
always?: (animation: JQueryPromise<any>, jumpedToEnd: boolean) => any;
/**
* A Boolean indicating whether to place the animation in the effects queue. If false, the animation will begin immediately. As of jQuery 1.7, the queue option can also accept a string, in which case the animation is added to the queue represented by that string. When a custom queue name is used the animation does not automatically start; you must call .dequeue("queuename") to start it.
*/
queue?: any;
/**
* A map of one or more of the CSS properties defined by the properties argument and their corresponding easing functions. (version added: 1.4)
*/
specialEasing?: Object;
}
/**
* The interface used to specify easing functions.
*/
@@ -1189,18 +1236,123 @@ interface JQuery {
*/
promise(type?: string, target?: Object): JQueryPromise<any>;
// Effects
animate(properties: any, duration?: any, complete?: Function): JQuery;
animate(properties: any, duration?: any, easing?: string, complete?: Function): JQuery;
animate(properties: any, options: { duration?: any; easing?: string; complete?: Function; step?: Function; queue?: boolean; specialEasing?: any; }): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: string, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: number, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition. (default: swing)
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: string, easing?: string, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition. (default: swing)
* @param complete A function to call once the animation is complete.
*/
animate(properties: Object, duration?: number, easing?: string, complete?: Function): JQuery;
/**
* Perform a custom animation of a set of CSS properties.
*
* @param properties An object of CSS properties and values that the animation will move toward.
* @param options A map of additional options to pass to the method.
*/
animate(properties: Object, options: JQueryAnimationOptions): JQuery;
delay(duration: number, queueName?: string): JQuery;
fadeIn(duration?: any, callback?: any): JQuery;
fadeIn(duration?: any, easing?: string, callback?: any): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: number, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: string, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: number, easing?: string, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeIn(duration?: string, easing?: string, complete?: Function): JQuery;
/**
* Display the matched elements by fading them to opaque.
*
* @param options A map of additional options to pass to the method.
*/
fadeIn(options: JQueryAnimationOptions): JQuery;
fadeOut(duration?: any, callback?: any): JQuery;
fadeOut(duration?: any, easing?: string, callback?: any): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: number, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: string, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: number, easing?: string, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param duration A string or number determining how long the animation will run.
* @param easing A string indicating which easing function to use for the transition.
* @param complete A function to call once the animation is complete.
*/
fadeOut(duration?: string, easing?: string, complete?: Function): JQuery;
/**
* Hide the matched elements by fading them to transparent.
*
* @param options A map of additional options to pass to the method.
*/
fadeOut(options: JQueryAnimationOptions): JQuery;
fadeTo(duration: any, opacity: number, callback?: any): JQuery;
fadeTo(duration: any, opacity: number, easing?: string, callback?: any): JQuery;