mirror of
https://github.com/wassname/DefinitelyTyped.git
synced 2026-08-25 11:11:46 +08:00
Add flipsnap.js type definitions
This commit is contained in:
Vendored
+36
@@ -0,0 +1,36 @@
|
||||
// Type definitions for flipsnap.js
|
||||
// Project: http://pxgrid.github.io/js-flipsnap/
|
||||
// Definitions by: kubosho_ & gsino <https://github.com/kubosho><https://github.com/gsino>
|
||||
// Definitions: https://github.com/borisyankov/DefinitelyTyped
|
||||
|
||||
interface Flipsnap {
|
||||
hasPrev(): boolean;
|
||||
hasNext(): boolean;
|
||||
toPrev(transitionDuration?: number): void;
|
||||
toNext(transitionDuration?: number): void;
|
||||
moveToPoint(point: number, transitionDuration?: number): void;
|
||||
element: HTMLElement;
|
||||
}
|
||||
|
||||
interface FlipsnapStatic {
|
||||
(element: HTMLElement, opts?: FlipsnapOptions): Flipsnap;
|
||||
(element: string, opts?: FlipsnapOptions): Flipsnap;
|
||||
}
|
||||
|
||||
interface FlipsnapOptions {
|
||||
maxPoint?: number;
|
||||
distance?: number;
|
||||
transitionDuration?: number;
|
||||
disableTouch?: boolean;
|
||||
disable3d?: boolean;
|
||||
}
|
||||
|
||||
interface HTMLElement {
|
||||
addEventListener(type: "fstouchend", listener: (ev: FlipsnapEvent) => any, useCapture?: boolean): void;
|
||||
}
|
||||
|
||||
interface FlipsnapEvent extends Event {
|
||||
newPoint: number;
|
||||
}
|
||||
|
||||
declare var Flipsnap: FlipsnapStatic;
|
||||
Reference in New Issue
Block a user