Skip to content

Commit 843203a

Browse files
committed
Merge pull request DefinitelyTyped#4282 from kant2002/master
Add declaration for the Swipe
2 parents 803b54b + 8577222 commit 843203a

File tree

2 files changed

+32
-0
lines changed

2 files changed

+32
-0
lines changed

swipe/swipe-tests.ts

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
/// <reference path="swipe.d.ts" />
2+
3+
// Creation of element
4+
var mySwipe = new Swipe(document.getElementById('slider'));

swipe/swipe.d.ts

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
// Type definitions for Swipe 2.0
2+
// Project: https://github.com/thebird/Swipe
3+
// Definitions by: Andrey Kurdyumov <https://github.com/kant2002>
4+
// Definitions: https://github.com/borisyankov/DefinitelyTyped
5+
6+
7+
interface SwipeOptions {
8+
startSlide?: number;
9+
speed?: number;
10+
auto?: number;
11+
continuous?: boolean;
12+
disableScroll?: boolean;
13+
stopPropagation?: boolean;
14+
callback?: (index: number, elem: HTMLElement) => void;
15+
transitionEnd?: (index: number, elem: HTMLElement) => void;
16+
}
17+
18+
declare class Swipe {
19+
constructor(container: HTMLElement, options?: SwipeOptions);
20+
prev(): void;
21+
next(): void;
22+
getPos(): number;
23+
getNumSlides(): number;
24+
kill(): void;
25+
attachEvents(): void;
26+
setup(): void;
27+
slide(index: number, duration: number): void;
28+
}

0 commit comments

Comments
 (0)