UNPKG

ngx-picture

Version:

An Angular library to properly size, lazy load images, and use next generation formats

30 lines (29 loc) 1.85 kB
import { AfterViewInit, ChangeDetectorRef, ElementRef, EventEmitter, OnInit, TemplateRef } from '@angular/core'; import { NgxPictureConfig } from '../ngx-picture-config'; import * as i0 from "@angular/core"; export type ImageFormat = 'apng' | 'bmp' | 'gif' | 'jpeg' | 'png' | 'svg' | 'tiff' | 'webp' | 'jp2' | 'jxr'; export declare class PictureComponent implements OnInit, AfterViewInit { private platformId; private ngxPictureConfig; private window; private elementRef; private changeDetectorRef; imgTemplate: TemplateRef<HTMLImageElement> | undefined; src: string | undefined; imageFormats: any[] | undefined; breakpoints: { [key: string]: number; }; alt: string | undefined; lazyLoad: boolean; srcInterpolator: (url: string | undefined, imageFormat: ImageFormat, breakpoint: string, breakpointValue: number) => string | undefined; loaded: EventEmitter<Event>; show: boolean; private intersectionObserver; constructor(platformId: any, ngxPictureConfig: NgxPictureConfig, window: Window, elementRef: ElementRef, changeDetectorRef: ChangeDetectorRef); ngOnInit(): void; ngAfterViewInit(): void; private showLazyPicture; static ɵfac: i0.ɵɵFactoryDeclaration<PictureComponent, [null, null, { optional: true; }, null, null]>; static ɵcmp: i0.ɵɵComponentDeclaration<PictureComponent, "ngx-picture", never, { "src": { "alias": "src"; "required": false; }; "imageFormats": { "alias": "imageFormats"; "required": false; }; "breakpoints": { "alias": "breakpoints"; "required": false; }; "alt": { "alias": "alt"; "required": false; }; "lazyLoad": { "alias": "lazyLoad"; "required": false; }; "srcInterpolator": { "alias": "srcInterpolator"; "required": false; }; }, { "loaded": "loaded"; }, ["imgTemplate"], never, false, never>; }