Added XHRSettings Conf

This commit is contained in:
Richard Davey 2018-03-21 14:41:04 +00:00
parent f500f5509b
commit 13f5608cbe
26 changed files with 51 additions and 41 deletions

View file

@ -89,7 +89,7 @@ var File = new Class({
* The merged XHRSettings for this file. * The merged XHRSettings for this file.
* *
* @name Phaser.Loader.File#xhrSettings * @name Phaser.Loader.File#xhrSettings
* @type {Phaser.Loader.XHRSettings} * @type {Phaser.Loader.XHRSettingsConfig}
* @since 3.0.0 * @since 3.0.0
*/ */
this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined)); this.xhrSettings = XHRSettings(GetFastValue(fileConfig, 'responseType', undefined));
@ -109,10 +109,10 @@ var File = new Class({
this.loader = null; this.loader = null;
/** /**
* The XHR Loader instance that is loading this File. * The XHR Loader function that is loading this File.
* *
* @name Phaser.Loader.File#xhrLoader * @name Phaser.Loader.File#xhrLoader
* @type {?Phaser.Loader.XHRLoader} * @type {?function}
* @since 3.0.0 * @since 3.0.0
*/ */
this.xhrLoader = null; this.xhrLoader = null;
@ -404,7 +404,7 @@ var File = new Class({
* *
* @method Phaser.Loader.File.createObjectURL * @method Phaser.Loader.File.createObjectURL
* @static * @static
* @param {Image} image - Image object which 'src' attribute should be set to object URL. * @param {HTMLImageElement} image - Image object which 'src' attribute should be set to object URL.
* @param {Blob} blob - A Blob object to create an object URL for. * @param {Blob} blob - A Blob object to create an object URL for.
* @param {string} defaultType - Default mime type used if blob type is not available. * @param {string} defaultType - Default mime type used if blob type is not available.
*/ */
@ -436,7 +436,7 @@ File.createObjectURL = function (image, blob, defaultType)
* *
* @method Phaser.Loader.File.revokeObjectURL * @method Phaser.Loader.File.revokeObjectURL
* @static * @static
* @param {Image} image - Image object which 'src' attribute should be revoked. * @param {HTMLImageElement} image - Image object which 'src' attribute should be revoked.
*/ */
File.revokeObjectURL = function (image) File.revokeObjectURL = function (image)
{ {

View file

@ -122,7 +122,7 @@ var LoaderPlugin = new Class({
* xhr specific global settings (can be overridden on a per-file basis) * xhr specific global settings (can be overridden on a per-file basis)
* *
* @name Phaser.Loader.LoaderPlugin#xhr * @name Phaser.Loader.LoaderPlugin#xhr
* @type {Phaser.Loader.XHRSettings} * @type {Phaser.Loader.XHRSettingsConfig}
* @since 3.0.0 * @since 3.0.0
*/ */
this.xhr = XHRSettings( this.xhr = XHRSettings(

View file

@ -16,10 +16,10 @@ var XHRSettings = require('./XHRSettings');
* @function Phaser.Loader.MergeXHRSettings * @function Phaser.Loader.MergeXHRSettings
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.Loader.XHRSettings} global - The global XHRSettings object. * @param {Phaser.Loader.XHRSettingsConfig} global - The global XHRSettings object.
* @param {Phaser.Loader.XHRSettings} local - The local XHRSettings object. * @param {Phaser.Loader.XHRSettingsConfig} local - The local XHRSettings object.
* *
* @return {Phaser.Loader.XHRSettings} A newly formed XHRSettings object. * @return {Phaser.Loader.XHRSettingsConfig} A newly formed XHRSettings object.
*/ */
var MergeXHRSettings = function (global, local) var MergeXHRSettings = function (global, local)
{ {

View file

@ -15,7 +15,7 @@ var MergeXHRSettings = require('./MergeXHRSettings');
* @since 3.0.0 * @since 3.0.0
* *
* @param {Phaser.Loader.File} file - The File to download. * @param {Phaser.Loader.File} file - The File to download.
* @param {Phaser.Loader.XHRSettings} globalXHRSettings - The global XHRSettings object. * @param {Phaser.Loader.XHRSettingsConfig} globalXHRSettings - The global XHRSettings object.
* *
* @return {XMLHttpRequest} The XHR object. * @return {XMLHttpRequest} The XHR object.
*/ */

View file

@ -4,19 +4,29 @@
* @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License} * @license {@link https://github.com/photonstorm/phaser/blob/master/license.txt|MIT License}
*/ */
/**
* @typedef {object} Phaser.Loader.XHRSettingsConfig
*
* @property {string} [responseType=''] - [description]
* @property {boolean} [async=true] - [description]
* @property {string} [user=''] - [description]
* @property {string} [password=''] - [description]
* @property {integer} [timeout=0] - [description]
*/
/** /**
* Creates an XHRSettings Object with default values. * Creates an XHRSettings Object with default values.
* *
* @function Phaser.Loader.XHRSettings * @function Phaser.Loader.XHRSettings
* @since 3.0.0 * @since 3.0.0
* *
* @param {string} [responseType] - The responseType, such as 'text'. * @param {string} [responseType=''] - The responseType, such as 'text'.
* @param {boolean} [async=true] - Should the XHR request use async or not? * @param {boolean} [async=true] - Should the XHR request use async or not?
* @param {string} [user] - Optional username for the XHR request. * @param {string} [user=''] - Optional username for the XHR request.
* @param {string} [password] - Optional password for the XHR request. * @param {string} [password=''] - Optional password for the XHR request.
* @param {integer} [timeout=0] - Optional XHR timeout value. * @param {integer} [timeout=0] - Optional XHR timeout value.
* *
* @return {Phaser.Loader.XHRSettings} The XHRSettings object as used by the Loader. * @return {Phaser.Loader.XHRSettingsConfig} The XHRSettings object as used by the Loader.
*/ */
var XHRSettings = function (responseType, async, user, password, timeout) var XHRSettings = function (responseType, async, user, password, timeout)
{ {

View file

@ -16,9 +16,9 @@ var JSONFile = require('./JSONFile.js');
* @param {string} key - The key of the file within the loader. * @param {string} key - The key of the file within the loader.
* @param {string} url - The url to load the file from. * @param {string} url - The url to load the file from.
* @param {string} path - The path of the file. * @param {string} path - The path of the file.
* @param {object} xhrSettings - Optional file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - Optional file specific XHR settings.
* *
* @return {Phaser.Loader.FileTypes.AnimationJSONFile} A File instance to be added to the Loader. * @return {Phaser.Loader.FileTypes.JSONFile} A File instance to be added to the Loader.
*/ */
var AnimationJSONFile = function (key, url, path, xhrSettings) var AnimationJSONFile = function (key, url, path, xhrSettings)
{ {

View file

@ -18,8 +18,8 @@ var JSONFile = require('./JSONFile.js');
* @param {string} textureURL - The url to load the texture file from. * @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from. * @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file. * @param {string} path - The path of the file.
* @param {object} textureXhrSettings - Optional texture file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
* @param {object} atlasXhrSettings - Optional atlas file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - Optional atlas file specific XHR settings.
* *
* @return {object} An object containing two File objects to be added to the loader. * @return {object} An object containing two File objects to be added to the loader.
*/ */

View file

@ -24,7 +24,7 @@ var HTML5AudioFile = require('./HTML5AudioFile');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
* @param {AudioContext} audioContext - [description] * @param {AudioContext} audioContext - [description]
*/ */
var AudioFile = new Class({ var AudioFile = new Class({

View file

@ -24,8 +24,8 @@ var JSONFile = require('./JSONFile.js');
* @param {(string|string[])} urls - [description] * @param {(string|string[])} urls - [description]
* @param {object} json - [description] * @param {object} json - [description]
* @param {object} config - [description] * @param {object} config - [description]
* @param {object} audioXhrSettings - Optional file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} audioXhrSettings - Optional file specific XHR settings.
* @param {object} jsonXhrSettings - Optional file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} jsonXhrSettings - Optional file specific XHR settings.
* *
* @return {Phaser.Loader.LoaderPlugin} The Loader. * @return {Phaser.Loader.LoaderPlugin} The Loader.
*/ */

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var BinaryFile = new Class({ var BinaryFile = new Class({

View file

@ -18,8 +18,8 @@ var XMLFile = require('./XMLFile.js');
* @param {string} textureURL - The url to load the texture file from. * @param {string} textureURL - The url to load the texture file from.
* @param {string} xmlURL - The url to load the atlas file from. * @param {string} xmlURL - The url to load the atlas file from.
* @param {string} path - The path of the file. * @param {string} path - The path of the file.
* @param {object} textureXhrSettings - Optional texture file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
* @param {object} xmlXhrSettings - Optional atlas file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} xmlXhrSettings - Optional atlas file specific XHR settings.
* *
* @return {object} An object containing two File objects to be added to the loader. * @return {object} An object containing two File objects to be added to the loader.
*/ */

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var GLSLFile = new Class({ var GLSLFile = new Class({

View file

@ -22,7 +22,7 @@ var GetURL = require('../GetURL');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} config - [description] * @param {Phaser.Loader.XHRSettingsConfig} config - [description]
* @param {boolean} locked - [description] * @param {boolean} locked - [description]
*/ */
var HTML5AudioFile = new Class({ var HTML5AudioFile = new Class({

View file

@ -25,7 +25,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {number} width - [description] * @param {number} width - [description]
* @param {number} height - [description] * @param {number} height - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var HTMLFile = new Class({ var HTMLFile = new Class({

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
* @param {object} config - [description] * @param {object} config - [description]
*/ */
var ImageFile = new Class({ var ImageFile = new Class({

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var JSONFile = new Class({ var JSONFile = new Class({

View file

@ -23,8 +23,8 @@ var NumberArray = require('../../utils/array/NumberArray');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string[]} textureURLs - [description] * @param {string[]} textureURLs - [description]
* @param {string[]} atlasURLs - [description] * @param {string[]} atlasURLs - [description]
* @param {object} textureXhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - [description]
* @param {object} atlasXhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - [description]
* *
* @return {Phaser.Loader.LoaderPlugin} The Loader. * @return {Phaser.Loader.LoaderPlugin} The Loader.
*/ */

View file

@ -24,7 +24,7 @@ var PluginManager = require('../../boot/PluginManager');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var PluginFile = new Class({ var PluginFile = new Class({

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var SVGFile = new Class({ var SVGFile = new Class({

View file

@ -23,7 +23,7 @@ var GetFastValue = require('../../utils/object/GetFastValue');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var ScriptFile = new Class({ var ScriptFile = new Class({

View file

@ -17,7 +17,7 @@ var ImageFile = require('./ImageFile.js');
* @param {string} url - The url to load the texture file from. * @param {string} url - The url to load the texture file from.
* @param {object} config - Optional texture file specific XHR settings. * @param {object} config - Optional texture file specific XHR settings.
* @param {string} path - Optional texture file specific XHR settings. * @param {string} path - Optional texture file specific XHR settings.
* @param {object} xhrSettings - Optional atlas file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - Optional atlas file specific XHR settings.
* *
* @return {object} An object containing two File objects to be added to the loader. * @return {object} An object containing two File objects to be added to the loader.
*/ */

View file

@ -22,7 +22,7 @@ var FileTypesManager = require('../FileTypesManager');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var TextFile = new Class({ var TextFile = new Class({

View file

@ -24,7 +24,7 @@ var TILEMAP_FORMATS = require('../../tilemaps/Formats');
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {string} format - [description] * @param {string} format - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var TilemapCSVFile = new Class({ var TilemapCSVFile = new Class({

View file

@ -18,7 +18,7 @@ var TILEMAP_FORMATS = require('../../tilemaps/Formats');
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {string} format - [description] * @param {string} format - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
* *
* @return {object} An object containing two File objects to be added to the loader. * @return {object} An object containing two File objects to be added to the loader.
*/ */

View file

@ -18,8 +18,8 @@ var TextFile = require('./TextFile.js');
* @param {string} textureURL - The url to load the texture file from. * @param {string} textureURL - The url to load the texture file from.
* @param {string} atlasURL - The url to load the atlas file from. * @param {string} atlasURL - The url to load the atlas file from.
* @param {string} path - The path of the file. * @param {string} path - The path of the file.
* @param {object} textureXhrSettings - Optional texture file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} textureXhrSettings - Optional texture file specific XHR settings.
* @param {object} atlasXhrSettings - Optional atlas file specific XHR settings. * @param {Phaser.Loader.XHRSettingsConfig} atlasXhrSettings - Optional atlas file specific XHR settings.
* *
* @return {object} An object containing two File objects to be added to the loader. * @return {object} An object containing two File objects to be added to the loader.
*/ */

View file

@ -24,7 +24,7 @@ var ParseXML = require('../../dom/ParseXML');
* @param {string} key - [description] * @param {string} key - [description]
* @param {string} url - [description] * @param {string} url - [description]
* @param {string} path - [description] * @param {string} path - [description]
* @param {object} xhrSettings - [description] * @param {Phaser.Loader.XHRSettingsConfig} xhrSettings - [description]
*/ */
var XMLFile = new Class({ var XMLFile = new Class({