diff --git a/swipe/swipe-tests.ts b/swipe/swipe-tests.ts new file mode 100644 index 000000000..1bc4b3392 --- /dev/null +++ b/swipe/swipe-tests.ts @@ -0,0 +1,2 @@ +// Creation of element +window.mySwipe = Swipe(document.getElementById('slider')); \ No newline at end of file diff --git a/swipe/swipe.d.ts b/swipe/swipe.d.ts new file mode 100644 index 000000000..d505470a9 --- /dev/null +++ b/swipe/swipe.d.ts @@ -0,0 +1,28 @@ +// Type definitions for Swipe 2.0 +// Project: https://github.com/thebird/Swipe +// Definitions by: Andrey Kurdyumov +// Definitions: https://github.com/borisyankov/DefinitelyTyped + + +interface SwipeOptions { + startSlide?: number; + speed?: number; + auto?: number; + continuous?: boolean; + disableScroll?: boolean; + stopPropagation?: boolean; + callback?: (index, elem) => void; + transitionEnd?: (index, elem) => void; +} + +declare class Swipe { + constructor(container: HTMLElement, options: SwipeOptions); + prev(); + next(); + getPos(); + getNumSlides(); + kill(); + attachEvents(); + setup(); + slide(index: number, duration: number); +}