diff --git a/types/jquery/index.d.ts b/types/jquery/index.d.ts index be4b2f2346..b0838f9a8d 100644 --- a/types/jquery/index.d.ts +++ b/types/jquery/index.d.ts @@ -5615,7 +5615,7 @@ interface Iterable { } declare namespace JQuery { type TypeOrArray = T | T[]; - type Node = Element | Text | Comment; + type Node = Element | Text | Comment | DocumentFragment; /** * A string is designated htmlString in jQuery documentation when it is used to represent one or more diff --git a/types/jquery/jquery-tests.ts b/types/jquery/jquery-tests.ts index 0cceb359b5..47a85b80d2 100644 --- a/types/jquery/jquery-tests.ts +++ b/types/jquery/jquery-tests.ts @@ -5217,7 +5217,7 @@ function JQuery() { function manipulation() { function after() { // $ExpectType JQuery - $('p').after('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').after('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').after(function(index, html) { @@ -5282,7 +5282,7 @@ function JQuery() { function append() { // $ExpectType JQuery - $('p').append('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').append('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').append(function(index, html) { @@ -5350,7 +5350,7 @@ function JQuery() { function before() { // $ExpectType JQuery - $('p').before('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]); + $('p').before('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').before(function(index, html) { @@ -5415,7 +5415,7 @@ function JQuery() { function prepend() { // $ExpectType JQuery - $('p').prepend('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()]); + $('p').prepend('

', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()], document.createDocumentFragment()); // $ExpectType JQuery $('p').prepend(function(index, html) {