diff --git a/types/jquery/v2/index.d.ts b/types/jquery/v2/index.d.ts index 15709d6357..1b1d9cf75f 100644 --- a/types/jquery/v2/index.d.ts +++ b/types/jquery/v2/index.d.ts @@ -824,7 +824,7 @@ interface JQueryStatic { * @see {@link https://api.jquery.com/jQuery.ajaxTransport/} */ ajaxTransport(dataType: string, handler: (opts: any, originalOpts: JQueryAjaxSettings, jqXHR: JQueryXHR) => any): void; - + ajaxSettings: JQueryAjaxSettings; /** @@ -1403,16 +1403,6 @@ interface JQueryStatic { */ unique(array: T[]): T[]; - /** - * Parses a string into an array of DOM nodes. - * - * @param data HTML string to be parsed - * @param context DOM element to serve as the context in which the HTML fragment will be created - * @param keepScripts A Boolean indicating whether to include scripts passed in the HTML string - * @see {@link https://api.jquery.com/jQuery.parseHTML/} - */ - parseHTML(data: string, context?: HTMLElement, keepScripts?: boolean): any[]; - /** * Parses a string into an array of DOM nodes. * @@ -3286,7 +3276,7 @@ interface JQuery { * @name toArray * @see {@link https://api.jquery.com/toArray/} */ - toArray(): HTMLElement[]; + toArray(): Element[]; /** * Remove the parents of the set of matched elements from the DOM, leaving the matched elements in their place. @@ -3353,13 +3343,13 @@ interface JQuery { * @param index A zero-based integer indicating which element to retrieve. * @see {@link https://api.jquery.com/get/#get-index} */ - get(index: number): HTMLElement; + get(index: number): Element; /** * Retrieve the elements matched by the jQuery object. * @alias toArray * @see {@link https://api.jquery.com/get/#get} */ - get(): HTMLElement[]; + get(): Element[]; /** * Search for a given element from among the matched elements. diff --git a/types/jquery/v2/jquery-tests.ts b/types/jquery/v2/jquery-tests.ts index d00c075125..fa651a196f 100644 --- a/types/jquery/v2/jquery-tests.ts +++ b/types/jquery/v2/jquery-tests.ts @@ -3554,3 +3554,11 @@ function test_promise_then_not_return_deferred() { promise = promise.fail(); promise = promise.always(); } + +function test_element() { + const itemEl = $('#item')[0]; + $('li').toArray().indexOf(itemEl); + $('li').get().indexOf(itemEl); + let otherItemEl = $('li').get(0); + otherItemEl = itemEl; +}