diff --git a/jquery/jquery.d.ts b/jquery/jquery.d.ts index f53bb07a98..52f09f8dab 100644 --- a/jquery/jquery.d.ts +++ b/jquery/jquery.d.ts @@ -1259,7 +1259,7 @@ interface JQuery { * @param attributeName The name of the attribute to set. * @param func 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 attribute value as arguments. */ - attr(attributeName: string, func: (index: number, attr: any) => any): JQuery; + attr(attributeName: string, func: (index: number, attr: string) => string|number): JQuery; /** * Set one or more attributes for the set of matched elements. * @@ -2587,7 +2587,7 @@ interface JQuery { * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert after each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - after(func: (index: number) => any): JQuery; + after(func: (index: number) => string|Element|JQuery): JQuery; /** * Insert content, specified by the parameter, to the end of each element in the set of matched elements. @@ -2601,7 +2601,7 @@ interface JQuery { * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the end of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ - append(func: (index: number, html: string) => any): JQuery; + append(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the end of the target. @@ -2622,7 +2622,7 @@ interface JQuery { * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert before each element in the set of matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - before(func: (index: number) => any): JQuery; + before(func: (index: number) => string|Element|JQuery): JQuery; /** * Create a deep copy of the set of matched elements. @@ -2670,7 +2670,7 @@ interface JQuery { * * param func A function that returns an HTML string, DOM element(s), or jQuery object to insert at the beginning of each element in the set of matched elements. Receives the index position of the element in the set and the old HTML value of the element as arguments. Within the function, this refers to the current element in the set. */ - prepend(func: (index: number, html: string) => any): JQuery; + prepend(func: (index: number, html: string) => string|Element|JQuery): JQuery; /** * Insert every element in the set of matched elements to the beginning of the target. @@ -2704,7 +2704,7 @@ interface JQuery { * * param func A function that returns content with which to replace the set of matched elements. */ - replaceWith(func: () => any): JQuery; + replaceWith(func: () => Element|JQuery): JQuery; /** * Get the combined text contents of each element in the set of matched elements, including their descendants. @@ -2744,7 +2744,7 @@ interface JQuery { * * @param func A callback function returning the HTML content or jQuery object to wrap around the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - wrap(func: (index: number) => any): JQuery; + wrap(func: (index: number) => string|JQuery): JQuery; /** * Wrap an HTML structure around all elements in the set of matched elements. @@ -2752,6 +2752,7 @@ interface JQuery { * @param wrappingElement A selector, element, HTML string, or jQuery object specifying the structure to wrap around the matched elements. */ wrapAll(wrappingElement: JQuery|Element|string): JQuery; + wrapAll(func: (index: number) => string): JQuery; /** * Wrap an HTML structure around the content of each element in the set of matched elements. @@ -2764,7 +2765,7 @@ interface JQuery { * * @param func A callback function which generates a structure to wrap around the content of the matched elements. Receives the index position of the element in the set as an argument. Within the function, this refers to the current element in the set. */ - wrapInner(func: (index: number) => any): JQuery; + wrapInner(func: (index: number) => string): JQuery; /** * Iterate over a jQuery object, executing a function for each matched element. @@ -2965,7 +2966,7 @@ interface JQuery { * * @param func A function used as a test for the set of elements. It accepts one argument, index, which is the element's index in the jQuery collection.Within the function, this refers to the current DOM element. */ - is(func: (index: number) => any): boolean; + is(func: (index: number, element: Element) => boolean): boolean; /** * Check the current matched set of elements against a selector, element, or jQuery object and return true if at least one of these elements matches the given arguments. * @@ -3038,7 +3039,7 @@ interface JQuery { * * @param func A function used as a test for each element in the set. this is the current DOM element. */ - not(func: (index: number) => any): JQuery; + not(func: (index: number, element: Element) => boolean): JQuery; /** * Remove elements from the set of matched elements. *