async image loading from data, files and resources for ios

Use the tns_safeDecodeImageNamedCompletion from the widgets framework

Add loadMode on Image with sync and async options for local images
This commit is contained in:
Nedyalko Nikolov
2016-04-15 09:04:02 +03:00
committed by Panayot Cankov
parent b8785afd74
commit 1b395aac7f
10 changed files with 266 additions and 108 deletions

View File

@ -33,23 +33,47 @@ declare module "image-source" {
*/
loadFromResource(name: string): boolean;
/**
* Loads this instance from the specified resource name asynchronously.
* @param name The name of the resource (without its extension).
*/
fromResource(name: string): Promise<boolean>;
/**
* Loads this instance from the specified file.
* @param path The location of the file on the file system.
*/
loadFromFile(path: string): boolean;
/**
* Loads this instance from the specified file asynchronously.
* @param path The location of the file on the file system.
*/
fromFile(path: string): Promise<boolean>;
/**
* Loads this instance from the specified native image data.
* @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
*/
loadFromData(data: any): boolean;
/**
* Loads this instance from the specified native image data asynchronously.
* @param data The native data (byte array) to load the image from. This will be either Stream for Android or NSData for iOS.
*/
fromData(data: any): Promise<boolean>;
/**
* Loads this instance from the specified native image data.
* @param source The Base64 string to load the image from.
*/
loadFromBase64(source: string): boolean;
/**
* Loads this instance from the specified native image data asynchronously.
* @param source The Base64 string to load the image from.
*/
fromBase64(source: string): Promise<boolean>;
/**
* Sets the provided native source object (typically a Bitmap).