@ks89/angular-modal-gallery
Version: 
Image gallery for Angular
65 lines (64 loc) • 2.03 kB
TypeScript
import { Action } from './action.enum';
import { Size } from './size.interface';
import { SafeResourceUrl } from '@angular/platform-browser';
/**
 * Class `Image` that represents an image with both `modal` and `plain` configurations.
 * Both image `id` and `modal` are mandatory, instead `plain` is optional.
 */
export declare class Image {
    id: number;
    loading: 'eager' | 'lazy';
    fetchpriority: 'high' | 'low' | 'auto';
    modal: ModalImage;
    plain?: PlainImage;
    constructor(id: number, modal: ModalImage, plain?: PlainImage, loading?: 'eager' | 'lazy', fetchpriority?: 'high' | 'low' | 'auto');
}
/**
 * Interface `ImageData` to configure an image, but it isn't used directly.
 * Please, refers to `PlainImage` or `ModalImage`.
 */
export interface ImageData {
    img: string | SafeResourceUrl;
    description?: string;
    title?: string;
    alt?: string;
    ariaLabel?: string;
    fallbackImg?: string | SafeResourceUrl;
}
/**
 * Interface `ModalImage` to configure the modal image.
 */
export interface ModalImage extends ImageData {
    extUrl?: string;
    downloadFileName?: string;
    sources?: Source[];
}
/**
 * Interface `PlainImage` to configure the plain image.
 */
export interface PlainImage extends ImageData {
    size?: Size;
}
/**
 * Class `ImageEvent` that represents the event payload with the result and the triggered action.
 * It also contains the source id of the gallery that emitted this event
 */
export declare class ImageEvent {
    galleryId: number;
    action: Action;
    result: number | boolean;
    constructor(galleryId: number, action: Action, result: number | boolean);
}
/**
 * Class `ImageModalEvent` that represents the event payload with galleryId, result and the triggered action.
 */
export declare class ImageModalEvent extends ImageEvent {
    constructor(galleryId: number, action: Action, result: number | boolean);
}
/**
 * Interface `Source` to configure sources of picture element.
 */
export interface Source {
    srcset: string;
    media: string;
}