From ec3e680da4391e2fa2743290d7ae868123912ee9 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 22 Jan 2014 13:29:38 +0000 Subject: [PATCH 1/2] jQuery: JSDoc each Removed undocumented overload --- jquery/jquery.d.ts | 34 +++++++++++++++++++++++++++++----- 1 file changed, 29 insertions(+), 5 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 6be2c08e28..14e74bb303 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -863,12 +863,32 @@ interface JQueryStatic { // Properties support: JQuerySupport; - // Utilities + /** + * Check to see if a DOM element is a descendant of another DOM element. + * + * @param container The DOM element that may contain the other element. + * @param contained The DOM element that may be contained by (a descendant of) the other element. + */ contains(container: Element, contained: Element): boolean; + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ + each( + collection: T[], + callback: (indexInArray: number, valueOfElement: T) => any + ): any; + + /** + * A generic iterator function, which can be used to seamlessly iterate over both objects and arrays. Arrays and array-like objects with a length property (such as a function's arguments object) are iterated by numeric index, from 0 to length-1. Other objects are iterated via their named properties. + * + * @param collection The object or array to iterate over. + * @param callback The function that will be executed on every object. + */ each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; - each(collection: JQuery, callback: (indexInArray: number, valueOfElement: HTMLElement) => any): any; - each(collection: T[], callback: (indexInArray: number, valueOfElement: T) => any): any; extend(target: any, ...objs: any[]): any; extend(deep: boolean, target: any, ...objs: any[]): any; @@ -2479,8 +2499,12 @@ interface JQuery { wrapInner(wrappingElement: any): JQuery; wrapInner(func: (index: any) => any): JQuery; - // Miscellaneous - each(func: (index: any, elem: Element) => any): JQuery; + /** + * Iterate over a jQuery object, executing a function for each matched element. + * + * @param func A function to execute for each matched element. + */ + each(func: (index: number, elem: Element) => any): JQuery; get(index?: number): any; From f1503e8c69ad588bda3c0b74b3c328588edab9ef Mon Sep 17 00:00:00 2001 From: John Reilly Date: Wed, 22 Jan 2014 13:31:35 +0000 Subject: [PATCH 2/2] jQuery: JSDoc each and contains --- jquery/jquery.d.ts | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 14e74bb303..3c4220c153 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -888,7 +888,10 @@ interface JQueryStatic { * @param collection The object or array to iterate over. * @param callback The function that will be executed on every object. */ - each(collection: any, callback: (indexInArray: any, valueOfElement: any) => any): any; + each( + collection: any, + callback: (indexInArray: any, valueOfElement: any) => any + ): any; extend(target: any, ...objs: any[]): any; extend(deep: boolean, target: any, ...objs: any[]): any;