mirror of
https://github.com/NativeScript/NativeScript.git
synced 2025-08-18 05:18:39 +08:00
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:

committed by
Panayot Cankov

parent
b8785afd74
commit
1b395aac7f
24
image-source/image-source.d.ts
vendored
24
image-source/image-source.d.ts
vendored
@ -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).
|
||||
|
Reference in New Issue
Block a user