@egjs/imready
Version:
This module is used to wait for the image or video to be ready.
27 lines (26 loc) • 978 B
TypeScript
import Component from "@egjs/component";
import { ImReadyLoaderEvents, ImReadyLoaderOptions } from "../types";
export default abstract class Loader<T extends HTMLElement = any> extends Component<ImReadyLoaderEvents> {
static EVENTS: string[];
options: ImReadyLoaderOptions;
abstract checkElement(): boolean;
protected element: T;
protected isReady: boolean;
protected isPreReady: boolean;
protected hasDataSize: boolean;
protected hasLoading: boolean;
protected isSkip: boolean;
constructor(element: HTMLElement, options?: Partial<ImReadyLoaderOptions>);
check(): boolean;
addEvents(): void;
clear(): void;
destroy(): void;
removeAutoSizer(): void;
onCheck: (e?: Event) => void;
onError(target: HTMLElement): void;
onPreReady(): void;
onReady(withPreReady: boolean): void;
onAlreadyError(target: HTMLElement): void;
onAlreadyPreReady(): void;
onAlreadyReady(withPreReady: boolean): void;
}