mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-26 11:12:19 +08:00
Merge pull request #4282 from kant2002/master
Add declaration for the Swipe
This commit is contained in:
@@ -0,0 +1,4 @@
|
||||
/// <reference path="swipe.d.ts" />
|
||||
|
||||
// Creation of element
|
||||
var mySwipe = new Swipe(document.getElementById('slider'));
|
||||
Vendored
+28
@@ -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;
|
||||
}
|
||||
Reference in New Issue
Block a user