mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-04 23:07:06 +00:00
[jquery] Add self-extending overloads of jQuery.extend(). (#29924)
This commit is contained in:
committed by
Sheetal Nandi
parent
daa2f21886
commit
59b32e5353
Vendored
+16
@@ -940,6 +940,14 @@ $( "#log" ).append( JSON.stringify( object1 ) );
|
||||
```
|
||||
*/
|
||||
extend<T, U>(deep: true, target: T, object1: U): T & U;
|
||||
/**
|
||||
* Merge the contents of two or more objects together into the first object.
|
||||
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
|
||||
* @param target The object to extend. It will receive the new properties.
|
||||
* @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
|
||||
* @since 1.1.4
|
||||
*/
|
||||
extend<T>(deep: true, target: T): this & T;
|
||||
/**
|
||||
* Merge the contents of two or more objects together into the first object.
|
||||
* @param deep If true, the merge becomes recursive (aka. deep copy). Passing false for this argument is not supported.
|
||||
@@ -1431,6 +1439,14 @@ $( "#log" ).append( "<div><b>settings -- </b>" + JSON.stringify( settings ) + "<
|
||||
```
|
||||
*/
|
||||
extend<T, U>(target: T, object1: U): T & U;
|
||||
/**
|
||||
* Merge the contents of two or more objects together into the first object.
|
||||
* @param target An object that will receive the new properties if additional objects are passed in or that will
|
||||
* extend the jQuery namespace if it is the sole argument.
|
||||
* @see \`{@link https://api.jquery.com/jQuery.extend/ }\`
|
||||
* @since 1.0
|
||||
*/
|
||||
extend<T>(target: T): this & T;
|
||||
/**
|
||||
* Merge the contents of two or more objects together into the first object.
|
||||
* @param target An object that will receive the new properties if additional objects are passed in or that will
|
||||
|
||||
@@ -463,6 +463,9 @@ function JQueryStatic() {
|
||||
// $ExpectType { name: string; } & EventTarget
|
||||
$.extend(true, t, u);
|
||||
|
||||
// $ExpectType JQueryStatic & { name: string; }
|
||||
$.extend(true, t);
|
||||
|
||||
// $ExpectType any
|
||||
$.extend(true, t, u, v, w, x, y, z, a);
|
||||
|
||||
@@ -484,6 +487,9 @@ function JQueryStatic() {
|
||||
// $ExpectType { name: string; } & EventTarget
|
||||
$.extend(t, u);
|
||||
|
||||
// $ExpectType JQueryStatic & { name: string; }
|
||||
$.extend(t);
|
||||
|
||||
// $ExpectType any
|
||||
$.extend(t, u, v, w, x, y, z, a);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user