UNPKG

embla-carousel-autoplay

Version:

An autoplay plugin for Embla Carousel

24 lines (23 loc) 739 B
import { OptionsType } from './Options'; import { CreatePluginType } from 'embla-carousel'; declare module 'embla-carousel' { interface EmblaPluginsType { autoplay: AutoplayType; } interface EmblaEventListType { autoplayPlay: 'autoplay:play'; autoplayStop: 'autoplay:stop'; } } export type AutoplayType = CreatePluginType<{ play: (jump?: boolean) => void; stop: () => void; reset: () => void; isPlaying: () => boolean; }, OptionsType>; export type AutoplayOptionsType = AutoplayType['options']; declare function Autoplay(userOptions?: AutoplayOptionsType): AutoplayType; declare namespace Autoplay { let globalOptions: AutoplayOptionsType | undefined; } export default Autoplay;