import Flicking, { DIRECTION, Plugin } from "@egjs/flicking"; /** * Options for the {@link AutoPlay} plugin */ export interface AutoPlayOptions { /** * Time to wait before moving on to the next panel (ms) * @defaultValue 2000 */ duration: number; /** * Duration of the panel move animation (ms). If `undefined`, the Flicking instance's `duration` is used * @defaultValue undefined */ animationDuration: number | undefined; /** * The direction in which the panel moves * @defaultValue "NEXT" */ direction: (typeof DIRECTION)["NEXT"] | (typeof DIRECTION)["PREV"]; /** * Whether to stop when the mouse hovers over the element * @defaultValue false */ stopOnHover: boolean; /** * Whether to stop autoplay when the plugin is first initialized * @defaultValue false */ stopOnInit: boolean; /** * If `stopOnHover` is true, time to wait before resuming after mouse leaves (ms) * @defaultValue Same as `duration` */ delayAfterHover: number; } /** * Plugin that allows you to automatically move to the next/previous panel on a specific time basis * @see {@link https://naver.github.io/egjs-flicking/docs/demos/plugins/autoplay | Demo: AutoPlay} */ declare class AutoPlay implements Plugin { private _duration; private _animationDuration; private _direction; private _stopOnHover; private _stopOnInit; private _delayAfterHover; private _flicking; private _timerId; private _mouseEntered; private _playing; /** Current value of the {@link AutoPlayOptions.duration | duration} option. */ get duration(): number; /** Current value of the {@link AutoPlayOptions.animationDuration | animationDuration} option. */ get animationDuration(): number | undefined; /** Current value of the {@link AutoPlayOptions.direction | direction} option. */ get direction(): AutoPlayOptions["direction"]; /** Current value of the {@link AutoPlayOptions.stopOnHover | stopOnHover} option. */ get stopOnHover(): boolean; /** Current value of the {@link AutoPlayOptions.stopOnInit | stopOnInit} option. */ get stopOnInit(): boolean; /** Current value of the {@link AutoPlayOptions.delayAfterHover | delayAfterHover} option. */ get delayAfterHover(): number; /** Whether the autoplay is currently active * @readonly */ get playing(): boolean; /** Sets {@link AutoPlayOptions.duration | duration}. */ set duration(val: number); /** Sets {@link AutoPlayOptions.animationDuration | animationDuration}. */ set animationDuration(val: number | undefined); /** Sets {@link AutoPlayOptions.direction | direction}. */ set direction(val: AutoPlayOptions["direction"]); /** Sets {@link AutoPlayOptions.stopOnHover | stopOnHover}. */ set stopOnHover(val: boolean); /** Sets {@link AutoPlayOptions.stopOnInit | stopOnInit}. */ set stopOnInit(val: boolean); /** Sets {@link AutoPlayOptions.delayAfterHover | delayAfterHover}. */ set delayAfterHover(val: number); /** * @param options - Options for the AutoPlay instance * @example * ```ts * flicking.addPlugins(new AutoPlay({ duration: 2000, direction: "NEXT" })); * ``` */ constructor(options?: Partial); /** Initialize the plugin and start autoplay on the given Flicking instance. * @param flicking - The Flicking instance to attach this plugin to */ init(flicking: Flicking): void; /** Destroy the plugin, stop autoplay, and remove all event listeners. */ destroy(): void; /** Update the plugin state. This is a no-op for AutoPlay. */ update(): void; /** Start the autoplay timer. Panels will move automatically after the configured {@link AutoPlayOptions.duration | duration}. */ play: () => void; /** Stop the autoplay timer and cancel any pending panel movement. */ stop: () => void; private _movePanel; private _onMouseEnter; private _onMouseLeave; } export default AutoPlay;