Replace knownEvents modules with static strings.

This commit is contained in:
Nedyalko Nikolov
2015-04-23 15:47:56 +03:00
parent 8023390692
commit 95ca8d9c8c
101 changed files with 520 additions and 471 deletions

View File

@@ -27,6 +27,10 @@ declare module "ui/image-cache" {
* Represents a class that stores handles image download requests and caches the already downloaded images.
*/
export class Cache extends observable.Observable {
/**
* String value used when hooking to downloaded event.
*/
public static downloadedEvent: string;
/**
* The image to be used to notify for a pending download request - e.g. loading indicator.
*/
@@ -71,22 +75,25 @@ declare module "ui/image-cache" {
*/
clear(): void;
/**
* A basic method signature to hook an event listener (shortcut alias to the addEventListener method).
* @param eventNames - String corresponding to events (e.g. "propertyChange"). Optionally could be used more events separated by `,` (e.g. "propertyChange", "change").
* @param callback - Callback function which will be executed when event is raised.
* @param thisArg - An optional parameter which will be used as `this` context for callback execution.
*/
on(eventNames: string, callback: (args: observable.EventData) => void , thisArg?: any);
/**
* Raised when the image has been downloaded.
*/
on(event: "downloaded", callback: (args: DownloadedData) => void , thisArg?: any);
//@private
_downloadCore(request: DownloadRequest);
_onDownloadCompleted(key: string, image: any);
//@endprivate
}
/**
* Defines an enum with events specific for image-cache class.
*/
export module knownEvents {
/**
* Raised when the image has been downloaded.
*/
export var downloaded: string;
}
/**
* Provides data for downloaded event.
*/