Add declaration for the Swipe

This commit is contained in:
Andrey Kurdyumov
2015-05-07 11:05:29 +06:00
parent 557bb595af
commit 39bd70e31f
2 changed files with 30 additions and 0 deletions

2
swipe/swipe-tests.ts Normal file
View File

@@ -0,0 +1,2 @@
// Creation of element
window.mySwipe = Swipe(document.getElementById('slider'));

28
swipe/swipe.d.ts vendored Normal file
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, 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);
}