mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-27 06:22:55 +08:00
Merge pull request #25795 from HolgerJeromin/documentfragment
[types/jQuery] add DocumentFragment to allowed jQuery objects
This commit is contained in:
2
types/jquery/index.d.ts
vendored
2
types/jquery/index.d.ts
vendored
@@ -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
|
||||
|
||||
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user