Skip to content

Commit 91f1fef

Browse files
committed
Fixed this return types for Phaser.GameObjects.Container
1 parent 00818a9 commit 91f1fef

2 files changed

Lines changed: 40 additions & 40 deletions

File tree

src/gameobjects/container/Container.js

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -347,7 +347,7 @@ var Container = new Class({
347347
*
348348
* @param {boolean} [value=true] - The exclusive state of this Container.
349349
*
350-
* @return {Phaser.GameObjects.Container} This Container.
350+
* @return {this} This Container.
351351
*/
352352
setExclusive: function (value)
353353
{
@@ -508,7 +508,7 @@ var Container = new Class({
508508
*
509509
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.
510510
*
511-
* @return {Phaser.GameObjects.Container} This Container instance.
511+
* @return {this} This Container instance.
512512
*/
513513
add: function (child)
514514
{
@@ -530,7 +530,7 @@ var Container = new Class({
530530
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to add to the Container.
531531
* @param {integer} [index=0] - The position to insert the Game Object/s at.
532532
*
533-
* @return {Phaser.GameObjects.Container} This Container instance.
533+
* @return {this} This Container instance.
534534
*/
535535
addAt: function (child, index)
536536
{
@@ -579,7 +579,7 @@ var Container = new Class({
579579
* @param {string} property - The property to lexically sort by.
580580
* @param {function} [handler] - Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.
581581
*
582-
* @return {Phaser.GameObjects.Container} This Container instance.
582+
* @return {this} This Container instance.
583583
*/
584584
sort: function (property, handler)
585585
{
@@ -721,7 +721,7 @@ var Container = new Class({
721721
* @param {Phaser.GameObjects.GameObject} child1 - The first Game Object to swap.
722722
* @param {Phaser.GameObjects.GameObject} child2 - The second Game Object to swap.
723723
*
724-
* @return {Phaser.GameObjects.Container} This Container instance.
724+
* @return {this} This Container instance.
725725
*/
726726
swap: function (child1, child2)
727727
{
@@ -744,7 +744,7 @@ var Container = new Class({
744744
* @param {Phaser.GameObjects.GameObject} child - The Game Object to move.
745745
* @param {integer} index - The new position of the Game Object in this Container.
746746
*
747-
* @return {Phaser.GameObjects.Container} This Container instance.
747+
* @return {this} This Container instance.
748748
*/
749749
moveTo: function (child, index)
750750
{
@@ -766,7 +766,7 @@ var Container = new Class({
766766
* @param {Phaser.GameObjects.GameObject|Phaser.GameObjects.GameObject[]} child - The Game Object, or array of Game Objects, to be removed from the Container.
767767
* @param {boolean} [destroyChild=false] - Optionally call `destroy` on each child successfully removed from this Container.
768768
*
769-
* @return {Phaser.GameObjects.Container} This Container instance.
769+
* @return {this} This Container instance.
770770
*/
771771
remove: function (child, destroyChild)
772772
{
@@ -799,7 +799,7 @@ var Container = new Class({
799799
* @param {integer} index - The index of the Game Object to be removed.
800800
* @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.
801801
*
802-
* @return {Phaser.GameObjects.Container} This Container instance.
802+
* @return {this} This Container instance.
803803
*/
804804
removeAt: function (index, destroyChild)
805805
{
@@ -825,7 +825,7 @@ var Container = new Class({
825825
* @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)
826826
* @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.
827827
*
828-
* @return {Phaser.GameObjects.Container} This Container instance.
828+
* @return {this} This Container instance.
829829
*/
830830
removeBetween: function (startIndex, endIndex, destroyChild)
831831
{
@@ -852,7 +852,7 @@ var Container = new Class({
852852
*
853853
* @param {boolean} [destroyChild=false] - Optionally call `destroy` on each Game Object successfully removed from this Container.
854854
*
855-
* @return {Phaser.GameObjects.Container} This Container instance.
855+
* @return {this} This Container instance.
856856
*/
857857
removeAll: function (destroyChild)
858858
{
@@ -878,7 +878,7 @@ var Container = new Class({
878878
*
879879
* @param {Phaser.GameObjects.GameObject} child - The Game Object to bring to the top of the Container.
880880
*
881-
* @return {Phaser.GameObjects.Container} This Container instance.
881+
* @return {this} This Container instance.
882882
*/
883883
bringToTop: function (child)
884884
{
@@ -896,7 +896,7 @@ var Container = new Class({
896896
*
897897
* @param {Phaser.GameObjects.GameObject} child - The Game Object to send to the bottom of the Container.
898898
*
899-
* @return {Phaser.GameObjects.Container} This Container instance.
899+
* @return {this} This Container instance.
900900
*/
901901
sendToBack: function (child)
902902
{
@@ -913,7 +913,7 @@ var Container = new Class({
913913
*
914914
* @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.
915915
*
916-
* @return {Phaser.GameObjects.Container} This Container instance.
916+
* @return {this} This Container instance.
917917
*/
918918
moveUp: function (child)
919919
{
@@ -930,7 +930,7 @@ var Container = new Class({
930930
*
931931
* @param {Phaser.GameObjects.GameObject} child - The Game Object to be moved in the Container.
932932
*
933-
* @return {Phaser.GameObjects.Container} This Container instance.
933+
* @return {this} This Container instance.
934934
*/
935935
moveDown: function (child)
936936
{
@@ -945,7 +945,7 @@ var Container = new Class({
945945
* @method Phaser.GameObjects.Container#reverse
946946
* @since 3.4.0
947947
*
948-
* @return {Phaser.GameObjects.Container} This Container instance.
948+
* @return {this} This Container instance.
949949
*/
950950
reverse: function ()
951951
{
@@ -960,7 +960,7 @@ var Container = new Class({
960960
* @method Phaser.GameObjects.Container#shuffle
961961
* @since 3.4.0
962962
*
963-
* @return {Phaser.GameObjects.Container} This Container instance.
963+
* @return {this} This Container instance.
964964
*/
965965
shuffle: function ()
966966
{
@@ -980,7 +980,7 @@ var Container = new Class({
980980
* @param {Phaser.GameObjects.GameObject} newChild - The Game Object to be added to this Container.
981981
* @param {boolean} [destroyChild=false] - Optionally call `destroy` on the Game Object if successfully removed from this Container.
982982
*
983-
* @return {Phaser.GameObjects.Container} This Container instance.
983+
* @return {this} This Container instance.
984984
*/
985985
replace: function (oldChild, newChild, destroyChild)
986986
{
@@ -1032,7 +1032,7 @@ var Container = new Class({
10321032
* @param {integer} [startIndex=0] - An optional start index to search from.
10331033
* @param {integer} [endIndex=Container.length] - An optional end index to search up to (but not included)
10341034
*
1035-
* @return {Phaser.GameObjects.Container} This Container instance.
1035+
* @return {this} This Container instance.
10361036
*/
10371037
setAll: function (property, value, startIndex, endIndex)
10381038
{
@@ -1065,7 +1065,7 @@ var Container = new Class({
10651065
* @param {object} [context] - Value to use as `this` when executing callback.
10661066
* @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.
10671067
*
1068-
* @return {Phaser.GameObjects.Container} This Container instance.
1068+
* @return {this} This Container instance.
10691069
*/
10701070
each: function (callback, context)
10711071
{
@@ -1102,7 +1102,7 @@ var Container = new Class({
11021102
* @param {object} [context] - Value to use as `this` when executing callback.
11031103
* @param {...*} [args] - Additional arguments that will be passed to the callback, after the child.
11041104
*
1105-
* @return {Phaser.GameObjects.Container} This Container instance.
1105+
* @return {this} This Container instance.
11061106
*/
11071107
iterate: function (callback, context)
11081108
{

types/phaser.d.ts

Lines changed: 20 additions & 20 deletions
Original file line numberDiff line numberDiff line change
@@ -12329,7 +12329,7 @@ declare namespace Phaser {
1232912329
* display list, but are being replicated where-ever this Container is.
1233012330
* @param value The exclusive state of this Container. Default true.
1233112331
*/
12332-
setExclusive(value?: boolean): Phaser.GameObjects.Container;
12332+
setExclusive(value?: boolean): this;
1233312333

1233412334
/**
1233512335
* Gets the bounds of this Container. It works by iterating all children of the Container,
@@ -12368,7 +12368,7 @@ declare namespace Phaser {
1236812368
* Each Game Object must be unique within the Container.
1236912369
* @param child The Game Object, or array of Game Objects, to add to the Container.
1237012370
*/
12371-
add(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): Phaser.GameObjects.Container;
12371+
add(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[]): this;
1237212372

1237312373
/**
1237412374
* Adds the given Game Object, or array of Game Objects, to this Container at the specified position.
@@ -12379,7 +12379,7 @@ declare namespace Phaser {
1237912379
* @param child The Game Object, or array of Game Objects, to add to the Container.
1238012380
* @param index The position to insert the Game Object/s at. Default 0.
1238112381
*/
12382-
addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: integer): Phaser.GameObjects.Container;
12382+
addAt(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], index?: integer): this;
1238312383

1238412384
/**
1238512385
* Returns the Game Object at the given position in this Container.
@@ -12399,7 +12399,7 @@ declare namespace Phaser {
1239912399
* @param property The property to lexically sort by.
1240012400
* @param handler Provide your own custom handler function. Will receive 2 children which it should compare and return a boolean.
1240112401
*/
12402-
sort(property: string, handler?: Function): Phaser.GameObjects.Container;
12402+
sort(property: string, handler?: Function): this;
1240312403

1240412404
/**
1240512405
* Searches for the first instance of a child with its `name` property matching the given argument.
@@ -12472,7 +12472,7 @@ declare namespace Phaser {
1247212472
* @param child1 The first Game Object to swap.
1247312473
* @param child2 The second Game Object to swap.
1247412474
*/
12475-
swap(child1: Phaser.GameObjects.GameObject, child2: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container;
12475+
swap(child1: Phaser.GameObjects.GameObject, child2: Phaser.GameObjects.GameObject): this;
1247612476

1247712477
/**
1247812478
* Moves a Game Object to a new position within this Container.
@@ -12484,7 +12484,7 @@ declare namespace Phaser {
1248412484
* @param child The Game Object to move.
1248512485
* @param index The new position of the Game Object in this Container.
1248612486
*/
12487-
moveTo(child: Phaser.GameObjects.GameObject, index: integer): Phaser.GameObjects.Container;
12487+
moveTo(child: Phaser.GameObjects.GameObject, index: integer): this;
1248812488

1248912489
/**
1249012490
* Removes the given Game Object, or array of Game Objects, from this Container.
@@ -12495,7 +12495,7 @@ declare namespace Phaser {
1249512495
* @param child The Game Object, or array of Game Objects, to be removed from the Container.
1249612496
* @param destroyChild Optionally call `destroy` on each child successfully removed from this Container. Default false.
1249712497
*/
12498-
remove(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], destroyChild?: boolean): Phaser.GameObjects.Container;
12498+
remove(child: Phaser.GameObjects.GameObject | Phaser.GameObjects.GameObject[], destroyChild?: boolean): this;
1249912499

1250012500
/**
1250112501
* Removes the Game Object at the given position in this Container.
@@ -12504,7 +12504,7 @@ declare namespace Phaser {
1250412504
* @param index The index of the Game Object to be removed.
1250512505
* @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false.
1250612506
*/
12507-
removeAt(index: integer, destroyChild?: boolean): Phaser.GameObjects.Container;
12507+
removeAt(index: integer, destroyChild?: boolean): this;
1250812508

1250912509
/**
1251012510
* Removes the Game Objects between the given positions in this Container.
@@ -12514,51 +12514,51 @@ declare namespace Phaser {
1251412514
* @param endIndex An optional end index to search up to (but not included) Default Container.length.
1251512515
* @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false.
1251612516
*/
12517-
removeBetween(startIndex?: integer, endIndex?: integer, destroyChild?: boolean): Phaser.GameObjects.Container;
12517+
removeBetween(startIndex?: integer, endIndex?: integer, destroyChild?: boolean): this;
1251812518

1251912519
/**
1252012520
* Removes all Game Objects from this Container.
1252112521
*
1252212522
* You can also optionally call `destroy` on each Game Object that is removed from the Container.
1252312523
* @param destroyChild Optionally call `destroy` on each Game Object successfully removed from this Container. Default false.
1252412524
*/
12525-
removeAll(destroyChild?: boolean): Phaser.GameObjects.Container;
12525+
removeAll(destroyChild?: boolean): this;
1252612526

1252712527
/**
1252812528
* Brings the given Game Object to the top of this Container.
1252912529
* This will cause it to render on-top of any other objects in the Container.
1253012530
* @param child The Game Object to bring to the top of the Container.
1253112531
*/
12532-
bringToTop(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container;
12532+
bringToTop(child: Phaser.GameObjects.GameObject): this;
1253312533

1253412534
/**
1253512535
* Sends the given Game Object to the bottom of this Container.
1253612536
* This will cause it to render below any other objects in the Container.
1253712537
* @param child The Game Object to send to the bottom of the Container.
1253812538
*/
12539-
sendToBack(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container;
12539+
sendToBack(child: Phaser.GameObjects.GameObject): this;
1254012540

1254112541
/**
1254212542
* Moves the given Game Object up one place in this Container, unless it's already at the top.
1254312543
* @param child The Game Object to be moved in the Container.
1254412544
*/
12545-
moveUp(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container;
12545+
moveUp(child: Phaser.GameObjects.GameObject): this;
1254612546

1254712547
/**
1254812548
* Moves the given Game Object down one place in this Container, unless it's already at the bottom.
1254912549
* @param child The Game Object to be moved in the Container.
1255012550
*/
12551-
moveDown(child: Phaser.GameObjects.GameObject): Phaser.GameObjects.Container;
12551+
moveDown(child: Phaser.GameObjects.GameObject): this;
1255212552

1255312553
/**
1255412554
* Reverses the order of all Game Objects in this Container.
1255512555
*/
12556-
reverse(): Phaser.GameObjects.Container;
12556+
reverse(): this;
1255712557

1255812558
/**
1255912559
* Shuffles the all Game Objects in this Container using the Fisher-Yates implementation.
1256012560
*/
12561-
shuffle(): Phaser.GameObjects.Container;
12561+
shuffle(): this;
1256212562

1256312563
/**
1256412564
* Replaces a Game Object in this Container with the new Game Object.
@@ -12567,7 +12567,7 @@ declare namespace Phaser {
1256712567
* @param newChild The Game Object to be added to this Container.
1256812568
* @param destroyChild Optionally call `destroy` on the Game Object if successfully removed from this Container. Default false.
1256912569
*/
12570-
replace(oldChild: Phaser.GameObjects.GameObject, newChild: Phaser.GameObjects.GameObject, destroyChild?: boolean): Phaser.GameObjects.Container;
12570+
replace(oldChild: Phaser.GameObjects.GameObject, newChild: Phaser.GameObjects.GameObject, destroyChild?: boolean): this;
1257112571

1257212572
/**
1257312573
* Returns `true` if the given Game Object is a direct child of this Container.
@@ -12588,7 +12588,7 @@ declare namespace Phaser {
1258812588
* @param startIndex An optional start index to search from. Default 0.
1258912589
* @param endIndex An optional end index to search up to (but not included) Default Container.length.
1259012590
*/
12591-
setAll(property: string, value: any, startIndex?: integer, endIndex?: integer): Phaser.GameObjects.Container;
12591+
setAll(property: string, value: any, startIndex?: integer, endIndex?: integer): this;
1259212592

1259312593
/**
1259412594
* Passes all Game Objects in this Container to the given callback.
@@ -12602,7 +12602,7 @@ declare namespace Phaser {
1260212602
* @param context Value to use as `this` when executing callback.
1260312603
* @param args Additional arguments that will be passed to the callback, after the child.
1260412604
*/
12605-
each(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container;
12605+
each(callback: Function, context?: object, ...args: any[]): this;
1260612606

1260712607
/**
1260812608
* Passes all Game Objects in this Container to the given callback.
@@ -12613,7 +12613,7 @@ declare namespace Phaser {
1261312613
* @param context Value to use as `this` when executing callback.
1261412614
* @param args Additional arguments that will be passed to the callback, after the child.
1261512615
*/
12616-
iterate(callback: Function, context?: object, ...args: any[]): Phaser.GameObjects.Container;
12616+
iterate(callback: Function, context?: object, ...args: any[]): this;
1261712617

1261812618
/**
1261912619
* Sets the scroll factor of this Container and optionally all of its children.

0 commit comments

Comments
 (0)