@drozdik.m/image-gallery
Version:
Efficient native modal image gallery.
38 lines (37 loc) • 1.17 kB
TypeScript
import { GalleryImageLoadArgs } from "../args/GalleryImageLoadArgs";
import { Event } from "@drozdik.m/event";
export declare class GalleryImage {
private imageSrouce;
private imageTitle;
private isLoaded;
private imageElement;
OnLoad: Event<GalleryImage, GalleryImageLoadArgs>;
constructor(imageSource: string, imageTitle: string, imageAlt?: string);
/**
* Preloads and prepares the image
* */
Preload(): void;
/**
* Tells if this image is already loaded
* */
IsLoaded(): boolean;
/**
* Simply creates the image element
* */
protected MakeResultImageElement(): HTMLImageElement;
/**
* Returns the result element that holds the image
* */
GetResultElement(): HTMLElement;
/**
* Returns only the image element
* */
GetImageElement(): HTMLElement;
GetImageNaturalWidth(): number;
GetImageNaturalHeight(): number;
/**
* Creates and returns a gallery image object based on a <a> elements attributes
* @param linkElement
*/
static FromLinkElement(linkElement: HTMLElement): GalleryImage;
}