mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-08-06 09:19:08 +00:00
Add declaration for the Swipe
This commit is contained in:
2
swipe/swipe-tests.ts
Normal file
2
swipe/swipe-tests.ts
Normal file
@@ -0,0 +1,2 @@
|
||||
// Creation of element
|
||||
window.mySwipe = Swipe(document.getElementById('slider'));
|
||||
28
swipe/swipe.d.ts
vendored
Normal file
28
swipe/swipe.d.ts
vendored
Normal 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);
|
||||
}
|
||||
Reference in New Issue
Block a user