From 91524d87a7adbe6fc4549bd1f427bb389bc993aa Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 5 Dec 2013 11:13:39 +0000 Subject: [PATCH 1/2] jQuery: added when / css JSDoc Also cleaned up CSS overloads and removed unused ones. --- jquery/jquery.d.ts | 62 ++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 54 insertions(+), 8 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 95c81d9161..f35acfd596 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -507,13 +507,25 @@ interface JQueryStatic { */ noConflict(removeAll?: boolean): Object; + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ when(...deferreds: JQueryGenericPromise[]): JQueryPromise; + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ when(...deferreds: T[]): JQueryPromise; + /** + * Provides a way to execute callback functions based on one or more objects, usually Deferred objects that represent asynchronous events. + * + * @param deferreds One or more Deferred objects, or plain JavaScript objects. + */ when(...deferreds: any[]): JQueryPromise; - // CSS - css(e: any, propertyName: string, value?: any): any; - css(e: any, propertyName: any, value?: any): any; cssHooks: { [key: string]: any; }; cssNumber: any; @@ -679,12 +691,46 @@ interface JQuery { val(value: number): JQuery; val(func: (index: any, value: any) => any): JQuery; - // CSS + /** + * Get the value of style properties for the first element in the set of matched elements. + * + * @param propertyName A CSS property. + */ css(propertyName: string): string; - css(propertyNames: string[]): string; - css(properties: any): JQuery; - css(propertyName: string, value: any): JQuery; - css(propertyName: any, value: any): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: string) => string): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A function returning the value to set. this is the current element. Receives the index position of the element in the set and the old value as arguments. + */ + css(propertyName: string, value: (index: number, value: number) => number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param properties An object of property-value pairs to set. + */ + css(properties: Object): JQuery; height(): number; height(value: number): JQuery; From e630fbd17061ce8634a9823722a1cfc8a9afb88b Mon Sep 17 00:00:00 2001 From: John Reilly Date: Thu, 5 Dec 2013 13:19:25 +0000 Subject: [PATCH 2/2] jQuery: added array overloads for jQuery transit --- jquery/jquery.d.ts | 14 ++++++++++++++ 1 file changed, 14 insertions(+) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index f35acfd596..cd8f51b3ad 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -711,6 +711,20 @@ interface JQuery { * @param value A value to set for the property. */ css(propertyName: string, value: number): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: string[]): JQuery; + /** + * Set one or more CSS properties for the set of matched elements. + * + * @param propertyName A CSS property name. + * @param value A value to set for the property. + */ + css(propertyName: string, value: number[]): JQuery; /** * Set one or more CSS properties for the set of matched elements. *