ionic-image-loader-v7
Version:
ionic-image-loader to Ionic 6
102 lines (101 loc) • 3.41 kB
TypeScript
import { ElementRef, EventEmitter, OnInit, Renderer2 } from '@angular/core';
import { ImageLoaderConfigService } from './services/image-loader-config.service';
import { ImageLoaderService } from './services/image-loader.service';
import * as i0 from "@angular/core";
export interface ImageAttribute {
element: string;
value: string;
}
export declare class IonicImageLoaderComponent implements OnInit {
private _element;
private renderer;
private imageLoader;
private config;
/**
* Fallback URL to load when the image url fails to load or does not exist.
*/
fallbackUrl: string;
/**
* Whether to show a spinner while the image loads
*/
spinner: boolean;
/**
* Whether to show the fallback image instead of a spinner while the image loads
*/
fallbackAsPlaceholder: boolean;
/**
* Attributes to pass through to img tag if _useImg == true
*/
imgAttributes: ImageAttribute[];
/**
* Enable/Disable caching
*/
cache: boolean;
/**
* Width of the image. This will be ignored if using useImg.
*/
width: string;
/**
* Height of the image. This will be ignored if using useImg.
*/
height: string;
/**
* Display type of the image. This will be ignored if using useImg.
*/
display: string;
/**
* Background size. This will be ignored if using useImg.
*/
backgroundSize: string;
/**
* Background repeat. This will be ignored if using useImg.
*/
backgroundRepeat: string;
/**
* Name of the spinner
*/
spinnerName: string;
/**
* Color of the spinner
*/
spinnerColor: string;
/**
* Notify on image load..
*/
load: EventEmitter<IonicImageLoaderComponent>;
/**
* Indicates if the image is still loading
*/
isLoading: boolean;
element: HTMLElement;
constructor(_element: ElementRef, renderer: Renderer2, imageLoader: ImageLoaderService, config: ImageLoaderConfigService);
private _useImg;
/**
* Use <img> tag
*/
set useImg(val: boolean);
/**
* Convenience attribute to disable caching
*/
set noCache(val: boolean);
private _src;
get src(): string;
/**
* The URL of the image to load.
*/
set src(imageUrl: string);
ngOnInit(): void;
private updateImage;
/**
* Gets the image URL to be loaded and disables caching if necessary
*/
private processImageUrl;
/**
* Set the image to be displayed
* @param imageUrl image src
* @param stopLoading set to true to mark the image as loaded
*/
private setImage;
static ɵfac: i0.ɵɵFactoryDeclaration<IonicImageLoaderComponent, never>;
static ɵcmp: i0.ɵɵComponentDeclaration<IonicImageLoaderComponent, "img-loader", never, { "fallbackUrl": "fallbackUrl"; "spinner": "spinner"; "fallbackAsPlaceholder": "fallbackAsPlaceholder"; "imgAttributes": "imgAttributes"; "cache": "cache"; "width": "width"; "height": "height"; "display": "display"; "backgroundSize": "backgroundSize"; "backgroundRepeat": "backgroundRepeat"; "spinnerName": "spinnerName"; "spinnerColor": "spinnerColor"; "useImg": "useImg"; "noCache": "noCache"; "src": "src"; }, { "load": "load"; }, never, ["*"]>;
}