add DocumentFragement to allowed jQuery objects

This commit is contained in:
Holger Jeromin
2018-05-15 15:34:55 +02:00
parent d11cc3b1a2
commit b4fed84066
2 changed files with 5 additions and 5 deletions

View File

@@ -5565,7 +5565,7 @@ interface Iterable<T> { }
declare namespace JQuery {
type TypeOrArray<T> = 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

View File

@@ -5153,7 +5153,7 @@ function JQuery() {
function manipulation() {
function after() {
// $ExpectType JQuery<HTMLElement>
$('p').after('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]);
$('p').after('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment());
// $ExpectType JQuery<HTMLElement>
$('p').after(function(index, html) {
@@ -5218,7 +5218,7 @@ function JQuery() {
function append() {
// $ExpectType JQuery<HTMLElement>
$('p').append('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]);
$('p').append('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment());
// $ExpectType JQuery<HTMLElement>
$('p').append(function(index, html) {
@@ -5286,7 +5286,7 @@ function JQuery() {
function before() {
// $ExpectType JQuery<HTMLElement>
$('p').before('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()]);
$('p').before('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text(), $('p').contents()], document.createDocumentFragment());
// $ExpectType JQuery<HTMLElement>
$('p').before(function(index, html) {
@@ -5351,7 +5351,7 @@ function JQuery() {
function prepend() {
// $ExpectType JQuery<HTMLElement>
$('p').prepend('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()]);
$('p').prepend('<p></p>', new Element(), new Text(), $('p').contents(), [new Element(), new Text()], [new Element(), $('p').contents()], document.createDocumentFragment());
// $ExpectType JQuery<HTMLElement>
$('p').prepend(function(index, html) {