Merge pull request #25795 from HolgerJeromin/documentfragment

[types/jQuery] add DocumentFragment to allowed jQuery objects
This commit is contained in:
Ron Buckton
2018-05-16 17:02:24 -07:00
committed by GitHub
2 changed files with 5 additions and 5 deletions

View File

@@ -5615,7 +5615,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

@@ -5217,7 +5217,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) {
@@ -5282,7 +5282,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) {
@@ -5350,7 +5350,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) {
@@ -5415,7 +5415,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) {