From 8c23d04a5b4a0505df042a82be90f95adff02d87 Mon Sep 17 00:00:00 2001 From: John Reilly Date: Tue, 28 Jan 2014 13:05:54 +0000 Subject: [PATCH] jQuery: JSDoc continues removed unused merge overload / changed parseJSON return type to Object --- jquery/jquery.d.ts | 39 ++++++++++++++++++++++++++++++++++++--- 1 file changed, 36 insertions(+), 3 deletions(-) diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index 2b4268da5..91602df53 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -979,19 +979,52 @@ interface JQueryStatic { */ isXMLDoc(node: Node): boolean; + /** + * Convert an array-like object into a true JavaScript array. + * + * @param obj Any object to turn into a native Array. + */ makeArray(obj: any): any[]; + /** + * Translate all items in an array or object to new array of items. + * + * @param array The Array to translate. + * @param callback The function to process each item against. The first argument to the function is the array item, the second argument is the index in array The function can return any value. Within the function, this refers to the global (window) object. + */ map(array: T[], callback: (elementOfArray: T, indexInArray: number) => U): U[]; - map(array: any, callback: (elementOfArray: any, indexInArray: any) => any): any; + /** + * Translate all items in an array or object to new array of items. + * + * @param arrayOrObject The Array or Object to translate. + * @param callback The function to process each item against. The first argument to the function is the value; the second argument is the index or key of the array or object property. The function can return any value to add to the array. A returned array will be flattened into the resulting array. Within the function, this refers to the global (window) object. + */ + map(arrayOrObject: any, callback: (value: any, indexOrKey: any) => any): any; + /** + * Merge the contents of two arrays together into the first array. + * + * @param first The first array to merge, the elements of second added. + * @param second The second array to merge into the first, unaltered. + */ merge(first: T[], second: T[]): T[]; - merge(first: T[], second: U[]): any[]; + /** + * An empty function. + */ noop(): any; + /** + * Return a number representing the current time. + */ now(): number; - parseJSON(json: string): any; + /** + * Takes a well-formed JSON string and returns the resulting JavaScript object. + * + * @param json The JSON string to parse. + */ + parseJSON(json: string): Object; /** * Parses a string into an XML document.