Merge pull request #4282 from kant2002/master

Add declaration for the Swipe
This commit is contained in:
Masahiro Wakame
2015-05-12 01:58:19 +09:00
2 changed files with 32 additions and 0 deletions
+4
View File
@@ -0,0 +1,4 @@
/// <reference path="swipe.d.ts" />
// Creation of element
var mySwipe = new Swipe(document.getElementById('slider'));
+28
View File
@@ -0,0 +1,28 @@
// Type definitions for Swipe 2.0
// Project: https://github.com/thebird/Swipe
// Definitions by: Andrey Kurdyumov <https://github.com/kant2002>
// Definitions: https://github.com/borisyankov/DefinitelyTyped
interface SwipeOptions {
startSlide?: number;
speed?: number;
auto?: number;
continuous?: boolean;
disableScroll?: boolean;
stopPropagation?: boolean;
callback?: (index: number, elem: HTMLElement) => void;
transitionEnd?: (index: number, elem: HTMLElement) => void;
}
declare class Swipe {
constructor(container: HTMLElement, options?: SwipeOptions);
prev(): void;
next(): void;
getPos(): number;
getNumSlides(): number;
kill(): void;
attachEvents(): void;
setup(): void;
slide(index: number, duration: number): void;
}