diff --git a/types/lory.js/index.d.ts b/types/lory.js/index.d.ts index 75c07f9eed..6da87b70b8 100644 --- a/types/lory.js/index.d.ts +++ b/types/lory.js/index.d.ts @@ -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 +// philip bulley // 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 ////////////////////////////////////////////////// diff --git a/types/lory.js/lory.js-tests.ts b/types/lory.js/lory.js-tests.ts index f67c724e6e..bad97dadf3 100644 --- a/types/lory.js/lory.js-tests.ts +++ b/types/lory.js/lory.js-tests.ts @@ -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(); }());