UNPKG

epic-slidy

Version:
119 lines (118 loc) 2.82 kB
/** * Slidy main file. */ import { Action, HooksNames, Options, Trigger } from './defs'; import { Hooks } from './modules'; /** * Slidy main class. */ declare class Slidy { data: any; hooks: Hooks; el: HTMLElement; outer: HTMLDivElement; items: HTMLElement[]; context: any; currentIndex: number; newIndex: number; itemsMax: number; group: number; currentGroup: number; newGroup: number; groupsMax: number; private _currentItems; private _manager; private _controls; private _nav; private _pagination; private _eventManager; private _opts; private _debounceDelay; private _hasPause; private _hasErrors; private _destroyed; private _t1; private _t2; constructor(element: HTMLElement | string, opts: Options, _context?: any, // eslint-disable-line @typescript-eslint/no-explicit-any data?: any); /** * Getters/setters. */ get options(): Options; get namespace(): string; /** * Init component. */ init(): void; /** * API (hooks) */ on(hookName: HooksNames, cb: Function): void; off(hookName: HooksNames, cb: Function): void; /** * Navigate to previous slide. */ slidePrev(trigger: Trigger, force?: boolean): void; /** * Navigate to next slide. */ slideNext(trigger: Trigger, force?: boolean): void; /** * Navigate to slide by index. */ slideTo(index: number, trigger: Trigger, animate?: boolean): void; /** * Add move to the manager. */ slide(action: Action): void; /** * Start autoplay. * Enabled via "auto" and used by "pause" options. */ start(delay?: number, auto?: boolean): void; /** * Pause autoplay. * Used by "pause" options. */ stop(): void; /** * Destroy component. */ destroy(): void; /** * Bind event handlers. */ private bind; /** * Height calculation if auto. */ private reset; /** * RWD reset. * Mainly for height… but also for "responsive" groups */ private onResize; /** * Click on slider to go to the next slide. * Enabled via "click" option. */ private _onClick; /** * Same as click but for touch devices. * Enabled via "tap" option. */ private _onTap; /** * Complement gesture for horizontal mouse drag or swipe. * Enabled via "drag" option. */ private _onMove; /** * Play/pause on hover. * Enabled via "auto" + "pause" options. */ private _onEnter; private _onLeave; } export default Slidy; export * from './defs';