package starling.utils {
import starling.textures.TextureOptions;
import starling.textures.TextureAtlas;
import starling.textures.Texture;
import starling.text.BitmapFont;
import starling.events.EventDispatcher;
import openfl.utils.ByteArray;
import openfl.media.SoundTransform;
import openfl.media.SoundChannel;
import openfl.media.Sound;
import openfl.Vector;
/**
 *  Dispatched when all textures have been restored after a context loss. 
 * @externs
 */
public class AssetManager extends starling.events.EventDispatcher {
	/**
	 *  Create a new AssetManager. The 'scaleFactor' and 'useMipmaps' parameters define
	 *      * how enqueued bitmaps will be converted to textures. 
	 */
	public function AssetManager(scaleFactor:Number = undefined, useMipmaps:Boolean = undefined) {
		super();
	}
	/**
	 *  Disposes all contained textures, XMLs and ByteArrays.
	 *      *
	 *      * <p>Beware that all references to the assets will remain intact, even though the assets
	 *      * are no longer valid. Call 'purge' if you want to remove all resources and reuse
	 *      * the AssetManager later.</p>
	 *      
	 */
	public function dispose():void {}
	/**
	 *  Returns a texture with a certain name. The method first looks through the directly
	 *      * added textures; if no texture with that name is found, it scans through all 
	 *      * texture atlases. 
	 */
	public function getTexture(name:String):starling.textures.Texture { return null; }
	/**
	 *  Returns all textures that start with a certain string, sorted alphabetically
	 *      * (especially useful for "MovieClip"). 
	 */
	public function getTextures(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns all texture names that start with a certain string, sorted alphabetically. 
	 */
	public function getTextureNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns a texture atlas with a certain name, or null if it's not found. 
	 */
	public function getTextureAtlas(name:String):starling.textures.TextureAtlas { return null; }
	/**
	 *  Returns all texture atlas names that start with a certain string, sorted alphabetically.
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getTextureAtlasNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns a sound with a certain name, or null if it's not found. 
	 */
	public function getSound(name:String):openfl.media.Sound { return null; }
	/**
	 *  Returns all sound names that start with a certain string, sorted alphabetically.
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getSoundNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Generates a new SoundChannel object to play back the sound. This method returns a 
	 *      * SoundChannel object, which you can access to stop the sound and to control volume. 
	 */
	public function playSound(name:String, startTime:Number = undefined, loops:int = undefined, transform:openfl.media.SoundTransform = undefined):openfl.media.SoundChannel { return null; }
	/**
	 *  Returns an XML with a certain name, or null if it's not found. 
	 */
	public function getXml(name:String):* { return null; }
	/**
	 *  Returns all XML names that start with a certain string, sorted alphabetically. 
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getXmlNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns an object with a certain name, or null if it's not found. Enqueued JSON
	 *      * data is parsed and can be accessed with this method. 
	 */
	public function getObject(name:String):* { return null; }
	/**
	 *  Returns all object names that start with a certain string, sorted alphabetically. 
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getObjectNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns a byte array with a certain name, or null if it's not found. 
	 */
	public function getByteArray(name:String):openfl.utils.ByteArray { return null; }
	/**
	 *  Returns all byte array names that start with a certain string, sorted alphabetically. 
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getByteArrayNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Returns a bitmaps font with a certain name, or null if it's not found. 
	 */
	public function getBitmapFont(name:String):starling.text.BitmapFont { return null; }
	/**
	 *  Returns all bitmap fonts names that start with a certain string, sorted alphabetically. 
	 *      * If you pass an <code>out</code>-vector, the names will be added to that vector. 
	 */
	public function getBitmapFontNames(prefix:String = undefined, out:openfl.Vector = undefined):openfl.Vector { return null; }
	/**
	 *  Register a texture under a certain name. It will be available right away.
	 *      * If the name was already taken, the existing texture will be disposed and replaced
	 *      * by the new one. 
	 */
	public function addTexture(name:String, texture:starling.textures.Texture):void {}
	/**
	 *  Register a texture atlas under a certain name. It will be available right away. 
	 *      * If the name was already taken, the existing atlas will be disposed and replaced
	 *      * by the new one. 
	 */
	public function addTextureAtlas(name:String, atlas:starling.textures.TextureAtlas):void {}
	/**
	 *  Register a sound under a certain name. It will be available right away.
	 *      * If the name was already taken, the existing sound will be replaced by the new one. 
	 */
	public function addSound(name:String, sound:openfl.media.Sound):void {}
	/**
	 *  Register an XML object under a certain name. It will be available right away.
	 *      * If the name was already taken, the existing XML will be disposed and replaced
	 *      * by the new one. 
	 */
	public function addXml(name:String, xml:*):void {}
	/**
	 *  Register an arbitrary object under a certain name. It will be available right away. 
	 *      * If the name was already taken, the existing object will be replaced by the new one. 
	 */
	public function addObject(name:String, object:*):void {}
	/**
	 *  Register a byte array under a certain name. It will be available right away.
	 *      * If the name was already taken, the existing byte array will be cleared and replaced
	 *      * by the new one. 
	 */
	public function addByteArray(name:String, byteArray:openfl.utils.ByteArray):void {}
	/**
	 *  Register a bitmap font under a certain name. It will be available right away.
	 *      *  If the name was already taken, the existing font will be disposed and replaced
	 *      *  by the new one.
	 *      *
	 *      *  <p>Note that the font is <strong>not</strong> registered at the TextField class.
	 *      *  This only happens when a bitmap font is loaded via the asset queue.</p>
	 *      
	 */
	public function addBitmapFont(name:String, font:starling.text.BitmapFont):void {}
	/**
	 *  Removes a certain texture, optionally disposing it. 
	 */
	public function removeTexture(name:String, dispose:Boolean = undefined):void {}
	/**
	 *  Removes a certain texture atlas, optionally disposing it. 
	 */
	public function removeTextureAtlas(name:String, dispose:Boolean = undefined):void {}
	/**
	 *  Removes a certain sound. 
	 */
	public function removeSound(name:String):void {}
	/**
	 *  Removes a certain Xml object, optionally disposing it. 
	 */
	public function removeXml(name:String, dispose:Boolean = undefined):void {}
	/**
	 *  Removes a certain object. 
	 */
	public function removeObject(name:String):void {}
	/**
	 *  Removes a certain byte array, optionally disposing its memory right away. 
	 */
	public function removeByteArray(name:String, dispose:Boolean = undefined):void {}
	/**
	 *  Removes a certain bitmap font, optionally disposing it. 
	 */
	public function removeBitmapFont(name:String, dispose:Boolean = undefined):void {}
	/**
	 *  Empties the queue and aborts any pending load operations. 
	 */
	public function purgeQueue():void {}
	/**
	 *  Removes assets of all types (disposing them along the way), empties the queue and
	 *      * aborts any pending load operations. 
	 */
	public function purge():void {}
	/**
	 *  Enqueues one or more raw assets; they will only be available after successfully 
	 *      * executing the "loadQueue" method. This method accepts a variety of different objects:
	 *      * 
	 *      * <ul>
	 *      *   <li>Strings or URLRequests containing an URL to a local or remote resource. Supported
	 *      *       types: <code>png, jpg, gif, atf, mp3, xml, fnt, json, binary</code>.</li>
	 *      *   <li>Instances of the File class (AIR only) pointing to a directory or a file.
	 *      *       Directories will be scanned recursively for all supported types.</li>
	 *      *   <li>Classes that contain <code>static</code> embedded assets.</li>
	 *      *   <li>If the file extension is not recognized, the data is analyzed to see if
	 *      *       contains XML or JSON data. If it's neither, it is stored as ByteArray.</li>
	 *      * </ul>
	 *      * 
	 *      * <p>Suitable object names are extracted automatically: A file named "image.png" will be
	 *      * accessible under the name "image". When enqueuing embedded assets via a class, 
	 *      * the variable name of the embedded object will be used as its name. An exception
	 *      * are texture atlases: they will have the same name as the actual texture they are
	 *      * referencing.</p>
	 *      * 
	 *      * <p>XMLs that contain texture atlases or bitmap fonts are processed directly: fonts are
	 *      * registered at the TextField class, atlas textures can be acquired with the
	 *      * "getTexture()" method. All other XMLs are available via "getXml()".</p>
	 *      * 
	 *      * <p>If you pass in JSON data, it will be parsed into an object and will be available via
	 *      * "getObject()".</p>
	 *      
	 */
	public function enqueue(rawAssets:Array):void {}
	/**
	 *  Enqueues a single asset with a custom name that can be used to access it later.
	 *      * If the asset is a texture, you can also add custom texture options.
	 *      * 
	 *      * @param asset    The asset that will be enqueued; accepts the same objects as the
	 *      *                 'enqueue' method.
	 *      * @param name     The name under which the asset will be found later. If you pass null or
	 *      *                 omit the parameter, it's attempted to generate a name automatically.
	 *      * @param options  Custom options that will be used if 'asset' points to texture data.
	 *      * @return         the name with which the asset was registered.
	 *      
	 */
	public function enqueueWithName(asset:*, name:String = undefined, options:starling.textures.TextureOptions = undefined):String { return null; }
	/**
	 *  Loads all enqueued assets asynchronously. The 'onProgress' function will be called
	 *      * with a 'ratio' between '0.0' and '1.0', with '1.0' meaning that it's complete.
	 *      *
	 *      * <p>When you call this method, the manager will save a reference to "Starling.current";
	 *      * all textures that are loaded will be accessible only from within this instance. Thus,
	 *      * if you are working with more than one Starling instance, be sure to call
	 *      * "makeCurrent()" on the appropriate instance before processing the queue.</p>
	 *      *
	 *      * @param onProgress <code>function(ratio:Number):void;</code>
	 *      
	 */
	public function loadQueue(onProgress:Function):void {}
	/**
	 *  Returns the number of raw assets that have been enqueued, but not yet loaded. 
	 */
	public function get numQueuedAssets():int { return 0; }
	/**
	 *  When activated, the class will trace information about added/enqueued assets.
	 *      * @default true 
	 */
	public function get verbose():Boolean { return false; }
	public function set verbose(value:Boolean):void {}
	/**
	 *  Indicates if a queue is currently being loaded. 
	 */
	public function get isLoading():Boolean { return false; }
	/**
	 *  For bitmap textures, this flag indicates if mip maps should be generated when they 
	 *      * are loaded; for ATF textures, it indicates if mip maps are valid and should be
	 *      * used. @default false 
	 */
	public function get useMipMaps():Boolean { return false; }
	public function set useMipMaps(value:Boolean):void {}
	/**
	 *  Textures that are created from Bitmaps or ATF files will have the scale factor 
	 *      * assigned here. @default 1 
	 */
	public function get scaleFactor():Number { return 0; }
	public function set scaleFactor(value:Number):void {}
	/**
	 *  Textures that are created from Bitmaps will be uploaded to the GPU with the
	 *      * <code>Context3DTextureFormat</code> assigned to this property. @default "bgra" 
	 */
	public function get textureFormat():String { return null; }
	public function set textureFormat(value:String):void {}
	/**
	 *  Indicates if the underlying Stage3D textures should be created as the power-of-two based
	 *      *  <code>Texture</code> class instead of the more memory efficient <code>RectangleTexture</code>.
	 *      *  @default false 
	 */
	public function get forcePotTextures():Boolean { return false; }
	public function set forcePotTextures(value:Boolean):void {}
	/**
	 *  Specifies whether a check should be made for the existence of a URL policy file before
	 *      * loading an object from a remote server. More information about this topic can be found 
	 *      * in the 'flash.system.LoaderContext' documentation. @default false 
	 */
	public function get checkPolicyFile():Boolean { return false; }
	public function set checkPolicyFile(value:Boolean):void {}
	/**
	 *  Indicates if atlas XML data should be stored for access via the 'getXml' method.
	 *      * If true, you can access an XML under the same name as the atlas.
	 *      * If false, XMLs will be disposed when the atlas was created. @default false. 
	 */
	public function get keepAtlasXmls():Boolean { return false; }
	public function set keepAtlasXmls(value:Boolean):void {}
	/**
	 *  Indicates if bitmap font XML data should be stored for access via the 'getXml' method.
	 *      * If true, you can access an XML under the same name as the bitmap font.
	 *      * If false, XMLs will be disposed when the font was created. @default false. 
	 */
	public function get keepFontXmls():Boolean { return false; }
	public function set keepFontXmls(value:Boolean):void {}
	/**
	 *  The maximum number of parallel connections that are spawned when loading the queue.
	 *      * More connections can reduce loading times, but require more memory. @default 3. 
	 */
	public function get numConnections():int { return 0; }
	public function set numConnections(value:int):void {}
	/**
	 *  Indicates if bitmap fonts should be registered with their "face" attribute from the
	 *      *  font XML file. Per default, they are registered with the name of the texture file.
	 *      *  @default false 
	 */
	public function get registerBitmapFontsWithFontFace():Boolean { return false; }
	public function set registerBitmapFontsWithFontFace(value:Boolean):void {}
	public function get_registerBitmapFontsWithFontFace():Boolean { return false; }
	public function set_registerBitmapFontsWithFontFace(value:Boolean):Boolean { return false; }
}
}
