vscroll
Version:
Virtual scroll engine
37 lines (36 loc) • 1.64 kB
TypeScript
import { Settings } from './settings';
import { Direction } from '../inputs/index';
import { IRoutines, ItemAdapter } from '../interfaces/index';
export declare class Routines implements IRoutines {
readonly settings: IRoutines['settings'];
readonly element: HTMLElement;
readonly viewport: HTMLElement;
constructor(element: HTMLElement, settings: Settings);
checkElement(element: HTMLElement): void;
getViewportElement(): HTMLElement;
onInit(settings: Settings): void;
findElementBySelector(element: HTMLElement, selector: string): HTMLElement | null;
findPaddingElement(direction: Direction): HTMLElement | null;
findItemElement(id: string): HTMLElement | null;
findItemChildBySelector(id: string, selector: string): HTMLElement | null;
getScrollPosition(): number;
setScrollPosition(value: number): void;
getElementParams(element: HTMLElement): DOMRect;
getWindowParams(): DOMRect;
getSize(element: HTMLElement): number;
getScrollerSize(): number;
getViewportSize(): number;
getSizeStyle(element: HTMLElement): number;
setSizeStyle(element: HTMLElement, value: number): void;
getEdge(element: HTMLElement, direction: Direction): number;
getViewportEdge(direction: Direction): number;
makeElementVisible(element: HTMLElement): void;
hideElement(element: HTMLElement): void;
getOffset(): number;
scrollTo(element: HTMLElement, argument?: boolean | ScrollIntoViewOptions): void;
render(cb: () => void, params: {
items: ItemAdapter[];
}): () => void;
animate(cb: () => void): () => void;
onScroll(handler: EventListener): () => void;
}