mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-11-05 13:26:48 +08:00
Replace knownEvents modules with static strings.
This commit is contained in:
27
ui/image-cache/image-cache.d.ts
vendored
27
ui/image-cache/image-cache.d.ts
vendored
@@ -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.
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user