types: JSDoc for Phaser.Input.Gamepad.Configs

This commit is contained in:
Sylvain Pollet-Villard 2021-07-08 23:53:58 +02:00
parent bdd22ac171
commit dca5346573
4 changed files with 761 additions and 65 deletions

View file

@ -9,25 +9,129 @@
* USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011) * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011)
* *
* @name Phaser.Input.Gamepad.Configs.SNES_USB * @name Phaser.Input.Gamepad.Configs.SNES_USB
* @type {object} * @namespace
* @since 3.0.0 * @since 3.0.0
*/ */
module.exports = { module.exports = {
/**
* D-Pad up
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.UP
* @const
* @type {number}
* @since 3.0.0
*/
UP: 12, UP: 12,
/**
* D-Pad down
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.DOWN
* @const
* @type {number}
* @since 3.0.0
*/
DOWN: 13, DOWN: 13,
/**
* D-Pad left
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT
* @const
* @type {number}
* @since 3.0.0
*/
LEFT: 14, LEFT: 14,
/**
* D-Pad right
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT: 15, RIGHT: 15,
/**
* Select button
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.SELECT
* @const
* @type {number}
* @since 3.0.0
*/
SELECT: 8, SELECT: 8,
/**
* Start button
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.START
* @const
* @type {number}
* @since 3.0.0
*/
START: 9, START: 9,
/**
* B Button (Bottom)
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.B
* @const
* @type {number}
* @since 3.0.0
*/
B: 0, B: 0,
/**
* A Button (Right)
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.A
* @const
* @type {number}
* @since 3.0.0
*/
A: 1, A: 1,
/**
* Y Button (Left)
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.Y
* @const
* @type {number}
* @since 3.0.0
*/
Y: 2, Y: 2,
/**
* X Button (Top)
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.X
* @const
* @type {number}
* @since 3.0.0
*/
X: 3, X: 3,
/**
* Left bumper
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.LEFT_SHOULDER
* @const
* @type {number}
* @since 3.0.0
*/
LEFT_SHOULDER: 4, LEFT_SHOULDER: 4,
/**
* Right bumper
*
* @name Phaser.Input.Gamepad.Configs.SNES_USB.RIGHT_SHOULDER
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT_SHOULDER: 5 RIGHT_SHOULDER: 5
}; };

View file

@ -9,36 +9,229 @@
* Sony PlayStation DualShock 4 (v2) wireless controller * Sony PlayStation DualShock 4 (v2) wireless controller
* *
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4 * @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4
* @type {object} * @namespace
* @since 3.0.0 * @since 3.0.0
*/ */
module.exports = { module.exports = {
/**
* D-Pad up
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.UP
* @const
* @type {number}
* @since 3.0.0
*/
UP: 12, UP: 12,
/**
* D-Pad down
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.DOWN
* @const
* @type {number}
* @since 3.0.0
*/
DOWN: 13, DOWN: 13,
/**
* D-Pad left
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT
* @const
* @type {number}
* @since 3.0.0
*/
LEFT: 14, LEFT: 14,
/**
* D-Pad up
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT: 15, RIGHT: 15,
/**
* Share button
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SHARE
* @const
* @type {number}
* @since 3.0.0
*/
SHARE: 8, SHARE: 8,
/**
* Options button
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.OPTIONS
* @const
* @type {number}
* @since 3.0.0
*/
OPTIONS: 9, OPTIONS: 9,
/**
* PlayStation logo button
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.PS
* @const
* @type {number}
* @since 3.0.0
*/
PS: 16, PS: 16,
/**
* Touchpad click
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TOUCHBAR
* @const
* @type {number}
* @since 3.0.0
*/
TOUCHBAR: 17, TOUCHBAR: 17,
/**
* Cross button (Bottom)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.X
* @const
* @type {number}
* @since 3.0.0
*/
X: 0, X: 0,
/**
* Circle button (Right)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.CIRCLE
* @const
* @type {number}
* @since 3.0.0
*/
CIRCLE: 1, CIRCLE: 1,
/**
* Square button (Left)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.SQUARE
* @const
* @type {number}
* @since 3.0.0
*/
SQUARE: 2, SQUARE: 2,
/**
* Triangle button (Top)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.TRIANGLE
* @const
* @type {number}
* @since 3.0.0
*/
TRIANGLE: 3, TRIANGLE: 3,
/**
* Left bumper (L1)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L1
* @const
* @type {number}
* @since 3.0.0
*/
L1: 4, L1: 4,
/**
* Right bumper (R1)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R1
* @const
* @type {number}
* @since 3.0.0
*/
R1: 5, R1: 5,
/**
* Left trigger (L2)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L2
* @const
* @type {number}
* @since 3.0.0
*/
L2: 6, L2: 6,
/**
* Right trigger (R2)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R2
* @const
* @type {number}
* @since 3.0.0
*/
R2: 7, R2: 7,
/**
* Left stick click (L3)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.L3
* @const
* @type {number}
* @since 3.0.0
*/
L3: 10, L3: 10,
/**
* Right stick click (R3)
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.R3
* @const
* @type {number}
* @since 3.0.0
*/
R3: 11, R3: 11,
/**
* Left stick horizontal
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_H
* @const
* @type {number}
* @since 3.0.0
*/
LEFT_STICK_H: 0, LEFT_STICK_H: 0,
/**
* Left stick vertical
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.LEFT_STICK_V
* @const
* @type {number}
* @since 3.0.0
*/
LEFT_STICK_V: 1, LEFT_STICK_V: 1,
/**
* Right stick horizontal
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_H
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT_STICK_H: 2, RIGHT_STICK_H: 2,
/**
* Right stick vertical
*
* @name Phaser.Input.Gamepad.Configs.DUALSHOCK_4.RIGHT_STICK_V
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT_STICK_V: 3 RIGHT_STICK_V: 3
}; };

View file

@ -8,38 +8,219 @@
* XBox 360 Gamepad Configuration. * XBox 360 Gamepad Configuration.
* *
* @name Phaser.Input.Gamepad.Configs.XBOX_360 * @name Phaser.Input.Gamepad.Configs.XBOX_360
* @type {object} * @namespace
* @since 3.0.0 * @since 3.0.0
*/ */
module.exports = { module.exports = {
/**
* D-Pad up
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.UP
* @const
* @type {number}
* @since 3.0.0
*/
UP: 12, UP: 12,
/**
* D-Pad down
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.DOWN
* @const
* @type {number}
* @since 3.0.0
*/
DOWN: 13, DOWN: 13,
/**
* D-Pad left
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT
* @const
* @type {number}
* @since 3.0.0
*/
LEFT: 14, LEFT: 14,
/**
* D-Pad right
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT: 15, RIGHT: 15,
/**
* XBox menu button
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.MENU
* @const
* @type {number}
* @since 3.0.0
*/
MENU: 16, MENU: 16,
/**
* A button (Bottom)
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.A
* @const
* @type {number}
* @since 3.0.0
*/
A: 0, A: 0,
/**
* B button (Right)
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.B
* @const
* @type {number}
* @since 3.0.0
*/
B: 1, B: 1,
/**
* X button (Left)
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.X
* @const
* @type {number}
* @since 3.0.0
*/
X: 2, X: 2,
/**
* Y button (Top)
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.Y
* @const
* @type {number}
* @since 3.0.0
*/
Y: 3, Y: 3,
/**
* Left Bumper
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LB
* @const
* @type {number}
* @since 3.0.0
*/
LB: 4, LB: 4,
/**
* Right Bumper
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RB
* @const
* @type {number}
* @since 3.0.0
*/
RB: 5, RB: 5,
/**
* Left Trigger
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LT
* @const
* @type {number}
* @since 3.0.0
*/
LT: 6, LT: 6,
/**
* Right Trigger
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RT
* @const
* @type {number}
* @since 3.0.0
*/
RT: 7, RT: 7,
/**
* Back / Change View button
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.BACK
* @const
* @type {number}
* @since 3.0.0
*/
BACK: 8, BACK: 8,
/**
* Start button
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.START
* @const
* @type {number}
* @since 3.0.0
*/
START: 9, START: 9,
/**
* Left Stick press
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LS
* @const
* @type {number}
* @since 3.0.0
*/
LS: 10, LS: 10,
/**
* Right stick press
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RS
* @const
* @type {number}
* @since 3.0.0
*/
RS: 11, RS: 11,
/**
* Left Stick horizontal
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_H
* @const
* @type {number}
* @since 3.0.0
*/
LEFT_STICK_H: 0, LEFT_STICK_H: 0,
/**
* Left Stick vertical
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.LEFT_STICK_V
* @const
* @type {number}
* @since 3.0.0
*/
LEFT_STICK_V: 1, LEFT_STICK_V: 1,
/**
* Right Stick horizontal
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_H
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT_STICK_H: 2, RIGHT_STICK_H: 2,
/**
* Right Stick vertical
*
* @name Phaser.Input.Gamepad.Configs.XBOX_360.RIGHT_STICK_V
* @const
* @type {number}
* @since 3.0.0
*/
RIGHT_STICK_V: 3 RIGHT_STICK_V: 3
}; };

342
types/phaser.d.ts vendored
View file

@ -5544,7 +5544,7 @@ declare namespace Phaser {
/** /**
* Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas? * Should the DOM Container that is created (if `dom.createContainer` is true) be positioned behind (true) or over the top (false, the default) of the game canvas?
*/ */
readonly domBehindCanvas: boolean; readonly domBehindCanvas: boolean;
/** /**
* The default `pointerEvents` attribute set on the DOM Container. * The default `pointerEvents` attribute set on the DOM Container.
@ -21887,6 +21887,20 @@ declare namespace Phaser {
*/ */
intensity: number; intensity: number;
/**
* The flags that are compared against `RENDER_MASK` to determine if this Game Object will render or not.
* The bits are 0001 | 0010 | 0100 | 1000 set by the components Visible, Alpha, Transform and Texture respectively.
* If those components are not used by your custom class then you can use this bitmask as you wish.
*/
renderFlags: number;
/**
* A bitmask that controls if this Game Object is drawn by a Camera or not.
* Not usually set directly, instead call `Camera.ignore`, however you can
* set this property directly using the Camera.id property:
*/
cameraFilter: number;
/** /**
* Compares the renderMask with the renderFlags to see if this Game Object will render or not. * Compares the renderMask with the renderFlags to see if this Game Object will render or not.
* Also checks the Game Object against the given Cameras exclusion list. * Also checks the Game Object against the given Cameras exclusion list.
@ -49028,96 +49042,296 @@ declare namespace Phaser {
* Tatar SNES USB Controller Gamepad Configuration. * Tatar SNES USB Controller Gamepad Configuration.
* USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011) * USB Gamepad (STANDARD GAMEPAD Vendor: 0079 Product: 0011)
*/ */
var SNES_USB: { namespace SNES_USB {
/**
* D-Pad up
*/
const UP: number;
UP: number; /**
DOWN: number; * D-Pad down
LEFT: number; */
RIGHT: number; const DOWN: number;
SELECT: number; /**
START: number; * D-Pad left
*/
const LEFT: number;
B: number; /**
A: number; * D-Pad right
Y: number; */
X: number; const RIGHT: number;
LEFT_SHOULDER: number; /**
RIGHT_SHOULDER: number; * Select button
*/
const SELECT: number;
}; /**
* Start button
*/
const START: number;
/**
* B Button (Bottom)
*/
const B: number;
/**
* A Button (Right)
*/
const A: number;
/**
* Y Button (Left)
*/
const Y: number;
/**
* X Button (Top)
*/
const X: number;
/**
* Left bumper
*/
const LEFT_SHOULDER: number;
/**
* Right bumper
*/
const RIGHT_SHOULDER: number;
}
/** /**
* PlayStation DualShock 4 Gamepad Configuration. * PlayStation DualShock 4 Gamepad Configuration.
* Sony PlayStation DualShock 4 (v2) wireless controller * Sony PlayStation DualShock 4 (v2) wireless controller
*/ */
var DUALSHOCK_4: { namespace DUALSHOCK_4 {
/**
* D-Pad up
*/
const UP: number;
UP: number; /**
DOWN: number; * D-Pad down
LEFT: number; */
RIGHT: number; const DOWN: number;
SHARE: number; /**
OPTIONS: number; * D-Pad left
PS: number; */
TOUCHBAR: number; const LEFT: number;
X: number; /**
CIRCLE: number; * D-Pad up
SQUARE: number; */
TRIANGLE: number; const RIGHT: number;
L1: number; /**
R1: number; * Share button
L2: number; */
R2: number; const SHARE: number;
L3: number;
R3: number;
LEFT_STICK_H: number; /**
LEFT_STICK_V: number; * Options button
RIGHT_STICK_H: number; */
RIGHT_STICK_V: number; const OPTIONS: number;
}; /**
* PlayStation logo button
*/
const PS: number;
/**
* Touchpad click
*/
const TOUCHBAR: number;
/**
* Cross button (Bottom)
*/
const X: number;
/**
* Circle button (Right)
*/
const CIRCLE: number;
/**
* Square button (Left)
*/
const SQUARE: number;
/**
* Triangle button (Top)
*/
const TRIANGLE: number;
/**
* Left bumper (L1)
*/
const L1: number;
/**
* Right bumper (R1)
*/
const R1: number;
/**
* Left trigger (L2)
*/
const L2: number;
/**
* Right trigger (R2)
*/
const R2: number;
/**
* Left stick click (L3)
*/
const L3: number;
/**
* Right stick click (R3)
*/
const R3: number;
/**
* Left stick horizontal
*/
const LEFT_STICK_H: number;
/**
* Left stick vertical
*/
const LEFT_STICK_V: number;
/**
* Right stick horizontal
*/
const RIGHT_STICK_H: number;
/**
* Right stick vertical
*/
const RIGHT_STICK_V: number;
}
/** /**
* XBox 360 Gamepad Configuration. * XBox 360 Gamepad Configuration.
*/ */
var XBOX_360: { namespace XBOX_360 {
/**
* D-Pad up
*/
const UP: number;
UP: number; /**
DOWN: number; * D-Pad down
LEFT: number; */
RIGHT: number; const DOWN: number;
MENU: number; /**
* D-Pad left
*/
const LEFT: number;
A: number; /**
B: number; * D-Pad right
X: number; */
Y: number; const RIGHT: number;
LB: number; /**
RB: number; * XBox menu button
*/
const MENU: number;
LT: number; /**
RT: number; * A button (Bottom)
*/
const A: number;
BACK: number; /**
START: number; * B button (Right)
*/
const B: number;
LS: number; /**
RS: number; * X button (Left)
*/
const X: number;
LEFT_STICK_H: number; /**
LEFT_STICK_V: number; * Y button (Top)
RIGHT_STICK_H: number; */
RIGHT_STICK_V: number; const Y: number;
}; /**
* Left Bumper
*/
const LB: number;
/**
* Right Bumper
*/
const RB: number;
/**
* Left Trigger
*/
const LT: number;
/**
* Right Trigger
*/
const RT: number;
/**
* Back / Change View button
*/
const BACK: number;
/**
* Start button
*/
const START: number;
/**
* Left Stick press
*/
const LS: number;
/**
* Right stick press
*/
const RS: number;
/**
* Left Stick horizontal
*/
const LEFT_STICK_H: number;
/**
* Left Stick vertical
*/
const LEFT_STICK_V: number;
/**
* Right Stick horizontal
*/
const RIGHT_STICK_H: number;
/**
* Right Stick vertical
*/
const RIGHT_STICK_V: number;
}
} }
@ -95619,6 +95833,8 @@ declare namespace Phaser {
* A Tween is able to manipulate the properties of one or more objects to any given value, based * A Tween is able to manipulate the properties of one or more objects to any given value, based
* on a duration and type of ease. They are rarely instantiated directly and instead should be * on a duration and type of ease. They are rarely instantiated directly and instead should be
* created via the TweenManager. * created via the TweenManager.
*
* Please note that a Tween will not manipulate any property that begins with an underscore.
*/ */
class Tween extends Phaser.Events.EventEmitter { class Tween extends Phaser.Events.EventEmitter {
/** /**
@ -96074,6 +96290,8 @@ declare namespace Phaser {
/** /**
* Create a Tween and add it to the active Tween list. * Create a Tween and add it to the active Tween list.
*
* Please note that a Tween will not manipulate any property that begins with an underscore.
* @param config The configuration object for the Tween. * @param config The configuration object for the Tween.
*/ */
add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween; add(config: Phaser.Types.Tweens.TweenBuilderConfig | object): Phaser.Tweens.Tween;