@egjs/flicking
Version:
Everyday 30 million people experience. It's reliable, flexible and extendable carousel.
42 lines (41 loc) • 1.26 kB
TypeScript
import Panel, { PanelOptions } from "./Panel";
import VirtualElementProvider from "./provider/VirtualElementProvider";
/**
* Options for creating a {@link VirtualPanel}
*/
export interface VirtualPanelOptions extends PanelOptions {
/** A provider instance that returns the actual html element */
elementProvider: VirtualElementProvider;
}
/**
* A slide data component that holds information of a single HTMLElement
*/
declare class VirtualPanel extends Panel {
protected _elProvider: VirtualElementProvider;
protected _cachedInnerHTML: string | null;
/**
* `HTMLElement` that panel's referencing
* @readonly
*/
get element(): HTMLElement;
/**
* Cached innerHTML by the previous render function
* @readonly
*/
get cachedInnerHTML(): string | null;
/**
* A number for indexing which element it will be rendered on
* @readonly
*/
get elementIndex(): number;
/**
* @param options - {@link VirtualPanelOptions}
*/
constructor(options: VirtualPanelOptions);
cacheRenderResult(result: string): void;
uncacheRenderResult(): void;
render(): void;
increaseIndex(val: number): this;
decreaseIndex(val: number): this;
}
export default VirtualPanel;