UNPKG

@nativescript-community/ui-image

Version:

Advanced and efficient image display plugin which uses Fresco (Android) and SDWebImage (iOS) to implement caching, placeholders, image effects, and much more.

72 lines (71 loc) 3.42 kB
export * from './index-common'; import { EventData, ImageBase, ImageInfo as ImageInfoBase, ImagePipelineConfigSetting, PrefetchOptions, QualityInfo, SrcType, Stretch, decodeWidthProperty, failureImageUriProperty, headersProperty, imageRotationProperty, placeholderImageUriProperty, progressBarColorProperty, showProgressBarProperty, srcProperty, stretchProperty } from './index-common'; import { GetContextFromOptionsCallback } from '.'; import { decodeHeightProperty } from '@nativescript/core/ui/image'; export declare class ImageInfo implements ImageInfoBase { private width; private height; constructor(width: number, height: number); getQualityInfo(): QualityInfo; getHeight(): number; getWidth(): number; } export interface FinalEventData extends EventData { imageInfo: ImageInfo; ios: UIImage; } export declare function initialize(config?: ImagePipelineConfigSetting): void; export declare function shutDown(): void; export declare function registerPluginGetContextFromOptions(callback: GetContextFromOptionsCallback): void; export declare class ImagePipeline { static iosComplexCacheEviction: boolean; private mIos; constructor(); getCacheKey(url: string, options?: PrefetchOptions): string; isInDiskCache(url: string, options?: PrefetchOptions): Promise<boolean>; isInBitmapMemoryCache(url: string, options?: PrefetchOptions): boolean; evictFromMemoryCache(key: string): void; evictFromDiskCache(key: string): Promise<any[]>; evictFromCache(key: string, type?: SDImageCacheType): Promise<any[]>; clearCaches(): void; clearMemoryCaches(): void; clearDiskCaches(): void; prefetchToDiskCache(uri: string): Promise<void>; prefetchToMemoryCache(uri: string): Promise<void>; private prefetchToCacheType; get ios(): SDImageCache; } export declare const needRequestImage: (target: any, propertyKey: string | symbol, descriptor: PropertyDescriptor) => void; export declare function getImagePipeline(): ImagePipeline; export declare class Img extends ImageBase { [srcProperty.setNative]: (value: any) => void; [imageRotationProperty.setNative]: (value: any) => void; [placeholderImageUriProperty.setNative]: () => void; [decodeWidthProperty.setNative]: () => void; [decodeHeightProperty.setNative]: () => void; [showProgressBarProperty.setNative]: (value: any) => void; [progressBarColorProperty.setNative]: (value: any) => void; [headersProperty.setNative]: (value: any) => void; [failureImageUriProperty.setNative]: () => void; [stretchProperty.setNative]: (value: Stretch) => void; nativeViewProtected: SDAnimatedImageView | UIImageView; nativeImageViewProtected: SDAnimatedImageView | UIImageView; isLoading: boolean; mCacheKey: string; contextOptions: any; get cacheKey(): string; protected mImageSourceAffectsLayout: boolean; createNativeView(): UIImageView; _setNativeClipToBounds(): void; onMeasure(widthMeasureSpec: number, heightMeasureSpec: number): void; updateImageUri(): Promise<void>; _setNativeImage(nativeImage: UIImage, animated?: boolean): void; private handleImageLoaded; private onLoadProgress; private getUIImage; protected initImage(): Promise<void>; protected handleImageSrc(src: SrcType): Promise<void>; placeholderImage: UIImage; startAnimating(): void; stopAnimating(): void; }