diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index b03a48dc6f..0cd4c27b89 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -21,6 +21,7 @@ // John Reilly // Dick van den Brink // Thomas Schulz +// Terry Mun // Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped // TypeScript Version: 2.3 @@ -3487,7 +3488,7 @@ interface JQuery extends Iterable { * @see \`{@link https://api.jquery.com/appendTo/ }\` * @since 1.0 */ - appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + appendTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; /** * Set one or more attributes for the set of matched elements. * @@ -5078,7 +5079,7 @@ interface JQuery extends Iterable { * @see \`{@link https://api.jquery.com/prependTo/ }\` * @since 1.0 */ - prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; + prependTo(target: JQuery.Selector | JQuery.htmlString | JQuery.TypeOrArray | JQuery): this; /** * Get the immediately preceding sibling of each element in the set of matched elements. If a selector * is provided, it retrieves the previous sibling only if it matches that selector. diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 417d2e7941..3d04dca165 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -5670,6 +5670,9 @@ function JQuery() { // $ExpectType JQuery $('span').appendTo($('p')); + + // $ExpectType JQuery + $('span').appendTo(document.createDocumentFragment()); } function insertAfter() { @@ -5733,6 +5736,9 @@ function JQuery() { // $ExpectType JQuery $('span').prependTo($('p')); + + // $ExpectType JQuery + $('span').prependTo(document.createDocumentFragment()); } function clone() {