Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 18 additions & 5 deletions src/index.d.ts
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
import observable = require("tns-core-modules/data/observable");
import imagesource = require("tns-core-modules/image-source");
import imageAssetModule = require("tns-core-modules/image-asset");
import { Observable } from "tns-core-modules/data/observable";
import { ImageSource } from "tns-core-modules/image-source";
import { ImageAsset } from "tns-core-modules/image-asset";

export interface ImageOptions {
/**
Expand All @@ -19,7 +19,13 @@ export interface ImageOptions {
aspectRatio?: "fill" | "fit";
}

export class SelectedAsset extends imageAssetModule.ImageAsset {
export class SelectedAsset extends ImageAsset {
/**
* A 100x100 pixels thumb of the selected image.
* This property will be initialized on demand. The first access will return undefined or null.
* It will trigger an async load and when the thumb is obtained, a property changed notification will occur.
*/
thumb: ImageSource;

/**
* URI that identifies the image asset.
Expand All @@ -39,7 +45,7 @@ export class SelectedAsset extends imageAssetModule.ImageAsset {
* Asynchronously retrieves an ImageSource object that represents this selected image.
* Scaled to the given size. (Aspect-ratio is preserved by default)
*/
getImage(options?: ImageOptions): Promise<imagesource.ImageSource>;
getImage(options?: ImageOptions): Promise<ImageSource>;

/**
* Asynchronously retrieves an ArrayBuffer that represents the raw byte data from this selected image.
Expand Down Expand Up @@ -92,6 +98,13 @@ interface Options {
*/
albumsText?: string;

android?: {
/**
* Provide a reason for permission request to access external storage on api levels above 23.
*/
read_external_storage?: string;
};

/**
* Indicates images should be sorted newest-first (iOS only, default false).
*/
Expand Down