mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-03-27 22:49:20 +08:00
Merge pull request #16422 from milkisevil/master
lory.js: Adds v2.2.1 methods and option properties
This commit is contained in:
44
types/lory.js/index.d.ts
vendored
44
types/lory.js/index.d.ts
vendored
@@ -1,6 +1,7 @@
|
||||
// Type definitions for lory 0.4.3
|
||||
// Type definitions for lory 2.2.1
|
||||
// Project: https://github.com/meandmax/lory/
|
||||
// Definitions by: kubosho <https://github.com/kubosho/>
|
||||
// philip bulley <https://github.com/milkisevil>
|
||||
// Definitions: https://github.com/DefinitelyTyped/DefinitelyTyped
|
||||
|
||||
declare var lory: LoryStatic;
|
||||
@@ -23,6 +24,11 @@ interface LoryStatic {
|
||||
*/
|
||||
slideTo(index: number): void;
|
||||
|
||||
/**
|
||||
* returns the index of the current slide element
|
||||
*/
|
||||
returnIndex(): number;
|
||||
|
||||
/**
|
||||
* binds eventlisteners, merging default and user options, setup the slides based on DOM (called once during initialisation). Call setup if DOM or user options have changed or eventlisteners needs to be rebinded.
|
||||
*/
|
||||
@@ -32,6 +38,11 @@ interface LoryStatic {
|
||||
* sets the slider back to the starting position and resets the current index (called on resize event).
|
||||
*/
|
||||
reset(): void;
|
||||
|
||||
/**
|
||||
* unmount/destroy the instance of lory
|
||||
*/
|
||||
destroy(): void;
|
||||
}
|
||||
|
||||
interface LoryOptions {
|
||||
@@ -44,6 +55,12 @@ interface LoryOptions {
|
||||
*/
|
||||
slidesToScroll?: number;
|
||||
|
||||
/**
|
||||
* enabled mouse events
|
||||
* default: false
|
||||
*/
|
||||
enableMouseEvents?: boolean;
|
||||
|
||||
/**
|
||||
* time in milliseconds for the animation of a valid slide attempt (default: 300).
|
||||
*/
|
||||
@@ -74,6 +91,31 @@ interface LoryOptions {
|
||||
*/
|
||||
infinite?: boolean | number;
|
||||
|
||||
/**
|
||||
* class name for slider frame
|
||||
* default: 'js_frame'
|
||||
*/
|
||||
classNameFrame?: string;
|
||||
|
||||
/**
|
||||
* class name for slides container
|
||||
* default: 'js_slides'
|
||||
*/
|
||||
classNameSlideContainer?: string;
|
||||
|
||||
/**
|
||||
* class name for slider previous control
|
||||
* default: 'js_prev'
|
||||
*/
|
||||
classNamePrevCtrl?: string;
|
||||
|
||||
/**
|
||||
* class name for slider next control
|
||||
* default: 'js_next'
|
||||
*/
|
||||
classNameNextCtrl?: string;
|
||||
|
||||
|
||||
//////////////////////////////////////////////////
|
||||
// Callbacks
|
||||
//////////////////////////////////////////////////
|
||||
|
||||
@@ -20,7 +20,11 @@
|
||||
snapBackSpeed: 200,
|
||||
ease: 'ease',
|
||||
rewind: true,
|
||||
infinite: false
|
||||
infinite: false,
|
||||
classNameFrame: 'js_frame',
|
||||
classNameSlideContainer: 'js_slides',
|
||||
classNamePrevCtrl: 'js_prev',
|
||||
classNameNextCtrl: 'js_next'
|
||||
});
|
||||
|
||||
// with callbacks
|
||||
@@ -57,6 +61,8 @@
|
||||
lory.setup();
|
||||
lory.prev();
|
||||
lory.next();
|
||||
lory.returnIndex();
|
||||
lory.reset();
|
||||
lory.slideTo(1);
|
||||
lory.destroy();
|
||||
}());
|
||||
|
||||
Reference in New Issue
Block a user