import ByteArray from "openfl/utils/ByteArray"; declare namespace starling.assets { /** * Loads binary data from a local or remote URL with a very simple callback system. * * * *
The DataLoader is used by the AssetManager to load any local or remote data. * * Its single purpose is to get the binary data that's stored at a specific URL.
* * * *You can use this class for your own purposes (as an easier to use 'URLLoader'
* * alternative), or you can extend the class to modify the AssetManager's behavior.
* * E.g. you could extend this class to add a caching mechanism for remote assets.
* * Assign an instance of your extended class to the AssetManager's dataLoader
* * property.
The 'onComplete' callback may have up to four parameters, all of them being optional. * * If you pass a callback that just takes zero or one, it will work just as well. The * * additional parameters may be used to describe the name and type of the downloaded * * data. They are not provided by the base class, but the AssetManager will check * * if they are available.
* * * * @param url a String containing an URL. * * @param onComplete will be called when the data has been loaded. * *function(data:ByteArray, mimeType:String, name:String, extension:String):void
* * @param onError will be called in case of an error. The 2nd parameter is optional.
* * function(error:String, httpStatus:int):void
* * @param onProgress will be called multiple times with the current load ratio (0-1).
* * function(ratio:Number):void
*
*/
load(url: string, onComplete: (arg0?: ByteArray, arg1?: string, arg2?: string, arg3?: string) => void, onError: (arg0: string) => void, onProgress?: (arg0: number) => void): void;
/**
* Aborts all current load operations. The loader can still be used, though.
*/
close(): void;
}
}
export default starling.assets.DataLoader;