From 39bd70e31fa6d0c644c729bd93a20ee17bae4885 Mon Sep 17 00:00:00 2001 From: Andrey Kurdyumov Date: Thu, 7 May 2015 11:05:29 +0600 Subject: [PATCH] Add declaration for the Swipe --- swipe/swipe-tests.ts | 2 ++ swipe/swipe.d.ts | 28 ++++++++++++++++++++++++++++ 2 files changed, 30 insertions(+) create mode 100644 swipe/swipe-tests.ts create mode 100644 swipe/swipe.d.ts 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); +}