diff options
author | Noxalus <noxalus@gmail.com> | 2014-03-06 15:30:10 +0100 |
---|---|---|
committer | Noxalus <noxalus@gmail.com> | 2014-03-06 15:30:10 +0100 |
commit | 4d2cd238c9b10fed2a576ae452b76309f2d99388 (patch) | |
tree | 5d7fe6a24be37bff098104368b2060a8dc3a2e63 /src | |
parent | 6960d2296299e96d43e694806f5d35799ef8d39c (diff) |
Update closure-externs.js
Add a gamepad support with closure.
Diffstat (limited to 'src')
-rw-r--r-- | src/closure-externs.js | 60 |
1 files changed, 60 insertions, 0 deletions
diff --git a/src/closure-externs.js b/src/closure-externs.js index a82aa669..fe6d84aa 100644 --- a/src/closure-externs.js +++ b/src/closure-externs.js @@ -108,3 +108,63 @@ var flags = {}; flags.binary; +/** + * @fileoverview Definitions for W3C's Gamepad specification. + * @see http://www.w3.org/TR/gamepad/ + * @externs + */ + +/** + * @typedef {{id: string, index: number, timestamp: number, axes: Array.<number>, buttons: Array.<number>}} + */ +var Gamepad; + +/** +* @type {Array.<number>} +*/ +Gamepad.buttons; + +/** +* @type {Array.<number>} +*/ +Gamepad.axes; + +/** +* @type {number} +*/ +Gamepad.index; + +/** +* @type {string} +*/ +Gamepad.id; + +/** +* @type {number} +*/ +Gamepad.timestamp; + +/** + * @return {Array.<Gamepad>} + */ +navigator.getGamepads = function() {}; + +/** + * @return {Array.<Gamepad>} + */ +navigator.webkitGetGamepads = function() {}; + +/** + * @return {Array.<Gamepad>} + */ +navigator.webkitGamepads = function() {}; + +/** + * @return {Array.<Gamepad>} + */ +navigator.mozGamepads = function() {}; + +/** + * @return {Array.<Gamepad>} + */ +navigator.gamepads = function() {}; |