@exadel/esl
Version:
Exadel Smart Library (ESL) is the lightweight custom elements library that provide a set of super-flexible components
80 lines (79 loc) • 2.91 kB
TypeScript
import { ESLBaseElement } from '../../esl-base-element/core';
import { ESLMediaRuleList } from '../../esl-media-query/core';
/**
* ESLImage - custom element, that provides flexible ways to include images on web pages.
* Was originally developed as an alternative to `<picture>` element, but with more features inside.
*
* @author Alexey Stsefanovich (ala'n), Yuliya Adamskaya
*/
export declare class ESLImage extends ESLBaseElement {
static is: string;
static observedAttributes: string[];
/** Default container class value */
static DEFAULT_CONTAINER_CLS: string;
static readonly STRATEGIES: import("./esl-image-strategies").ESLImageStrategyMap;
static readonly EMPTY_IMAGE = "data:image/gif;base64,R0lGODlhAQABAAAAACH5BAEKAAEALAAAAAABAAEAAAICTAEAOw==";
/** Event that represents ready state of {@link ESLImage} */
READY_EVENT: string;
/** Event that represents successfully loaded state of {@link ESLImage} */
LOAD_EVENT: string;
/** Event that represents error state of {@link ESLImage} */
ERROR_EVENT: string;
alt: string;
mode: string;
src: string;
srcBase: string;
lazy: 'auto' | 'manual' | 'none' | '';
lazyTriggered: boolean;
refreshOnUpdate: boolean;
innerImageClass: string;
containerClass: string | null;
containerClassTarget: string;
containerClassState: string;
readonly ready: boolean;
readonly loaded: boolean;
readonly error: boolean;
private _strategy;
private _innerImg;
private _srcRules;
private _currentSrc;
private _detachLazyTrigger;
private _shadowImageElement;
protected connectedCallback(): void;
protected disconnectedCallback(): void;
protected attributeChangedCallback(attrName: string, oldVal: string, newVal: string): void;
get srcRules(): ESLMediaRuleList<string>;
set srcRules(rules: ESLMediaRuleList<string>);
get currentSrc(): string;
get empty(): boolean;
get canUpdate(): boolean;
get lazyObservable(): boolean;
get originalWidth(): number;
get originalHeight(): number;
triggerLoad(): void;
protected changeMode(oldVal: string, newVal: string): void;
protected update(force?: boolean): void;
protected updateA11y(): void;
protected getPath(src: string | undefined): string;
refresh(): void;
private syncImage;
private clearImage;
get innerImage(): HTMLImageElement | null;
attachInnerImage(): HTMLImageElement;
removeInnerImage(): void;
protected get _shadowImg(): HTMLImageElement;
protected get _shadowImgError(): boolean;
private _onLoad;
private _onError;
private _onMediaMatchChange;
private _onReadyState;
updateContainerClasses(): void;
}
declare global {
export interface ESLLibrary {
Image: typeof ESLImage;
}
export interface HTMLElementTagNameMap {
'esl-image': ESLImage;
}
}